Patch by Mike Roll as part of GCI: i18n LaunchBox

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39937 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-12-24 09:52:32 +00:00
parent c9ea828200
commit 0e07d4c078
7 changed files with 113 additions and 62 deletions
+13 -7
View File
@@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <AboutWindow.h> #include <AboutWindow.h>
#include <Catalog.h>
#include <Entry.h> #include <Entry.h>
#include <Message.h> #include <Message.h>
#include <String.h> #include <String.h>
@@ -16,6 +17,8 @@
#include "MainWindow.h" #include "MainWindow.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
App::App() App::App()
: :
@@ -49,11 +52,13 @@ App::ReadyToRun()
status_t status = load_settings(&settings, "main_settings", "LaunchBox"); status_t status = load_settings(&settings, "main_settings", "LaunchBox");
if (status >= B_OK) { if (status >= B_OK) {
BMessage windowMessage; BMessage windowMessage;
for (int32 i = 0; settings.FindMessage("window", i, &windowMessage) >= B_OK; i++) { for (int32 i = 0; settings.FindMessage("window", i, &windowMessage)
BString name("Pad "); >= B_OK; i++) {
BString name(B_TRANSLATE("Pad "));
name << i + 1; name << i + 1;
BMessage* windowSettings = new BMessage(windowMessage); BMessage* windowSettings = new BMessage(windowMessage);
MainWindow* window = new MainWindow(name.String(), frame, windowSettings); MainWindow* window = new MainWindow(name.String(), frame,
windowSettings);
window->Show(); window->Show();
windowAdded = true; windowAdded = true;
frame.OffsetBy(10.0, 10.0); frame.OffsetBy(10.0, 10.0);
@@ -62,7 +67,7 @@ App::ReadyToRun()
} }
if (!windowAdded) { if (!windowAdded) {
MainWindow* window = new MainWindow("Pad 1", frame, true); MainWindow* window = new MainWindow(B_TRANSLATE("Pad 1"), frame, true);
window->Show(); window->Show();
} }
} }
@@ -75,7 +80,7 @@ App::MessageReceived(BMessage* message)
case MSG_ADD_WINDOW: { case MSG_ADD_WINDOW: {
BMessage* settings = new BMessage('sett'); BMessage* settings = new BMessage('sett');
bool wasCloned = message->FindMessage("window", settings) == B_OK; bool wasCloned = message->FindMessage("window", settings) == B_OK;
BString name("Pad "); BString name(B_TRANSLATE("Pad "));
name << CountWindows() + 1; name << CountWindows() + 1;
MainWindow* window = new MainWindow(name.String(), MainWindow* window = new MainWindow(name.String(),
BRect(50.0, 50.0, 65.0, 100.0), settings); BRect(50.0, 50.0, 65.0, 100.0), settings);
@@ -99,9 +104,10 @@ void
App::AboutRequested() App::AboutRequested()
{ {
const char* authors[2]; const char* authors[2];
authors[0] = "Stephan Aßmus (aka stippi)"; authors[0] = B_TRANSLATE("Stephan Aßmus (aka stippi)");
authors[1] = NULL; authors[1] = NULL;
BAboutWindow("LaunchBox", 2004, authors).Show(); BString appName = B_TRANSLATE("LaunchBox");
BAboutWindow(appName, 2004, authors).Show();
} }
+28 -13
View File
@@ -16,6 +16,7 @@
#include <Application.h> #include <Application.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h>
#include <Control.h> #include <Control.h>
#include <ControlLook.h> #include <ControlLook.h>
#include <Entry.h> #include <Entry.h>
@@ -28,6 +29,8 @@
#include <TranslationUtils.h> #include <TranslationUtils.h>
#include <Window.h> #include <Window.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
using std::nothrow; using std::nothrow;
// constructor // constructor
@@ -384,13 +387,17 @@ IconButton::SetIcon(const char* pathToBitmap)
if (status == B_OK) if (status == B_OK)
fileBitmap = BTranslationUtils::GetBitmap(path.Path()); fileBitmap = BTranslationUtils::GetBitmap(path.Path());
else else
printf("IconButton::SetIcon() - path.Append() failed: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"path.Append() failed: %s\n"), strerror(status));
} else } else
printf("IconButton::SetIcon() - path.GetParent() failed: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"path.GetParent() failed: %s\n"), strerror(status));
} else } else
printf("IconButton::SetIcon() - path.InitCheck() failed: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"path.InitCheck() failed: %s\n"), strerror(status));
} else } else
printf("IconButton::SetIcon() - be_app->GetAppInfo() failed: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"be_app->GetAppInfo() failed: %s\n"), strerror(status));
} else } else
fileBitmap = BTranslationUtils::GetBitmap(pathToBitmap); fileBitmap = BTranslationUtils::GetBitmap(pathToBitmap);
if (fileBitmap) { if (fileBitmap) {
@@ -433,14 +440,18 @@ IconButton::SetIcon(const BMimeType* fileType, bool small)
status = _MakeBitmaps(bitmap); status = _MakeBitmaps(bitmap);
delete bitmap; delete bitmap;
} else } else
printf("IconButton::SetIcon() - B_RGB32 bitmap is not valid\n"); printf(B_TRANSLATE("IconButton::SetIcon() - "
"B_RGB32 bitmap is not valid\n"));
} else } else
printf("IconButton::SetIcon() - fileType->GetIcon() failed: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"fileType->GetIcon() failed: %s\n"), strerror(status));
} else } else
printf("IconButton::SetIcon() - B_CMAP8 bitmap is not valid\n"); printf(B_TRANSLATE("IconButton::SetIcon() - "
"B_CMAP8 bitmap is not valid\n"));
delete mimeBitmap; delete mimeBitmap;
} else } else
printf("IconButton::SetIcon() - fileType is not valid: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"fileType is not valid: %s\n"), strerror(status));
return status; return status;
} }
@@ -474,7 +485,7 @@ IconButton::SetIcon(const unsigned char* bitsFromQuickRes,
} }
status = _MakeBitmaps(bitmap); status = _MakeBitmaps(bitmap);
} else } else
printf("IconButton::SetIcon() - B_RGB32 bitmap is not valid\n"); printf(B_TRANSLATE("IconButton::SetIcon() - B_RGB32 bitmap is not valid\n"));
delete bitmap; delete bitmap;
} else { } else {
// native colorspace (32 bits) // native colorspace (32 bits)
@@ -498,7 +509,8 @@ IconButton::SetIcon(const unsigned char* bitsFromQuickRes,
status = _MakeBitmaps(quickResBitmap); status = _MakeBitmaps(quickResBitmap);
} }
} else } else
printf("IconButton::SetIcon() - error allocating bitmap: %s\n", strerror(status)); printf(B_TRANSLATE("IconButton::SetIcon() - "
"error allocating bitmap: %s\n"), strerror(status));
delete quickResBitmap; delete quickResBitmap;
} }
return status; return status;
@@ -747,17 +759,20 @@ IconButton::_MakeBitmaps(const BBitmap* bitmap)
} }
// unsupported format // unsupported format
} else { } else {
printf("IconButton::_MakeBitmaps() - bitmap has unsupported colorspace\n"); printf(B_TRANSLATE("IconButton::_MakeBitmaps() - "
"bitmap has unsupported colorspace\n"));
status = B_MISMATCHED_VALUES; status = B_MISMATCHED_VALUES;
_DeleteBitmaps(); _DeleteBitmaps();
} }
} else { } else {
printf("IconButton::_MakeBitmaps() - error allocating local bitmaps\n"); printf(B_TRANSLATE("IconButton::_MakeBitmaps() - "
"error allocating local bitmaps\n"));
status = B_NO_MEMORY; status = B_NO_MEMORY;
_DeleteBitmaps(); _DeleteBitmaps();
} }
} else } else
printf("IconButton::_MakeBitmaps() - bitmap is not valid\n"); printf(B_TRANSLATE("IconButton::_MakeBitmaps() - "
"bitmap is not valid\n"));
return status; return status;
} }
+11 -1
View File
@@ -12,7 +12,17 @@ Application LaunchBox :
PadView.cpp PadView.cpp
Panel.cpp Panel.cpp
support.cpp support.cpp
: be translation libshared.a $(TARGET_LIBSUPC++) : be translation libshared.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: LaunchBox.rdef : LaunchBox.rdef
; ;
DoCatalogs LaunchBox :
x-vnd.Haiku-LaunchBox
:
App.cpp
IconButton.cpp
LaunchButton.cpp
MainWindow.cpp
NamePanel.cpp
PadView.cpp
;
+8 -3
View File
@@ -13,6 +13,7 @@
#include <AppDefs.h> #include <AppDefs.h>
#include <AppFileInfo.h> #include <AppFileInfo.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h>
#include <File.h> #include <File.h>
#include <Node.h> #include <Node.h>
#include <NodeInfo.h> #include <NodeInfo.h>
@@ -23,10 +24,12 @@
#include "PadView.h" #include "PadView.h"
#include "MainWindow.h" #include "MainWindow.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
static const float kDragStartDist = 10.0; static const float kDragStartDist = 10.0;
static const float kDragBitmapAlphaScale = 0.6; static const float kDragBitmapAlphaScale = 0.6;
static const char* kEmptyHelpString = "You can drag an icon here."; static const char* kEmptyHelpString = B_TRANSLATE("You can drag an icon here.");
bigtime_t bigtime_t
@@ -302,10 +305,12 @@ LaunchButton::SetTo(const entry_ref* ref)
if (info.GetSignature(mimeSig) == B_OK) { if (info.GetSignature(mimeSig) == B_OK) {
SetTo(mimeSig, false); SetTo(mimeSig, false);
} else { } else {
fprintf(stderr, "no MIME signature for '%s'\n", fRef->name); fprintf(stderr, B_TRANSLATE("no MIME signature for '%s'\n"),
fRef->name);
} }
} else { } else {
fprintf(stderr, "no BAppFileInfo for '%s'\n", fRef->name); fprintf(stderr, B_TRANSLATE("no BAppFileInfo for '%s'\n"),
fRef->name);
} }
} else { } else {
fRef = NULL; fRef = NULL;
+21 -16
View File
@@ -9,6 +9,7 @@
#include <Alert.h> #include <Alert.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <Menu.h> #include <Menu.h>
#include <MenuItem.h> #include <MenuItem.h>
@@ -24,6 +25,8 @@
#include "PadView.h" #include "PadView.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
MainWindow::MainWindow(const char* name, BRect frame, bool addDefaultButtons) MainWindow::MainWindow(const char* name, BRect frame, bool addDefaultButtons)
: :
BWindow(frame, name, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, BWindow(frame, name, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
@@ -94,9 +97,10 @@ MainWindow::QuitRequested()
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
return false; return false;
} else { } else {
BAlert* alert = new BAlert("last chance", "Really close this pad?\n" BAlert* alert = new BAlert(B_TRANSLATE("last chance"),
"(The pad will not be remembered.)", B_TRANSLATE("Really close this pad?\n"
"Close", "Cancel", NULL); "(The pad will not be remembered.)"),
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
if (alert->Go() == 1) if (alert->Go() == 1)
return false; return false;
} }
@@ -127,24 +131,24 @@ MainWindow::MessageReceived(BMessage* message)
trackerMessage.AddRef("refs", button->Ref()); trackerMessage.AddRef("refs", button->Ref());
status_t ret = messenger.SendMessage(&trackerMessage); status_t ret = messenger.SendMessage(&trackerMessage);
if (ret < B_OK) { if (ret < B_OK) {
errorMessage = "Failed to send 'open folder' " errorMessage = B_TRANSLATE("Failed to send "
"command to Tracker.\n\nError: "; "'open folder' command to Tracker.\n\nError: ");
errorMessage << strerror(ret); errorMessage << strerror(ret);
} else } else
launchedByRef = true; launchedByRef = true;
} else } else
errorMessage = "Failed to open folder - is Tracker " errorMessage = ("Failed to open folder - is Tracker "
"running?"; "running?");
} else { } else {
status_t ret = be_roster->Launch(button->Ref()); status_t ret = be_roster->Launch(button->Ref());
if (ret < B_OK && ret != B_ALREADY_RUNNING) { if (ret < B_OK && ret != B_ALREADY_RUNNING) {
errorMessage = "Failed to launch '"; errorMessage = B_TRANSLATE("Failed to launch '");
BPath path(button->Ref()); BPath path(button->Ref());
if (path.InitCheck() >= B_OK) if (path.InitCheck() >= B_OK)
errorMessage << path.Path(); errorMessage << path.Path();
else else
errorMessage << button->Ref()->name; errorMessage << button->Ref()->name;
errorMessage << "'.\n\nError: "; errorMessage << B_TRANSLATE("'.\n\nError: ");
errorMessage << strerror(ret); errorMessage << strerror(ret);
} else } else
launchedByRef = true; launchedByRef = true;
@@ -153,9 +157,10 @@ MainWindow::MessageReceived(BMessage* message)
if (!launchedByRef && button->AppSignature()) { if (!launchedByRef && button->AppSignature()) {
status_t ret = be_roster->Launch(button->AppSignature()); status_t ret = be_roster->Launch(button->AppSignature());
if (ret != B_OK && ret != B_ALREADY_RUNNING) { if (ret != B_OK && ret != B_ALREADY_RUNNING) {
errorMessage = "Failed to launch application with " errorMessage = B_TRANSLATE("Failed to launch application"
"signature '"; " with signature '");
errorMessage << button->AppSignature() << "'.\n\nError: "; errorMessage << button->AppSignature() <<
B_TRANSLATE("'.\n\nError: ");
errorMessage << strerror(ret); errorMessage << strerror(ret);
} else { } else {
// clear error message on success (might have been // clear error message on success (might have been
@@ -163,12 +168,12 @@ MainWindow::MessageReceived(BMessage* message)
errorMessage = ""; errorMessage = "";
} }
} else if (!launchedByRef) { } else if (!launchedByRef) {
errorMessage = "Failed to launch 'something', error in " errorMessage = B_TRANSLATE("Failed to launch 'something',"
"Pad data."; "error in Pad data.");
} }
if (errorMessage.Length() > 0) { if (errorMessage.Length() > 0) {
BAlert* alert = new BAlert("error", errorMessage.String(), BAlert* alert = new BAlert("error", errorMessage.String(),
"Bummer", NULL, NULL, B_WIDTH_FROM_WIDEST); B_TRANSLATE("Bummer"), NULL, NULL, B_WIDTH_FROM_WIDEST);
alert->Go(NULL); alert->Go(NULL);
} }
break; break;
@@ -207,7 +212,7 @@ MainWindow::MessageReceived(BMessage* message)
// message comes from pad view // message comes from pad view
entry_ref* ref = button->Ref(); entry_ref* ref = button->Ref();
if (ref) { if (ref) {
BString helper("Description for '"); BString helper(B_TRANSLATE("Description for '"));
helper << ref->name << "'"; helper << ref->name << "'";
make_sure_frame_is_on_screen(fNamePanelFrame, this); make_sure_frame_is_on_screen(fNamePanelFrame, this);
new NamePanel(helper.String(), button->Description(), new NamePanel(helper.String(), button->Description(),
+7 -3
View File
@@ -6,12 +6,15 @@
#include <stdio.h> #include <stdio.h>
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include <LayoutBuilder.h> #include <LayoutBuilder.h>
#include <Screen.h> #include <Screen.h>
#include <TextControl.h> #include <TextControl.h>
#include "NamePanel.h" #include "NamePanel.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
enum { enum {
MSG_PANEL_OK, MSG_PANEL_OK,
MSG_PANEL_CANCEL, MSG_PANEL_CANCEL,
@@ -21,7 +24,7 @@ enum {
NamePanel::NamePanel(const char* label, const char* text, BWindow* window, NamePanel::NamePanel(const char* label, const char* text, BWindow* window,
BHandler* target, BMessage* message, BRect frame) BHandler* target, BMessage* message, BRect frame)
: :
Panel(frame, "Name Panel", Panel(frame, B_TRANSLATE("Name Panel"),
B_MODAL_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL, B_MODAL_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_NOT_V_RESIZABLE B_ASYNCHRONOUS_CONTROLS | B_NOT_V_RESIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS), | B_AUTO_UPDATE_SIZE_LIMITS),
@@ -29,8 +32,9 @@ NamePanel::NamePanel(const char* label, const char* text, BWindow* window,
fTarget(target), fTarget(target),
fMessage(message) fMessage(message)
{ {
BButton* defaultButton = new BButton("OK", new BMessage(MSG_PANEL_OK)); BButton* defaultButton = new BButton(B_TRANSLATE("OK"),
BButton* cancelButton = new BButton("Cancel", new BMessage(MSG_PANEL_OK));
BButton* cancelButton = new BButton(B_TRANSLATE("Cancel"),
new BMessage(MSG_PANEL_CANCEL)); new BMessage(MSG_PANEL_CANCEL));
fNameTC = new BTextControl(label, text, NULL); fNameTC = new BTextControl(label, text, NULL);
+25 -19
View File
@@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
@@ -20,6 +21,10 @@
#include "MainWindow.h" #include "MainWindow.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LaunchBox"
static bigtime_t sActivationDelay = 40000; static bigtime_t sActivationDelay = 40000;
static const uint32 kIconSizes[] = { 16, 20, 24, 32, 40, 48, 64 }; static const uint32 kIconSizes[] = { 16, 20, 24, 32, 40, 48, 64 };
@@ -315,11 +320,11 @@ PadView::DisplayMenu(BPoint where, LaunchButton* button) const
break; break;
} }
} }
BPopUpMenu* menu = new BPopUpMenu("launch popup", false, false); BPopUpMenu* menu = new BPopUpMenu(B_TRANSLATE("launch popup"), false, false);
// add button // add button
BMessage* message = new BMessage(MSG_ADD_SLOT); BMessage* message = new BMessage(MSG_ADD_SLOT);
message->AddPointer("be:source", (void*)nearestButton); message->AddPointer("be:source", (void*)nearestButton);
BMenuItem* item = new BMenuItem("Add button here", message); BMenuItem* item = new BMenuItem(B_TRANSLATE("Add button here"), message);
item->SetTarget(window); item->SetTarget(window);
menu->AddItem(item); menu->AddItem(item);
// button options // button options
@@ -327,20 +332,21 @@ PadView::DisplayMenu(BPoint where, LaunchButton* button) const
// clear button // clear button
message = new BMessage(MSG_CLEAR_SLOT); message = new BMessage(MSG_CLEAR_SLOT);
message->AddPointer("be:source", (void*)button); message->AddPointer("be:source", (void*)button);
item = new BMenuItem("Clear button", message); item = new BMenuItem(B_TRANSLATE("Clear button"), message);
item->SetTarget(window); item->SetTarget(window);
menu->AddItem(item); menu->AddItem(item);
// remove button // remove button
message = new BMessage(MSG_REMOVE_SLOT); message = new BMessage(MSG_REMOVE_SLOT);
message->AddPointer("be:source", (void*)button); message->AddPointer("be:source", (void*)button);
item = new BMenuItem("Remove button", message); item = new BMenuItem(B_TRANSLATE("Remove button"), message);
item->SetTarget(window); item->SetTarget(window);
menu->AddItem(item); menu->AddItem(item);
// set button description // set button description
if (button->Ref()) { if (button->Ref()) {
message = new BMessage(MSG_SET_DESCRIPTION); message = new BMessage(MSG_SET_DESCRIPTION);
message->AddPointer("be:source", (void*)button); message->AddPointer("be:source", (void*)button);
item = new BMenuItem("Set description"B_UTF8_ELLIPSIS, message); item = new BMenuItem(B_TRANSLATE("Set description"B_UTF8_ELLIPSIS),
message);
item->SetTarget(window); item->SetTarget(window);
menu->AddItem(item); menu->AddItem(item);
} }
@@ -352,14 +358,14 @@ PadView::DisplayMenu(BPoint where, LaunchButton* button) const
const char* toggleLayoutLabel; const char* toggleLayoutLabel;
if (fButtonLayout->Orientation() == B_HORIZONTAL) if (fButtonLayout->Orientation() == B_HORIZONTAL)
toggleLayoutLabel = "Vertical layout"; toggleLayoutLabel = B_TRANSLATE("Vertical layout");
else else
toggleLayoutLabel = "Horizontal layout"; toggleLayoutLabel = B_TRANSLATE("Horizontal layout");
item = new BMenuItem(toggleLayoutLabel, new BMessage(MSG_TOGGLE_LAYOUT)); item = new BMenuItem(toggleLayoutLabel, new BMessage(MSG_TOGGLE_LAYOUT));
item->SetTarget(this); item->SetTarget(this);
settingsM->AddItem(item); settingsM->AddItem(item);
BMenu* iconSizeM = new BMenu("Icon size"); BMenu* iconSizeM = new BMenu(B_TRANSLATE("Icon size"));
for (uint32 i = 0; i < sizeof(kIconSizes) / sizeof(uint32); i++) { for (uint32 i = 0; i < sizeof(kIconSizes) / sizeof(uint32); i++) {
uint32 iconSize = kIconSizes[i]; uint32 iconSize = kIconSizes[i];
message = new BMessage(MSG_SET_ICON_SIZE); message = new BMessage(MSG_SET_ICON_SIZE);
@@ -373,24 +379,24 @@ PadView::DisplayMenu(BPoint where, LaunchButton* button) const
} }
settingsM->AddItem(iconSizeM); settingsM->AddItem(iconSizeM);
item = new BMenuItem("Ignore double-click", item = new BMenuItem(B_TRANSLATE("Ignore double-click"),
new BMessage(MSG_SET_IGNORE_DOUBLECLICK)); new BMessage(MSG_SET_IGNORE_DOUBLECLICK));
item->SetTarget(this); item->SetTarget(this);
item->SetMarked(IgnoreDoubleClick()); item->SetMarked(IgnoreDoubleClick());
settingsM->AddItem(item); settingsM->AddItem(item);
uint32 what = window->Look() == B_BORDERED_WINDOW_LOOK ? MSG_SHOW_BORDER : MSG_HIDE_BORDER; uint32 what = window->Look() == B_BORDERED_WINDOW_LOOK ? MSG_SHOW_BORDER : MSG_HIDE_BORDER;
item = new BMenuItem("Show window border", new BMessage(what)); item = new BMenuItem(B_TRANSLATE("Show window border"), new BMessage(what));
item->SetTarget(window); item->SetTarget(window);
item->SetMarked(what == MSG_HIDE_BORDER); item->SetMarked(what == MSG_HIDE_BORDER);
settingsM->AddItem(item); settingsM->AddItem(item);
item = new BMenuItem("Auto-raise", new BMessage(MSG_TOGGLE_AUTORAISE)); item = new BMenuItem(B_TRANSLATE("Auto-raise"), new BMessage(MSG_TOGGLE_AUTORAISE));
item->SetTarget(window); item->SetTarget(window);
item->SetMarked(window->AutoRaise()); item->SetMarked(window->AutoRaise());
settingsM->AddItem(item); settingsM->AddItem(item);
item = new BMenuItem("Show on all workspaces", new BMessage(MSG_SHOW_ON_ALL_WORKSPACES)); item = new BMenuItem(B_TRANSLATE("Show on all workspaces"), new BMessage(MSG_SHOW_ON_ALL_WORKSPACES));
item->SetTarget(window); item->SetTarget(window);
item->SetMarked(window->ShowOnAllWorkspaces()); item->SetMarked(window->ShowOnAllWorkspaces());
settingsM->AddItem(item); settingsM->AddItem(item);
@@ -400,31 +406,31 @@ PadView::DisplayMenu(BPoint where, LaunchButton* button) const
menu->AddSeparatorItem(); menu->AddSeparatorItem();
// pad commands // pad commands
BMenu* padM = new BMenu("Pad"); BMenu* padM = new BMenu(B_TRANSLATE("Pad"));
padM->SetFont(be_plain_font); padM->SetFont(be_plain_font);
// new pad // new pad
item = new BMenuItem("New", new BMessage(MSG_ADD_WINDOW)); item = new BMenuItem(B_TRANSLATE("New"), new BMessage(MSG_ADD_WINDOW));
item->SetTarget(be_app); item->SetTarget(be_app);
padM->AddItem(item); padM->AddItem(item);
// new pad // new pad
item = new BMenuItem("Clone", new BMessage(MSG_ADD_WINDOW)); item = new BMenuItem(B_TRANSLATE("Clone"), new BMessage(MSG_ADD_WINDOW));
item->SetTarget(window); item->SetTarget(window);
padM->AddItem(item); padM->AddItem(item);
padM->AddSeparatorItem(); padM->AddSeparatorItem();
// close // close
item = new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED)); item = new BMenuItem(B_TRANSLATE("Close"), new BMessage(B_QUIT_REQUESTED));
item->SetTarget(window); item->SetTarget(window);
padM->AddItem(item); padM->AddItem(item);
menu->AddItem(padM); menu->AddItem(padM);
// app commands // app commands
BMenu* appM = new BMenu("LaunchBox"); BMenu* appM = new BMenu(B_TRANSLATE("LaunchBox"));
appM->SetFont(be_plain_font); appM->SetFont(be_plain_font);
// about // about
item = new BMenuItem("About", new BMessage(B_ABOUT_REQUESTED)); item = new BMenuItem(B_TRANSLATE("About"), new BMessage(B_ABOUT_REQUESTED));
item->SetTarget(be_app); item->SetTarget(be_app);
appM->AddItem(item); appM->AddItem(item);
// quit // quit
item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED)); item = new BMenuItem(B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED));
item->SetTarget(be_app); item->SetTarget(be_app);
appM->AddItem(item); appM->AddItem(item);
menu->AddItem(appM); menu->AddItem(appM);