* fixed all build warnings by collectcatkeys that I found

* automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37747 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2010-07-25 22:58:29 +00:00
parent ad51686353
commit 8eff03f570
23 changed files with 252 additions and 227 deletions

View File

@ -250,7 +250,7 @@ DefaultPartitionPage::_CreatePopUpMenu()
void
DefaultPartitionPage::_GetTimeoutLabel(int32 timeout, BString& label)
{
const char* text = B_TRANSLATE(get_label_for_timeout(timeout));
const char* text = B_TRANSLATE_NOCOLLECT(get_label_for_timeout(timeout));
label = B_TRANSLATE("Timeout: %s");
label.ReplaceFirst("%s", text);
}

View File

@ -170,8 +170,9 @@ TBeMenu::AddNextItem()
bool enabled = false;
for (int i = 0; i < recentTypes; i++) {
recentItem[i] = new TRecentsMenu(B_TRANSLATE(recentTitle[i]),
fBarView, recentType[i]);
recentItem[i]
= new TRecentsMenu(B_TRANSLATE_NOCOLLECT(recentTitle[i]),
fBarView, recentType[i]);
if (recentItem[i])
enabled |= recentItem[i]->RecentsEnabled();
@ -252,9 +253,9 @@ TBeMenu::AddStandardBeMenuItems()
item = new BMenuItem(
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
B_TRANSLATE(kAboutHaikuMenuItemStr)
B_TRANSLATE_NOCOLLECT(kAboutHaikuMenuItemStr)
#else
B_TRANSLATE(kAboutThisSystemMenuItemStr)
B_TRANSLATE_NOCOLLECT(kAboutThisSystemMenuItemStr)
#endif
, new BMessage(kShowSplash));
item->SetEnabled(!dragging);
@ -268,7 +269,7 @@ TBeMenu::AddStandardBeMenuItems()
TrackerBuildRecentFindItemsMenu(kFindMenuItemStr),
new BMessage(kFindButton));
#else
item = new BMenuItem(B_TRANSLATE(kFindMenuItemStr),
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kFindMenuItemStr),
new BMessage(kFindButton));
#endif
item->SetEnabled(!dragging);
@ -284,7 +285,7 @@ TBeMenu::AddStandardBeMenuItems()
#ifdef MOUNT_MENU_IN_DESKBAR
DeskbarMountMenu* mountMenu = new DeskbarMountMenu(
B_TRANSLATE(kMountMenuStr));
B_TRANSLATE_NOCOLLECT(kMountMenuStr));
mountMenu->SetEnabled(!dragging);
AddItem(mountMenu);
#endif
@ -307,7 +308,7 @@ TBeMenu::AddStandardBeMenuItems()
static const char* kSuspendMenuItemStr = B_TRANSLATE_MARK("Suspend");
if (_kapm_control_(APM_CHECK_ENABLED) == B_OK) {
item = new BMenuItem(B_TRANSLATE(kSuspendMenuItemStr),
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kSuspendMenuItemStr),
new BMessage(kSuspendSystem));
item->SetEnabled(!dragging);
shutdownMenu->AddItem(item);

View File

@ -232,7 +232,7 @@ PairsWindow::MessageReceived(BMessage* message)
strAbout.Replace("%s", score.String(), 1);
BAlert* alert = new BAlert("about",
B_TRANSLATE(strAbout.String()),
strAbout.String(),
B_TRANSLATE("New game"),
B_TRANSLATE("Quit game"));

View File

