[haiku-commits] r40909 - haiku/trunk/src/apps/processcontroller

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Mar 2011 23:25:29 +0100 (CET)

Author: siarzhuk
Date: 2011-03-10 23:25:29 +0100 (Thu, 10 Mar 2011)
New Revision: 40909
Changeset: http://dev.haiku-os.org/changeset/40909
Ticket: http://dev.haiku-os.org/ticket/7350

Modified:
   haiku/trunk/src/apps/processcontroller/Jamfile
   haiku/trunk/src/apps/processcontroller/MemoryBarMenu.cpp
   haiku/trunk/src/apps/processcontroller/MemoryBarMenuItem.cpp
   haiku/trunk/src/apps/processcontroller/PCWorld.cpp
   haiku/trunk/src/apps/processcontroller/Preferences.cpp
   haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp
   haiku/trunk/src/apps/processcontroller/ProcessController.cpp
   haiku/trunk/src/apps/processcontroller/QuitMenu.cpp
Log:
Partially applying localization patch prepared by Jorma Karvonen.
Fixes #7350. Thanks.



Modified: haiku/trunk/src/apps/processcontroller/Jamfile
===================================================================
--- haiku/trunk/src/apps/processcontroller/Jamfile      2011-03-10 22:20:23 UTC 
(rev 40908)
+++ haiku/trunk/src/apps/processcontroller/Jamfile      2011-03-10 22:25:29 UTC 
(rev 40909)
@@ -29,11 +29,14 @@
        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
+;

Modified: haiku/trunk/src/apps/processcontroller/MemoryBarMenu.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/MemoryBarMenu.cpp    2011-03-10 
22:20:23 UTC (rev 40908)
+++ haiku/trunk/src/apps/processcontroller/MemoryBarMenu.cpp    2011-03-10 
22:25:29 UTC (rev 40909)
@@ -24,7 +24,6 @@
 #include "ProcessController.h"
 
 #include <Bitmap.h>
-#include <Catalog.h>
 #include <Roster.h>
 #include <StringForSize.h>
 #include <Window.h>
@@ -36,10 +35,7 @@
 
 float gMemoryTextWidth;
 
-#undef B_TRANSLATE_CONTEXT
-#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
 
-
 MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& 
systemInfo)
        : BMenu(name),
        fFirstShow(true)

Modified: haiku/trunk/src/apps/processcontroller/MemoryBarMenuItem.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/MemoryBarMenuItem.cpp        
2011-03-10 22:20:23 UTC (rev 40908)
+++ haiku/trunk/src/apps/processcontroller/MemoryBarMenuItem.cpp        
2011-03-10 22:25:29 UTC (rev 40909)
@@ -25,15 +25,11 @@
 #include "ProcessController.h"
 
 #include <Bitmap.h>
-#include <Catalog.h>
 #include <StringForSize.h>
 
 #include <stdio.h>
 
-#undef B_TRANSLATE_CONTEXT
-#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
 
-
 MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team,
                BBitmap* icon, bool deleteIcon, BMessage* message)
        : BMenuItem(label, message),

Modified: haiku/trunk/src/apps/processcontroller/PCWorld.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/PCWorld.cpp  2011-03-10 22:20:23 UTC 
(rev 40908)
+++ haiku/trunk/src/apps/processcontroller/PCWorld.cpp  2011-03-10 22:25:29 UTC 
(rev 40909)
@@ -86,7 +86,7 @@
        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 @@
                        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);

Modified: haiku/trunk/src/apps/processcontroller/Preferences.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/Preferences.cpp      2011-03-10 
22:20:23 UTC (rev 40908)
+++ haiku/trunk/src/apps/processcontroller/Preferences.cpp      2011-03-10 
22:25:29 UTC (rev 40909)
@@ -116,6 +116,8 @@
                        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();
                }
        }

Modified: haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp     2011-03-10 
22:20:23 UTC (rev 40908)
+++ haiku/trunk/src/apps/processcontroller/PriorityMenu.cpp     2011-03-10 
22:25:29 UTC (rev 40909)
@@ -93,7 +93,7 @@
                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);

Modified: haiku/trunk/src/apps/processcontroller/ProcessController.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/ProcessController.cpp        
2011-03-10 22:20:23 UTC (rev 40908)
+++ haiku/trunk/src/apps/processcontroller/ProcessController.cpp        
2011-03-10 22:25:29 UTC (rev 40909)
@@ -268,17 +268,18 @@
                                        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 @@
                                        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 @@
                                        }
                                        #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 @@
                                        }
                                }
                                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 @@
        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();
 }

Modified: haiku/trunk/src/apps/processcontroller/QuitMenu.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/QuitMenu.cpp 2011-03-10 22:20:23 UTC 
(rev 40908)
+++ haiku/trunk/src/apps/processcontroller/QuitMenu.cpp 2011-03-10 22:25:29 UTC 
(rev 40909)
@@ -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 @@
 };
 
 
-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 @@
        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);


Other related posts:

  • » [haiku-commits] r40909 - haiku/trunk/src/apps/processcontroller - zharik