From 80cdaa81fd09f358cdba09264f6ae2564016f87f Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Thu, 10 Mar 2011 22:25:29 +0000 Subject: [PATCH] Partially applying localization patch prepared by Jorma Karvonen. Fixes #7350. Thanks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40909 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/processcontroller/Jamfile | 7 +++- src/apps/processcontroller/MemoryBarMenu.cpp | 4 -- .../processcontroller/MemoryBarMenuItem.cpp | 4 -- src/apps/processcontroller/PCWorld.cpp | 4 +- src/apps/processcontroller/Preferences.cpp | 2 + src/apps/processcontroller/PriorityMenu.cpp | 2 +- .../processcontroller/ProcessController.cpp | 38 +++++++++++-------- src/apps/processcontroller/QuitMenu.cpp | 13 +++++-- 8 files changed, 41 insertions(+), 33 deletions(-) diff --git a/src/apps/processcontroller/Jamfile b/src/apps/processcontroller/Jamfile index ae2645969e..b7a1948226 100644 --- a/src/apps/processcontroller/Jamfile +++ b/src/apps/processcontroller/Jamfile @@ -29,11 +29,14 @@ DoCatalogs ProcessController : x-vnd.Haiku-ProcessController : KernelMemoryBarMenuItem.cpp - MemoryBarMenu.cpp - MemoryBarMenuItem.cpp NoiseBarMenuItem.cpp PCWorld.cpp Preferences.cpp PriorityMenu.cpp ProcessController.cpp ; + +AddCatalogEntryAttribute ProcessController + : + x-vnd.Haiku-ProcessController:PCWindow:ProcessController +; diff --git a/src/apps/processcontroller/MemoryBarMenu.cpp b/src/apps/processcontroller/MemoryBarMenu.cpp index 7243c890f0..3c2df35e6b 100644 --- a/src/apps/processcontroller/MemoryBarMenu.cpp +++ b/src/apps/processcontroller/MemoryBarMenu.cpp @@ -24,7 +24,6 @@ #include "ProcessController.h" #include -#include #include #include #include @@ -36,9 +35,6 @@ float gMemoryTextWidth; -#undef B_TRANSLATE_CONTEXT -#define B_TRANSLATE_CONTEXT "MemoryBarMenu" - MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo) : BMenu(name), diff --git a/src/apps/processcontroller/MemoryBarMenuItem.cpp b/src/apps/processcontroller/MemoryBarMenuItem.cpp index 527f23fd3e..7c0af03b0e 100644 --- a/src/apps/processcontroller/MemoryBarMenuItem.cpp +++ b/src/apps/processcontroller/MemoryBarMenuItem.cpp @@ -25,14 +25,10 @@ #include "ProcessController.h" #include -#include #include #include -#undef B_TRANSLATE_CONTEXT -#define B_TRANSLATE_CONTEXT "MemoryBarMenu" - MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team, BBitmap* icon, bool deleteIcon, BMessage* message) diff --git a/src/apps/processcontroller/PCWorld.cpp b/src/apps/processcontroller/PCWorld.cpp index 064b0c8238..71ecee1874 100644 --- a/src/apps/processcontroller/PCWorld.cpp +++ b/src/apps/processcontroller/PCWorld.cpp @@ -86,7 +86,7 @@ PCApplication::ReadyToRun() BDeskbar deskbar; if (!deskbar.HasItem(kDeskbarItemName)) { // We're not yet installed in the Deskbar, ask if we should - BAlert* alert = new BAlert("", + BAlert* alert = new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can run ProcessController in a window" " or install it in the Deskbar."), B_TRANSLATE("Run in window"), B_TRANSLATE("Install in Deskbar"), @@ -101,7 +101,7 @@ PCApplication::ReadyToRun() return; } } else { - BAlert* alert = new BAlert("", + BAlert* alert = new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("ProcessController is already installed in Deskbar."), B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); diff --git a/src/apps/processcontroller/Preferences.cpp b/src/apps/processcontroller/Preferences.cpp index 90cc7e8c92..e7ca2c4693 100644 --- a/src/apps/processcontroller/Preferences.cpp +++ b/src/apps/processcontroller/Preferences.cpp @@ -116,6 +116,8 @@ Preferences::~Preferences() BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"), error.String(), B_TRANSLATE("Damned!"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert->SetShortcut(0, B_ESCAPE); + alert->Go(); } } diff --git a/src/apps/processcontroller/PriorityMenu.cpp b/src/apps/processcontroller/PriorityMenu.cpp index 6dde03c9d2..26172295bd 100644 --- a/src/apps/processcontroller/PriorityMenu.cpp +++ b/src/apps/processcontroller/PriorityMenu.cpp @@ -93,7 +93,7 @@ PriorityMenu::BuildMenu() BString name; const size_t size = B_OS_NAME_LENGTH * 4; snprintf(name.LockBuffer(size), size, - B_TRANSLATE("%s [%d]"), priority->name, (int)priority->priority); + "%s [%d]", priority->name, (int)priority->priority); name.UnlockBuffer(); item = new BMenuItem(name.String(), message); item->SetTarget(gPCView); diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp index 0439939262..ebb04f5c4d 100644 --- a/src/apps/processcontroller/ProcessController.cpp +++ b/src/apps/processcontroller/ProcessController.cpp @@ -268,17 +268,18 @@ ProcessController::MessageReceived(BMessage *message) snprintf(question, sizeof(question), B_TRANSLATE("Do you really want to kill the team \"%s\"?"), infos.team_name); - alert = new BAlert("", question, + alert = new BAlert(B_TRANSLATE("Please confirm"), question, B_TRANSLATE("Cancel"), B_TRANSLATE("Yes, kill this team!"), NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); alert->SetShortcut(0, B_ESCAPE); if (alert->Go()) kill_team(team); } else { - alert = new BAlert("", B_TRANSLATE("This team is already " - "gone"B_UTF8_ELLIPSIS), - B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL, + alert = new BAlert(B_TRANSLATE("Info"), + B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS), + B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert->SetShortcut(0, B_ESCAPE); alert->Go(); } } @@ -292,18 +293,18 @@ ProcessController::MessageReceived(BMessage *message) snprintf(question, sizeof(question), B_TRANSLATE("What do you want to do " "with the thread \"%s\"?"), thinfo.name); - alert = new BAlert("", question, B_TRANSLATE("Cancel"), - B_TRANSLATE("Debug this thread!"), - B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, - B_STOP_ALERT); + alert = new BAlert(B_TRANSLATE("Please confirm"), question, + B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"), + B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, + B_STOP_ALERT); #define KILL 2 #else snprintf(question, sizeof(question), B_TRANSLATE("Are you sure you want " "to kill the thread \"%s\"?"), thinfo.name); - alert = new BAlert("", question, B_TRANSLATE("Cancel"), - B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL, - B_STOP_ALERT); + alert = new BAlert(B_TRANSLATE("Please confirm"), question, + B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"), + NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); #define KILL 1 #endif alert->SetShortcut(0, B_ESCAPE); @@ -324,9 +325,11 @@ ProcessController::MessageReceived(BMessage *message) } #endif } else { - alert = new BAlert("", B_TRANSLATE("This thread is " - "already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"), - NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert = new BAlert(B_TRANSLATE("Info"), + B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS), + B_TRANSLATE("Ok!"), NULL, NULL, + B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert->SetShortcut(0, B_ESCAPE); alert->Go(); } } @@ -376,10 +379,12 @@ ProcessController::MessageReceived(BMessage *message) } } if (last) { - alert = new BAlert("", B_TRANSLATE("This is the last " - "active processor...\nYou can't turn it off!"), + alert = new BAlert(B_TRANSLATE("Info"), + B_TRANSLATE("This is the last active processor...\n" + "You can't turn it off!"), B_TRANSLATE("That's no Fun!"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); + alert->SetShortcut(0, B_ESCAPE); alert->Go(); } else _kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu)); @@ -415,6 +420,7 @@ ProcessController::AboutRequested() font.SetSize(font.Size() * 1.5); font.SetFace(B_BOLD_FACE); view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController")), &font); + alert->SetShortcut(0, B_ESCAPE); alert->Go(); } diff --git a/src/apps/processcontroller/QuitMenu.cpp b/src/apps/processcontroller/QuitMenu.cpp index 42542f34d2..a5f466f41f 100644 --- a/src/apps/processcontroller/QuitMenu.cpp +++ b/src/apps/processcontroller/QuitMenu.cpp @@ -29,7 +29,8 @@ class QuitMenuItem : public IconMenuItem { public: - QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge = false); + QuitMenuItem(team_id team, BBitmap* icon, const char* title, + BMessage* m, bool purge = false); team_id Team() { return fTeam; } private: @@ -37,7 +38,9 @@ class QuitMenuItem : public IconMenuItem { }; -QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge) : +QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title, + BMessage* m, bool purge) + : IconMenuItem(icon, title, m, true, purge), fTeam(team) { } @@ -112,12 +115,14 @@ QuitMenu::AddTeam(team_id tmid) message->AddInt32 ("team", tmid); item = NULL; if (t < fInfosCount) - item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name, message); + item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name, + message); else { info_pack infos; if (get_team_info(tmid, &infos.team_info) == B_OK && get_team_name_and_icon(infos, true)) - item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, message, true); + item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, + message, true); } if (item) { item->SetTarget(gPCView);