@ -131,7 +131,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
_ReadSettings();
// _NewScreenshot() needs a valid fNameControl
BString name(B_TRANSLATE(fUtility.sDefaultFileNameBase));
BString name(B_TRANSLATE_NOCOLLECT(fUtility.sDefaultFileNameBase));
name << 1;
name = _FindValidFileName(name.String());
fNameControl = new BTextControl("", B_TRANSLATE("Name:"), name, NULL);
@ -141,7 +141,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
_NewScreenshot(silent, clipboard);
return;
}
fScreenshot = fUtility.MakeScreenshot(fIncludeCursor, fGrabActiveWindow,
fIncludeBorder);
@ -192,7 +192,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
.Add(fNameControl->CreateTextViewLayoutItem(), 1, 0)
.Add(menuField->CreateLabelLayoutItem(), 0, 1)
.Add(menuField->CreateMenuBarLayoutItem(), 1, 1)
.Add(new BButton("", B_TRANSLATE("Settings"B_UTF8_ELLIPSIS),
.Add(new BButton("", B_TRANSLATE("Settings"B_UTF8_ELLIPSIS),
new BMessage(kSettings)), 2, 1)
.Add(menuField2->CreateLabelLayoutItem(), 0, 2)
.Add(menuField2->CreateMenuBarLayoutItem(), 1, 2);
@ -339,11 +339,11 @@ ScreenshotWindow::MessageReceived(BMessage* message)
case B_COPY:
fUtility.CopyToClipboard(fScreenshot);
break;
case kSettings:
_ShowSettings(true);
break;
case kCloseTranslatorSettings:
fSettingsWindow->Lock();
fSettingsWindow->Quit();
@ -376,7 +376,7 @@ ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard)
message.AddString("argv", "screenshot");
message.AddString("argv", "--delay");
message.AddString("argv", delay);
if (silent || clipboard) {
if (silent) {
argc++;
@ -419,7 +419,7 @@ ScreenshotWindow::_UpdatePreviewPanel()
{
float height = 150.0f;
float width = (fScreenshot->Bounds().Width()
float width = (fScreenshot->Bounds().Width()
/ fScreenshot->Bounds().Height()) * height;
// to prevent a preview way too wide
@ -595,7 +595,7 @@ ScreenshotWindow::_ShowSettings(bool activate)
{
if (!fSettingsWindow && !activate)
return;
// Find a translator
translator_id translator = 0;
BTranslatorRoster *roster = BTranslatorRoster::Default();
@ -643,7 +643,7 @@ ScreenshotWindow::_ShowSettings(bool activate)
if (activate)
fSettingsWindow->Activate();
} else {
fSettingsWindow = new BWindow(rect,
fSettingsWindow = new BWindow(rect,
B_TRANSLATE("Translator Settings"),
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_ZOOMABLE | B_NOT_RESIZABLE);
@ -681,7 +681,8 @@ ScreenshotWindow::_FindValidFileName(const char* name)
if (!BEntry(outputPath.Path()).Exists())
return fileName;
if (baseName.FindFirst(B_TRANSLATE(fUtility.sDefaultFileNameBase)) == 0)
if (baseName.FindFirst(B_TRANSLATE_NOCOLLECT(
fUtility.sDefaultFileNameBase)) == 0)
baseName.SetTo(fUtility.sDefaultFileNameBase);
BEntry entry;

View File

@ -36,7 +36,7 @@
#define B_TRANSLATE_CONTEXT "Screenshot"
const char* Utility::sDefaultFileNameBase =
const char* Utility::sDefaultFileNameBase =
B_TRANSLATE_MARK_COMMENT("screenshot",
"Base filename of screenshot files");
@ -97,8 +97,8 @@ Utility::Save(BBitmap** screenshot, const char* fileName, uint32 imageType)
BString extension = GetFileNameExtension(imageType);
do {
fileNameString.SetTo(homePath.Path());
fileNameString << "/" << B_TRANSLATE(sDefaultFileNameBase) << index++
<< extension;
fileNameString << "/" << B_TRANSLATE_NOCOLLECT(sDefaultFileNameBase)
<< index++ << extension;
entry.SetTo(fileNameString.String());
} while (entry.Exists());
}
@ -156,7 +156,7 @@ Utility::MakeScreenshot(bool includeMouse, bool activeWindow,
if (activeWindow && activeWindowFrame.IsValid()) {
BRect frame(activeWindowFrame);
BRect frame(activeWindowFrame);
if (includeBorder) {
frame.InsetBy(-borderSize, -borderSize);
frame.top -= tabFrame.bottom - tabFrame.top;

View File

@ -781,7 +781,8 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
// check for free space before starting copy
if ((totalSize + (4 * kKBSize)) >= dstVol->FreeBytes()) {
BAlert* alert = new BAlert("",
B_TRANSLATE(kNoFreeSpace), B_TRANSLATE("Cancel"),
B_TRANSLATE_NOCOLLECT(kNoFreeSpace),
B_TRANSLATE("Cancel"),
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
@ -1084,8 +1085,8 @@ CopyFile(BEntry *srcFile, StatStruct *srcStat, BDirectory *destDir,
// check for free space first
if ((srcStat->st_size + kKBSize) >= volume.FreeBytes()) {
loopControl->FileError(B_TRANSLATE(kNoFreeSpace), "", B_DEVICE_FULL,
false);
loopControl->FileError(B_TRANSLATE_NOCOLLECT(kNoFreeSpace), "",
B_DEVICE_FULL, false);
throw (status_t)B_DEVICE_FULL;
}
@ -1131,8 +1132,8 @@ CopyFile(BEntry *srcFile, StatStruct *srcStat, BDirectory *destDir,
throw (status_t)err;
if (err != B_OK) {
if (!loopControl->FileError(B_TRANSLATE(kFileErrorString), destName,
err, true)) {
if (!loopControl->FileError(B_TRANSLATE_NOCOLLECT(kFileErrorString),
destName, err, true)) {
throw (status_t)err;
} else {
// user selected continue in spite of error, update status bar
@ -1453,8 +1454,8 @@ CopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl,
}
#endif
if (err != B_OK) {
if (!loopControl->FileError(B_TRANSLATE(kFolderErrorString),
destName, err, true)) {
if (!loopControl->FileError(B_TRANSLATE_NOCOLLECT(
kFolderErrorString), destName, err, true)) {
throw err;
}
@ -1956,7 +1957,7 @@ PreFlightNameCheck(BObjectList<entry_ref> *srcList, const BDirectory *destDir,
if (*collisionCount > 1) {
const char* verb = (moveMode == kMoveSelectionTo)
? B_TRANSLATE("moving") : B_TRANSLATE("copying");
BString replaceMsg(B_TRANSLATE(kReplaceManyStr));
BString replaceMsg(B_TRANSLATE_NOCOLLECT(kReplaceManyStr));
replaceMsg.ReplaceAll("%verb", verb);
BAlert* alert = new BAlert("", replaceMsg.String(),
@ -2081,10 +2082,10 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
BString replaceMsg;
if (moveMode == kCreateLink || moveMode == kCreateRelativeLink) {
replaceMsg.SetTo(B_TRANSLATE(kSymLinkReplaceStr));
replaceMsg.SetTo(B_TRANSLATE_NOCOLLECT(kSymLinkReplaceStr));
replaceMsg.ReplaceFirst("%name", name);
} else if (sourceEntry->IsDirectory()) {
replaceMsg.SetTo(B_TRANSLATE(kDirectoryReplaceStr));
replaceMsg.SetTo(B_TRANSLATE_NOCOLLECT(kDirectoryReplaceStr));
replaceMsg.ReplaceFirst("%name", name);
replaceMsg.ReplaceFirst("%verb",
moveMode == kMoveSelectionTo
@ -2105,7 +2106,7 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
else
destBuffer[0] = '\0';
replaceMsg.SetTo(B_TRANSLATE(kReplaceStr));
replaceMsg.SetTo(B_TRANSLATE_NOCOLLECT(kReplaceStr));
replaceMsg.ReplaceAll("%name", name);
replaceMsg.ReplaceFirst("%dest", destBuffer);
replaceMsg.ReplaceFirst("%src", sourceBuffer);
@ -2195,8 +2196,8 @@ FSDeleteFolder(BEntry *dir_entry, CopyLoopControl *loopControl,
else if (err == B_OK)
dir.Rewind();
else {
loopControl->FileError(B_TRANSLATE(kFileDeleteErrorString),
ref.name, err, false);
loopControl->FileError(B_TRANSLATE_NOCOLLECT(
kFileDeleteErrorString), ref.name, err, false);
}
}
@ -2781,9 +2782,10 @@ _DeleteTask(BObjectList<entry_ref> *list, bool confirm)
if (!dontMoveToTrash) {
BAlert* alert = new BAlert("",
B_TRANSLATE(kDeleteConfirmationStr), B_TRANSLATE("Cancel"),
B_TRANSLATE("Move to Trash"), B_TRANSLATE("Delete"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
B_TRANSLATE_NOCOLLECT(kDeleteConfirmationStr),
B_TRANSLATE("Cancel"), B_TRANSLATE("Move to Trash"),
B_TRANSLATE("Delete"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->SetShortcut(1, 'm');
@ -2799,9 +2801,9 @@ _DeleteTask(BObjectList<entry_ref> *list, bool confirm)
}
} else {
BAlert* alert = new BAlert("",
B_TRANSLATE(kDeleteConfirmationStr), B_TRANSLATE("Cancel"),
B_TRANSLATE("Delete"), NULL, B_WIDTH_AS_USUAL,
B_OFFSET_SPACING, B_WARNING_ALERT);
B_TRANSLATE_NOCOLLECT(kDeleteConfirmationStr),
B_TRANSLATE("Cancel"), B_TRANSLATE("Delete"), NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->SetShortcut(1, 'd');
@ -3191,7 +3193,7 @@ _TrackerLaunchAppWithDocuments(const entry_ref *appRef, const BMessage *refs,
alertString.ReplaceFirst("%name", appRef->name);
alertString.ReplaceFirst("%error", strerror(error));
if (refs && openWithOK && error != B_SHUTTING_DOWN) {
alertString << B_TRANSLATE(kFindAlternativeStr);
alertString << B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
BAlert* alert = new BAlert("", alertString.String(),
B_TRANSLATE("Cancel"), B_TRANSLATE("Find"), 0, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
@ -3348,7 +3350,7 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
alertString.ReplaceFirst("%name", documentRef.name);
alertString.ReplaceFirst("%error", strerror(error));
if (openWithOK)
alternative = B_TRANSLATE(kFindApplicationStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindApplicationStr);
break;
} else {
@ -3431,19 +3433,19 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
return;
}
alternative = B_TRANSLATE(kFindApplicationStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindApplicationStr);
} else if (error == B_LAUNCH_FAILED_APP_IN_TRASH) {
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
"because application \"%app\" is in the Trash. "));
alertString.ReplaceFirst("%document", documentRef.name);
alertString.ReplaceFirst("%app", app.name);
alternative = B_TRANSLATE(kFindAlternativeStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
} else if (error == B_LAUNCH_FAILED_APP_NOT_FOUND) {
alertString.SetTo(
B_TRANSLATE("Could not open \"%name\" (%error). "));
alertString.ReplaceFirst("%name", documentRef.name);
alertString.ReplaceFirst("%error", strerror(error));
alternative = B_TRANSLATE(kFindAlternativeStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
} else if (error == B_MISSING_SYMBOL
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
if (openedDocuments) {
@ -3458,7 +3460,7 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
alertString.ReplaceFirst("%document", documentRef.name);
alertString.ReplaceFirst("%symbol", loaderErrorString.String());
}
alternative = B_TRANSLATE(kFindAlternativeStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
} else if (error == B_MISSING_LIBRARY
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
if (openedDocuments) {
@ -3474,14 +3476,14 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
alertString.ReplaceFirst("%document", documentRef.name);
alertString.ReplaceFirst("%library", loaderErrorString.String());
}
alternative = B_TRANSLATE(kFindAlternativeStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
} else {
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" with "
"application \"%app\" (%error). "));
alertString.ReplaceFirst("%document", documentRef.name);
alertString.ReplaceFirst("%app", app.name);
alertString.ReplaceFirst("%error", strerror(error));
alternative = B_TRANSLATE(kFindAlternativeStr);
alternative = B_TRANSLATE_NOCOLLECT(kFindAlternativeStr);
}
}

View File

@ -733,9 +733,9 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[0]);
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[1]);
dragNDropMessage.AddString("be:actionspecifier",
B_TRANSLATE(kDragNDropActionSpecifiers[0]));
B_TRANSLATE_NOCOLLECT(kDragNDropActionSpecifiers[0]));
dragNDropMessage.AddString("be:actionspecifier",
B_TRANSLATE(kDragNDropActionSpecifiers[1]));
B_TRANSLATE_NOCOLLECT(kDragNDropActionSpecifiers[1]));
BMessenger self(this);
fDraggableIcon = new DraggableQueryIcon(DraggableIcon::PreferredRect(draggableIconOrigin,
@ -1132,11 +1132,13 @@ FindPanel::MessageReceived(BMessage *message)
if (actionSpecifier
&& strcasecmp(actionSpecifier,
B_TRANSLATE(kDragNDropActionSpecifiers[0])) == 0) {
B_TRANSLATE_NOCOLLECT(
kDragNDropActionSpecifiers[0])) == 0) {
query = true;
} else if (actionSpecifier
&& strcasecmp(actionSpecifier,
B_TRANSLATE(kDragNDropActionSpecifiers[1])) == 0) {
B_TRANSLATE_NOCOLLECT(
kDragNDropActionSpecifiers[1])) == 0) {
queryTemplate = true;
} else if (mimeType && strcasecmp(mimeType,
kDragNDropTypes[0]) == 0) {
@ -2391,7 +2393,7 @@ TAttrView::TAttrView(BRect frame, int32 index)
for (int32 i = 0; i < 5; i++) {
message = new BMessage(kAttributeItem);
message->AddInt32("operator", operators[i]);
submenu->AddItem(new BMenuItem(B_TRANSLATE(operatorLabels[i]),
submenu->AddItem(new BMenuItem(B_TRANSLATE_NOCOLLECT(operatorLabels[i]),
message));
}

View File

@ -112,7 +112,7 @@ Model::Model(const Model &cloneThis)
{
fStatBuf.st_dev = cloneThis.NodeRef()->device;
fStatBuf.st_ino = cloneThis.NodeRef()->node;
if (cloneThis.IsSymLink() && cloneThis.LinkTo())
fLinkTo = new Model(*cloneThis.LinkTo());
@ -164,7 +164,7 @@ Model::Model(const entry_ref *ref, bool traverse, bool open, bool writable)
}
void
void
Model::DeletePreferredAppVolumeNameLinkTo()
{
if (IsSymLink()) {
@ -185,9 +185,9 @@ Model::DeletePreferredAppVolumeNameLinkTo()
Model::~Model()
{
#ifdef CHECK_OPEN_MODEL_LEAKS
if (writableOpenModelList)
if (writableOpenModelList)
writableOpenModelList->RemoveItem(this);
if (readOnlyOpenModelList)
if (readOnlyOpenModelList)
readOnlyOpenModelList->RemoveItem(this);
#endif
@ -205,7 +205,7 @@ Model::~Model()
}
status_t
status_t
Model::SetTo(const BEntry *entry, bool open, bool writable)
{
delete fNode;
@ -218,20 +218,20 @@ Model::SetTo(const BEntry *entry, bool open, bool writable)
fStatus = entry->GetRef(&fEntryRef);
if (fStatus != B_OK)
return fStatus;
fStatus = entry->GetStat(&fStatBuf);
if (fStatus != B_OK)
return fStatus;
fStatus = OpenNode(writable);
if (!open)
CloseNode();
return fStatus;
}
status_t
status_t
Model::SetTo(const entry_ref *newRef, bool traverse, bool open, bool writable)
{
delete fNode;
@ -254,16 +254,16 @@ Model::SetTo(const entry_ref *newRef, bool traverse, bool open, bool writable)
fStatus = tmpEntry.GetStat(&fStatBuf);
if (fStatus != B_OK)
return fStatus;
fStatus = OpenNode(writable);
if (!open)
CloseNode();
return fStatus;
}
status_t
status_t
Model::SetTo(const node_ref *dirNode, const node_ref *nodeRef, const char *name,
bool open, bool writable)
{
@ -284,7 +284,7 @@ Model::SetTo(const node_ref *dirNode, const node_ref *nodeRef, const char *name,
fStatus = tmpNode.InitCheck();
if (fStatus != B_OK)
return fStatus;
fStatus = tmpNode.GetStat(&fStatBuf);
if (fStatus != B_OK)
return fStatus;
@ -293,12 +293,12 @@ Model::SetTo(const node_ref *dirNode, const node_ref *nodeRef, const char *name,
if (!open)
CloseNode();
return fStatus;
}
status_t
status_t
Model::InitCheck() const
{
return fStatus;
@ -339,18 +339,18 @@ Model::Name() const
switch (fBaseType) {
case kRootNode:
return B_TRANSLATE(kRootNodeName);
return B_TRANSLATE_NOCOLLECT(kRootNodeName);
case kVolumeNode:
if (fVolumeName)
return fVolumeName;
break;
case kTrashNode:
return B_TRANSLATE(kTrashNodeName);
return B_TRANSLATE_NOCOLLECT(kTrashNodeName);
case kDesktopNode:
return B_TRANSLATE(kDesktopNodeName);
return B_TRANSLATE_NOCOLLECT(kDesktopNodeName);
default:
break;
@ -359,29 +359,29 @@ Model::Name() const
}
status_t
status_t
Model::OpenNode(bool writable)
{
if (IsNodeOpen() && (writable == IsNodeOpenForWriting()))
return B_OK;
OpenNodeCommon(writable);
return fStatus;
}
status_t
status_t
Model::UpdateStatAndOpenNode(bool writable)
{
if (IsNodeOpen() && (writable == IsNodeOpenForWriting()))
return B_OK;
// try reading the stat structure again
BEntry tmpEntry(&fEntryRef);
fStatus = tmpEntry.InitCheck();
if (fStatus != B_OK)
return fStatus;
fStatus = tmpEntry.GetStat(&fStatBuf);
if (fStatus != B_OK)
return fStatus;
@ -399,9 +399,9 @@ Model::OpenNodeCommon(bool writable)
#endif
#ifdef CHECK_OPEN_MODEL_LEAKS
if (writableOpenModelList)
if (writableOpenModelList)
writableOpenModelList->RemoveItem(this);
if (readOnlyOpenModelList)
if (readOnlyOpenModelList)
readOnlyOpenModelList->RemoveItem(this);
#endif
@ -486,7 +486,7 @@ Model::OpenNodeCommon(bool writable)
}
void
void
Model::CloseNode()
{
#if xDEBUG
@ -494,9 +494,9 @@ Model::CloseNode()
#endif
#ifdef CHECK_OPEN_MODEL_LEAKS
if (writableOpenModelList)
if (writableOpenModelList)
writableOpenModelList->RemoveItem(this);
if (readOnlyOpenModelList)
if (readOnlyOpenModelList)
readOnlyOpenModelList->RemoveItem(this);
#endif
@ -505,7 +505,7 @@ Model::CloseNode()
}
bool
bool
Model::IsNodeOpen() const
{
return fNode != NULL;
@ -513,7 +513,7 @@ Model::IsNodeOpen() const
bool
bool
Model::IsNodeOpenForWriting() const
{
return fNode != NULL && fWritable;
@ -531,10 +531,10 @@ Model::SetupBaseType()
case S_IFREG:
// regular file
if (fStatBuf.st_mode & S_IXUSR)
if (fStatBuf.st_mode & S_IXUSR)
// executable
fBaseType = kExecutableNode;
else
else
// non-executable
fBaseType = kPlainNode;
break;
@ -602,7 +602,7 @@ Model::FinishSettingUpType()
DeletePreferredAppVolumeNameLinkTo();
if (mimeString[0])
fPreferredAppName = strdup(mimeString);
fPreferredAppName = strdup(mimeString);
}
}
}
@ -611,12 +611,12 @@ Model::FinishSettingUpType()
case kDirectoryNode:
entry.SetTo(&fEntryRef);
if (entry.InitCheck() == B_OK) {
if (FSIsTrashDir(&entry))
if (FSIsTrashDir(&entry))
fBaseType = kTrashNode;
else if (FSIsDeskDir(&entry))
fBaseType = kDesktopNode;
}
fMimeType = B_DIR_MIMETYPE; // should use a shared string here
if (IsNodeOpen()) {
BNodeInfo info(fNode);
@ -678,7 +678,7 @@ Model::FinishSettingUpType()
DeletePreferredAppVolumeNameLinkTo();
if (signature[0])
fPreferredAppName = strdup(signature);
fPreferredAppName = strdup(signature);
}
}
if (!fMimeType.Length())
@ -693,7 +693,7 @@ Model::FinishSettingUpType()
}
void
void
Model::ResetIconFrom()
{
BModelOpener opener(this);
@ -727,7 +727,7 @@ Model::PreferredAppSignature() const
}
void
void
Model::SetPreferredAppSignature(const char *signature)
{
ASSERT(!IsVolume() && !IsSymLink());
@ -768,7 +768,7 @@ Model::ResolveIfLink()
}
void
void
Model::SetLinkTo(Model *model)
{
ASSERT(IsSymLink());
@ -779,7 +779,7 @@ Model::SetLinkTo(Model *model)
}
void
void
Model::GetPreferredAppForBrokenSymLink(BString &result)
{
if (!IsSymLink() || LinkTo()) {
@ -788,7 +788,7 @@ Model::GetPreferredAppForBrokenSymLink(BString &result)
}
BModelOpener opener(this);
BNodeInfo info(fNode);
BNodeInfo info(fNode);
status_t error = info.GetPreferredApp(result.LockBuffer(B_MIME_TYPE_LENGTH));
result.UnlockBuffer();
@ -806,7 +806,7 @@ Model::UpdateEntryRef(const node_ref *dirNode, const char *name)
if (IsVolume()) {
if (fVolumeName)
DeletePreferredAppVolumeNameLinkTo();
fVolumeName = strdup(name);
}
@ -820,11 +820,11 @@ Model::UpdateEntryRef(const node_ref *dirNode, const char *name)
}
status_t
status_t
Model::WatchVolumeAndMountPoint(uint32 , BHandler *target)
{
ASSERT(IsVolume());
if (fEntryRef.name && fVolumeName
&& strcmp(fEntryRef.name, "boot") == 0) {
// watch mount point for boot volume
@ -842,7 +842,7 @@ Model::WatchVolumeAndMountPoint(uint32 , BHandler *target)
}
bool
bool
Model::AttrChanged(const char *attrName)
{
// called on an attribute changed node monitor
@ -865,7 +865,7 @@ Model::AttrChanged(const char *attrName)
fMimeType = "";
else {
// node has a specific mime type
fMimeType = mimeString;
fMimeType = mimeString;
if (!IsVolume()
&& !IsSymLink()
&& info.GetPreferredApp(mimeString) == B_OK)
@ -890,7 +890,7 @@ Model::AttrChanged(const char *attrName)
}
bool
bool
Model::StatChanged()
{
ASSERT(IsNodeOpen());
@ -950,22 +950,22 @@ Model::IsDropTarget(const Model *forDocument, bool traverse) const
}
Model::CanHandleResult
Model::CanHandleResult
Model::CanHandleDrops() const
{
if (IsDirectory())
// directories take anything
// resolve permissions here
// resolve permissions here
return kCanHandle;
if (IsSymLink()) {
// descend into symlink and try again on it's target
BEntry entry(&fEntryRef, true);
if (entry.InitCheck() != B_OK)
return kCannotHandle;
if (entry == BEntry(EntryRef()))
// self-referencing link, avoid infinite recursion
return kCannotHandle;
@ -976,7 +976,7 @@ Model::CanHandleDrops() const
return model.CanHandleDrops();
}
if (IsExecutable())
return kNeedToCheckType;
@ -1007,7 +1007,7 @@ MatchMimeTypeString(/*const */BString *documentType, const char *handlerType)
int32 supertypeOnlyLength = 0;
const char *tmp = strstr(handlerType, "/");
if (!tmp)
// no subtype - supertype string only
supertypeOnlyLength = (int32)strlen(handlerType);
@ -1022,7 +1022,7 @@ MatchMimeTypeString(/*const */BString *documentType, const char *handlerType)
return kDontMatch;
}
}
if (documentType->ICompare(handlerType) == 0)
return kMatch;
@ -1030,7 +1030,7 @@ MatchMimeTypeString(/*const */BString *documentType, const char *handlerType)
}
int32
int32
Model::SupportsMimeType(const char *type, const BObjectList<BString> *list,
bool exactReason) const
{
@ -1038,12 +1038,12 @@ Model::SupportsMimeType(const char *type, const BObjectList<BString> *list,
// pass in one or the other
int32 result = kDoesNotSupportType;
BFile file(EntryRef(), O_RDONLY);
BAppFileInfo handlerInfo(&file);
BMessage message;
if (handlerInfo.GetSupportedTypes(&message) != B_OK)
if (handlerInfo.GetSupportedTypes(&message) != B_OK)
return kDoesNotSupportType;
for (int32 index = 0; ; index++) {
@ -1053,17 +1053,17 @@ Model::SupportsMimeType(const char *type, const BObjectList<BString> *list,
int32 bufferLength;
if (message.FindData("types", 'CSTR', index, (const void **)&mimeSignature,
&bufferLength))
&bufferLength))
return result;
if (IsSuperHandlerSignature(mimeSignature)) {
if (!exactReason)
if (!exactReason)
return kSuperhandlerModel;
if (result == kDoesNotSupportType)
if (result == kDoesNotSupportType)
result = kSuperhandlerModel;
}
int32 match;
if (type) {
@ -1073,12 +1073,12 @@ Model::SupportsMimeType(const char *type, const BObjectList<BString> *list,
match = WhileEachListItem(const_cast<BObjectList<BString> *>(list),
MatchMimeTypeString, mimeSignature);
// const_cast shouldnt be here, have to have it until MW cleans up
if (match == kMatch)
if (match == kMatch)
// supports the actual type, it can't get any better
return kModelSupportsType;
else if (match == kMatchSupertype) {
if (!exactReason)
if (!exactReason)
return kModelSupportsSupertype;
// we already know this model supports the file as a supertype,
@ -1091,7 +1091,7 @@ Model::SupportsMimeType(const char *type, const BObjectList<BString> *list,
}
bool
bool
Model::IsDropTargetForList(const BObjectList<BString> *list) const
{
switch (CanHandleDrops()) {
@ -1100,7 +1100,7 @@ Model::IsDropTargetForList(const BObjectList<BString> *list) const
case kCannotHandle:
return false;
default:
break;
}
@ -1108,7 +1108,7 @@ Model::IsDropTargetForList(const BObjectList<BString> *list) const
}
bool
bool
Model::IsSuperHandler() const
{
ASSERT(CanHandleDrops() == kNeedToCheckType);
@ -1135,14 +1135,14 @@ Model::IsSuperHandler() const
}
void
void
Model::GetEntry(BEntry *entry) const
{
entry->SetTo(EntryRef());
}
void
void
Model::GetPath(BPath *path) const
{
BEntry entry(EntryRef());
@ -1150,7 +1150,7 @@ Model::GetPath(BPath *path) const
}
bool
bool
Model::Mimeset(bool force)
{
BString oldType = MimeType();
@ -1172,12 +1172,12 @@ Model::Mimeset(bool force)
}
ssize_t
ssize_t
Model::WriteAttr(const char *attr, type_code type, off_t offset,
const void *buffer, size_t length)
{
BModelWriteOpener opener(this);
if (!fNode)
if (!fNode)
return 0;
ssize_t result = fNode->WriteAttr(attr, type, offset, buffer, length);
@ -1185,14 +1185,14 @@ Model::WriteAttr(const char *attr, type_code type, off_t offset,
}
ssize_t
ssize_t
Model::WriteAttrKillForeign(const char *attr, const char *foreignAttr,
type_code type, off_t offset, const void *buffer, size_t length)
{
BModelWriteOpener opener(this);
if (!fNode)
if (!fNode)
return 0;
ssize_t result = fNode->WriteAttr(attr, type, offset, buffer, length);
if (result == (ssize_t)length)
// nuke attribute in opposite endianness
@ -1201,7 +1201,7 @@ Model::WriteAttrKillForeign(const char *attr, const char *foreignAttr,
}
status_t
status_t
Model::GetLongVersionString(BString &result, version_kind kind)
{
BFile file(EntryRef(), O_RDONLY);
@ -1223,7 +1223,7 @@ Model::GetLongVersionString(BString &result, version_kind kind)
return B_OK;
}
status_t
status_t
Model::GetVersionString(BString &result, version_kind kind)
{
BFile file(EntryRef(), O_RDONLY);

View File

@ -85,7 +85,7 @@ APRView::APRView(const char *name, uint32 flags)
for (int32 i = 0; i < color_description_count(); i++) {
const ColorDescription& description = *get_color_description(i);
const char* text = B_TRANSLATE(description.text);
const char* text = B_TRANSLATE_NOCOLLECT(description.text);
color_which which = description.which;
fAttrList->AddItem(new ColorWhichItem(text, which));
}

View File

@ -235,14 +235,15 @@ AntialiasingSettingsView::_BuildAntialiasingMenu()
BMessage* message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", false);
BMenuItem* item = new BMenuItem(B_TRANSLATE(kGrayscaleLabel), message);
BMenuItem* item
= new BMenuItem(B_TRANSLATE_NOCOLLECT(kGrayscaleLabel), message);
fAntialiasingMenu->AddItem(item);
message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", true);
item = new BMenuItem(B_TRANSLATE(kSubpixelLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kSubpixelLabel), message);
fAntialiasingMenu->AddItem(item);
}
@ -255,18 +256,18 @@ AntialiasingSettingsView::_BuildHintingMenu()
BMessage* message = new BMessage(kMsgSetHinting);
message->AddInt8("hinting", HINTING_MODE_OFF);
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kNoHintingLabel),
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE_NOCOLLECT(kNoHintingLabel),
message));
message = new BMessage(kMsgSetHinting);
message->AddInt8("hinting", HINTING_MODE_ON);
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kFullHintingLabel),
message));
fHintingMenu->AddItem(new BMenuItem(
B_TRANSLATE_NOCOLLECT(kFullHintingLabel), message));
message = new BMessage(kMsgSetHinting);
message->AddInt8("hinting", HINTING_MODE_MONOSPACED_ONLY);
fHintingMenu->AddItem(new BMenuItem(B_TRANSLATE(kMonospacedHintingLabel),
message));
fHintingMenu->AddItem(new BMenuItem(
B_TRANSLATE_NOCOLLECT(kMonospacedHintingLabel), message));
}
@ -275,8 +276,8 @@ AntialiasingSettingsView::_SetCurrentAntialiasing()
{
BMenuItem *item = fAntialiasingMenu->FindItem(
fCurrentSubpixelAntialiasing
? B_TRANSLATE(kSubpixelLabel)
: B_TRANSLATE(kGrayscaleLabel));
? B_TRANSLATE_NOCOLLECT(kSubpixelLabel)
: B_TRANSLATE_NOCOLLECT(kGrayscaleLabel));
if (item != NULL)
item->SetMarked(true);
if (fCurrentSubpixelAntialiasing)
@ -300,7 +301,7 @@ AntialiasingSettingsView::_SetCurrentHinting()
break;
}
BMenuItem *item = fHintingMenu->FindItem(B_TRANSLATE(label));
BMenuItem *item = fHintingMenu->FindItem(B_TRANSLATE_NOCOLLECT(label));
if (item != NULL)
item->SetMarked(true);
}

View File

@ -18,6 +18,7 @@
#include <TextView.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Device View"
BluetoothDeviceView::BluetoothDeviceView(BRect frame, BluetoothDevice* bDevice,

View File

@ -15,6 +15,7 @@
#include "defs.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "main"
BluetoothApplication::BluetoothApplication(void)

View File

@ -26,6 +26,8 @@
#include "defs.h"
#include "BluetoothWindow.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Settings view"
static const int32 kMsgSetAntialiasing = 'anti';
@ -203,18 +205,18 @@ BluetoothSettingsView::_BuildConnectionPolicy()
BMessage* message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", false);
BMenuItem* item = new BMenuItem(B_TRANSLATE(kAllLabel), message);
BMenuItem* item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kAllLabel), message);
fPolicyMenu->AddItem(item);
message = new BMessage(kMsgSetAntialiasing);
message->AddBool("antialiasing", true);
item = new BMenuItem(B_TRANSLATE(kTrustedLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kTrustedLabel), message);
fPolicyMenu->AddItem(item);
BMenuItem* item2 = new BMenuItem(B_TRANSLATE(kAlwaysLabel), NULL);
BMenuItem* item2 = new BMenuItem(B_TRANSLATE_NOCOLLECT(kAlwaysLabel), NULL);
fPolicyMenu->AddItem(item2);
@ -229,23 +231,24 @@ BluetoothSettingsView::_BuildClassMenu()
BMessage* message;
message = new BMessage(kMsgSetDeviceClassDesktop);
BMenuItem* item = new BMenuItem(B_TRANSLATE(kDesktopLabel), message);
BMenuItem* item
= new BMenuItem(B_TRANSLATE_NOCOLLECT(kDesktopLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassServer);
item = new BMenuItem(B_TRANSLATE(kServerLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kServerLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassLaptop);
item = new BMenuItem(B_TRANSLATE(kLaptopLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kLaptopLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassHandheld);
item = new BMenuItem(B_TRANSLATE(kHandheldLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kHandheldLabel), message);
fClassMenu->AddItem(item);
message = new BMessage(kMsgSetDeviceClassSmartPhone);
item = new BMenuItem(B_TRANSLATE(kPhoneLabel), message);
item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kPhoneLabel), message);
fClassMenu->AddItem(item);
}

View File

@ -20,6 +20,8 @@
#include "defs.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Window"
static const uint32 kMsgSetDefaults = 'dflt';

View File

@ -16,6 +16,8 @@
#include <SpaceLayoutItem.h>
#include <StringView.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Extended local device view"
ExtendedLocalDeviceView::ExtendedLocalDeviceView(BRect frame,

View File

@ -26,6 +26,8 @@
#include "DeviceListItem.h"
#include "InquiryPanel.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Inquiry panel"
using Bluetooth::DeviceListItem;

View File

@ -26,6 +26,8 @@
#include "InquiryPanel.h"
#include "RemoteDevicesView.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Remote devices"
static const uint32 kMsgAddDevices = 'ddDv';

View File

@ -131,7 +131,7 @@ SettingsView::SettingsView(MouseSettings &settings)
BMessage *message = new BMessage(kMsgMouseFocusMode);
message->AddInt32("mode", focusModes[i]);
fFocusMenu->AddItem(new BMenuItem(B_TRANSLATE(focusLabels[i]),
fFocusMenu->AddItem(new BMenuItem(B_TRANSLATE_NOCOLLECT(focusLabels[i]),
message));
}
@ -154,7 +154,7 @@ SettingsView::SettingsView(MouseSettings &settings)
focusFollowsMouseModes[i]);
fFocusFollowsMouseMenu->AddItem(new BMenuItem(
B_TRANSLATE(focusFollowsMouseLabels[i]), message));
B_TRANSLATE_NOCOLLECT(focusFollowsMouseLabels[i]), message));
}
BMenuField *fFocusFollowsMouseField = new BMenuField(

View File

@ -66,8 +66,12 @@ byte_string(int64 size)
if (value < 1024)
snprintf(string, sizeof(string), B_TRANSLATE("%Ld B"), size);
else {
static const char *units[] = {B_TRANSLATE_MARK("KB"),
B_TRANSLATE_MARK("MB"), B_TRANSLATE_MARK("GB"), NULL};
static const char *units[] = {
B_TRANSLATE_MARK("KB"),
B_TRANSLATE_MARK("MB"),
B_TRANSLATE_MARK("GB"),
NULL
};
int32 i = -1;
do {
@ -76,7 +80,8 @@ byte_string(int64 size)
} while (value >= 1024 && units[i + 1]);
off_t rounded = off_t(value * 100LL);
sprintf(string, "%g %s", rounded / 100.0, B_TRANSLATE(units[i]));
sprintf(string, "%g %s", rounded / 100.0,
B_TRANSLATE_NOCOLLECT(units[i]));
}
return string;

View File

@ -75,26 +75,26 @@ static struct PageFormat
"paper size"), ledger_width, ledger_height },
{B_TRANSLATE_MARK_COMMENT("Tabloid", "ANSI B (tabloid), a North American "
"paper size"), tabloid_width, tabloid_height },
{B_TRANSLATE_MARK_COMMENT("A0", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A0", "ISO 216 paper size"),
a0_width, a0_height },
{B_TRANSLATE_MARK_COMMENT("A1", "ISO 216 paper size"),
a1_width, a1_height },
{B_TRANSLATE_MARK_COMMENT("A2", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A2", "ISO 216 paper size"),
a2_width, a2_height },
{B_TRANSLATE_MARK_COMMENT("A3", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A3", "ISO 216 paper size"),
a3_width, a3_height },
{B_TRANSLATE_MARK_COMMENT("A4", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A4", "ISO 216 paper size"),
a4_width, a4_height },
{B_TRANSLATE_MARK_COMMENT("A5", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A5", "ISO 216 paper size"),
a5_width, a5_height },
{B_TRANSLATE_MARK_COMMENT("A6", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("A6", "ISO 216 paper size"),
a6_width, a6_height },
{B_TRANSLATE_MARK_COMMENT("B5", "ISO 216 paper size"),
{B_TRANSLATE_MARK_COMMENT("B5", "ISO 216 paper size"),
b5_width, b5_height },
};
static void
static void
GetPageFormat(float w, float h, BString& label)
{
w = floor(w + 0.5); h = floor(h + 0.5);
@ -102,7 +102,7 @@ GetPageFormat(float w, float h, BString& label)
struct PageFormat& pf = pageFormat[i];
if ((pf.width == w && pf.height == h) || (pf.width == h
&& pf.height == w)) {
label = B_TRANSLATE(pf.label);
label = B_TRANSLATE_NOCOLLECT(pf.label);
return;
}
}
@ -137,7 +137,7 @@ ConfigWindow::ConfigWindow(config_setup_kind kind, Printer* defaultPrinter,
{
MimeTypeForSender(settings, fSenderMimeType);
PrinterForMimeType();
if (kind == kJobSetup)
SetTitle(B_TRANSLATE("Print setup"));
@ -249,7 +249,7 @@ ConfigWindow::~ConfigWindow()
}
void
void
ConfigWindow::Go()
{
sem_id sid = create_sem(0, "finished");
@ -264,7 +264,7 @@ ConfigWindow::Go()
}
void
void
ConfigWindow::MessageReceived(BMessage* m)
{
switch (m->what) {
@ -316,7 +316,7 @@ ConfigWindow::AboutRequested()
}
void
void
ConfigWindow::FrameMoved(BPoint p)
{
BRect frame = GetWindowFrame();
@ -325,7 +325,7 @@ ConfigWindow::FrameMoved(BPoint p)
}
BRect
BRect
ConfigWindow::GetWindowFrame()
{
BAutolock lock(gLock);
@ -336,7 +336,7 @@ ConfigWindow::GetWindowFrame()
}
void
void
ConfigWindow::SetWindowFrame(BRect r)
{
BAutolock lock(gLock);
@ -345,7 +345,7 @@ ConfigWindow::SetWindowFrame(BRect r)
}
BPictureButton*
BPictureButton*
ConfigWindow::AddPictureButton(BView* panel, BRect frame,
const char* name, const char* on, const char* off, uint32 what)
{
@ -386,7 +386,7 @@ ConfigWindow::AddPictureButton(BView* panel, BRect frame,
}
void
void
ConfigWindow::PrinterForMimeType()
{
BAutolock lock(gLock);
@ -409,7 +409,7 @@ ConfigWindow::PrinterForMimeType()
}
void
void
ConfigWindow::SetupPrintersMenu(BMenu* menu)
{
// clear menu
@ -434,7 +434,7 @@ ConfigWindow::SetupPrintersMenu(BMenu* menu)
}
void
void
ConfigWindow::UpdateAppSettings(const char* mime, const char* printer)
{
BAutolock lock(gLock);
@ -449,7 +449,7 @@ ConfigWindow::UpdateAppSettings(const char* mime, const char* printer)
}
void
void
ConfigWindow::UpdateSettings(bool read)
{
BAutolock lock(gLock);
@ -473,7 +473,7 @@ ConfigWindow::UpdateSettings(bool read)
}
void
void
ConfigWindow::UpdateUI()
{
if (fCurrentPrinter == NULL) {
@ -518,9 +518,9 @@ ConfigWindow::UpdateUI()
if (fJobSettings.FindInt32(PSRV_FIELD_FIRST_PAGE, &first) == B_OK
&& fJobSettings.FindInt32(PSRV_FIELD_LAST_PAGE, &last) ==
B_OK) {
bool printRange = first >= 1 && first <= last && last != INT_MAX;
char number[12];
char number[12];
if (fJobSettings.FindInt32(PSRV_FIELD_COPIES, &copies)
== B_OK && copies > 1) {
if (printRange) {
@ -548,14 +548,14 @@ ConfigWindow::UpdateUI()
}
} else
job << B_TRANSLATE("Undefined");
fJobSetupText->SetText(job.String());
}
}
}
void
void
ConfigWindow::Setup(config_setup_kind kind)
{
if (fCurrentPrinter) {

View File

@ -45,7 +45,7 @@ static property_info prop_list[] = {
{ "UseConfigWindow", { B_GET_PROPERTY, B_SET_PROPERTY },
{ B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Show configuration window") },
{ 0 } // terminate list
{ 0 } // terminate list
};
@ -62,19 +62,19 @@ PrintServerApp::HandleScriptingCommand(BMessage* msg)
case B_GET_PROPERTY:
if (propName == "ActivePrinter") {
BMessage reply(B_REPLY);
reply.AddString("result", fDefaultPrinter
reply.AddString("result", fDefaultPrinter
? fDefaultPrinter->Name() : "");
reply.AddInt32("error", B_OK);
msg->SendReply(&reply);
} else if (propName == "UseConfigWindow") {
BMessage reply(B_REPLY);
reply.AddString("result", fUseConfigWindow
reply.AddString("result", fUseConfigWindow
? "true" : "false");
reply.AddInt32("error", B_OK);
msg->SendReply(&reply);
}
break;
case B_SET_PROPERTY:
if (propName == "ActivePrinter") {
BString newActivePrinter;
@ -90,11 +90,11 @@ PrintServerApp::HandleScriptingCommand(BMessage* msg)
fUseConfigWindow = useConfigWindow;
BMessage reply(B_REPLY);
reply.AddInt32("error", fUseConfigWindow);
msg->SendReply(&reply);
msg->SendReply(&reply);
}
}
break;
case B_CREATE_PROPERTY:
if (propName == "Printer") {
BString name, driver, transport, config;
@ -111,20 +111,20 @@ PrintServerApp::HandleScriptingCommand(BMessage* msg)
}
}
break;
case B_DELETE_PROPERTY: {
Printer* printer = GetPrinterFromSpecifier(&spec);
status_t rc = B_BAD_VALUE;
if (printer != NULL)
rc=printer->Remove();
BMessage reply(B_REPLY);
reply.AddInt32("error", rc);
msg->SendReply(&reply);
}
break;
case B_COUNT_PROPERTIES:
if (propName == "Printers") {
BMessage reply(B_REPLY);
@ -143,7 +143,7 @@ PrintServerApp::HandleScriptingCommand(BMessage* msg)
}
Printer*
Printer*
PrintServerApp::GetPrinterFromSpecifier(BMessage* msg)
{
switch(msg->what) {
@ -154,7 +154,7 @@ PrintServerApp::GetPrinterFromSpecifier(BMessage* msg)
return Printer::Find(name.String());
break;
}
case B_INDEX_SPECIFIER:
{
int32 idx;
@ -171,12 +171,12 @@ PrintServerApp::GetPrinterFromSpecifier(BMessage* msg)
break;
}
}
return NULL;
}
Transport*
Transport*
PrintServerApp::GetTransportFromSpecifier(BMessage* msg)
{
switch(msg->what) {
@ -187,7 +187,7 @@ PrintServerApp::GetTransportFromSpecifier(BMessage* msg)
return Transport::Find(name);
break;
}
case B_INDEX_SPECIFIER:
{
int32 idx;
@ -204,7 +204,7 @@ PrintServerApp::GetTransportFromSpecifier(BMessage* msg)
break;
}
}
return NULL;
}
@ -223,7 +223,7 @@ PrintServerApp::ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
case 1:
// GET Printer [arg]
if ((rc=GetPrinterFromSpecifier(spec)) == NULL) {
if ((rc=GetPrinterFromSpecifier(spec)) == NULL) {
BMessage reply(B_REPLY);
reply.AddInt32("error", B_BAD_INDEX);
msg->SendReply(&reply);
@ -246,7 +246,7 @@ PrintServerApp::ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
default:
rc = this;
}
return rc;
}
@ -255,16 +255,16 @@ status_t
PrintServerApp::GetSupportedSuites(BMessage* msg)
{
msg->AddString("suites", "suite/vnd.OpenBeOS-printserver");
static bool localized = false;
if (!localized) {
localized = true;
for (int i = 0; prop_list[i].name != NULL; i ++)
prop_list[i].usage = B_TRANSLATE(prop_list[i].usage);
prop_list[i].usage = B_TRANSLATE_NOCOLLECT(prop_list[i].usage);
}
BPropertyInfo prop_info(prop_list);
msg->AddFlat("messages", &prop_info);
return Inherited::GetSupportedSuites(msg);
}

View File

@ -25,7 +25,7 @@
static property_info prop_list[] = {
{ "Name", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Get name of printer") },
B_TRANSLATE_MARK("Get name of printer") },
{ "TransportAddon", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Get name of the transport add-on used for this printer") },
{ "TransportConfig", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
@ -34,11 +34,11 @@ static property_info prop_list[] = {
B_TRANSLATE_MARK("Get name of the printer add-on used for this printer") },
{ "Comments", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Get comments about this printer") },
{ 0 } // terminate list
{ 0 } // terminate list
};
void
void
Printer::HandleScriptingCommand(BMessage* msg)
{
status_t rc = B_ERROR;
@ -84,24 +84,24 @@ Printer::HandleScriptingCommand(BMessage* msg)
}
}
BHandler*
BHandler*
Printer::ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
int32 form, const char* prop)
{
BPropertyInfo prop_info(prop_list);
BHandler* rc = this;
int32 idx;
switch( idx=prop_info.FindMatch(msg,0,spec,form,prop) ) {
case B_ERROR:
rc = Inherited::ResolveSpecifier(msg,index,spec,form,prop);
break;
}
return rc;
}
status_t
status_t
Printer::GetSupportedSuites(BMessage* msg)
{
msg->AddString("suites", "application/x-vnd.OpenBeOS-printer");
@ -110,11 +110,11 @@ Printer::GetSupportedSuites(BMessage* msg)
if (!localized) {
localized = true;
for (int i = 0; prop_list[i].name != NULL; i ++)
prop_list[i].usage = B_TRANSLATE(prop_list[i].usage);
prop_list[i].usage = B_TRANSLATE_NOCOLLECT(prop_list[i].usage);
}
BPropertyInfo prop_info(prop_list);
msg->AddFlat("messages", &prop_info);
return Inherited::GetSupportedSuites(msg);
}

View File

@ -23,14 +23,14 @@
static property_info prop_list[] = {
{ "Name", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Get name of transport") },
B_TRANSLATE_MARK("Get name of transport") },
{ "Ports", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
B_TRANSLATE_MARK("Get currently available ports/devices") },
{ 0 } // terminate list
{ 0 } // terminate list
};
void
void
Transport::HandleScriptingCommand(BMessage* msg)
{
status_t rc = B_ERROR;
@ -77,38 +77,38 @@ Transport::HandleScriptingCommand(BMessage* msg)
}
BHandler*
BHandler*
Transport::ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
int32 form, const char* prop)
{
BPropertyInfo prop_info(prop_list);
BHandler* rc = this;
int32 idx;
switch (idx=prop_info.FindMatch(msg,0,spec,form,prop)) {
case B_ERROR:
rc = Inherited::ResolveSpecifier(msg,index,spec,form,prop);
break;
}
return rc;
}
status_t
status_t
Transport::GetSupportedSuites(BMessage* msg)
{
msg->AddString("suites", "application/x-vnd.OpenBeOS-transport");
static bool localized = false;
if (!localized) {
localized = true;
for (int i = 0; prop_list[i].name != NULL; i ++)
prop_list[i].usage = B_TRANSLATE(prop_list[i].usage);
prop_list[i].usage = B_TRANSLATE_NOCOLLECT(prop_list[i].usage);
}
BPropertyInfo prop_info(prop_list);
msg->AddFlat("messages", &prop_info);
return Inherited::GetSupportedSuites(msg);
}