[haiku-commits] r39877 - haiku/trunk/src/apps/activitymonitor

  • From: philippe.houdoin@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 17 Dec 2010 12:20:49 +0100 (CET)

Author: phoudoin
Date: 2010-12-17 12:20:49 +0100 (Fri, 17 Dec 2010)
New Revision: 39877
Changeset: http://dev.haiku-os.org/changeset/39877

Modified:
   haiku/trunk/src/apps/activitymonitor/ActivityMonitor.cpp
   haiku/trunk/src/apps/activitymonitor/ActivityMonitor.h
   haiku/trunk/src/apps/activitymonitor/ActivityWindow.cpp
Log:
Made app name localizable, as it seems that it should be possible after all.


Modified: haiku/trunk/src/apps/activitymonitor/ActivityMonitor.cpp
===================================================================
--- haiku/trunk/src/apps/activitymonitor/ActivityMonitor.cpp    2010-12-17 
09:10:12 UTC (rev 39876)
+++ haiku/trunk/src/apps/activitymonitor/ActivityMonitor.cpp    2010-12-17 
11:20:49 UTC (rev 39877)
@@ -64,10 +64,13 @@
 /*static*/ void
 ActivityMonitor::ShowAbout()
 {
-       BAlert *alert = new BAlert(B_TRANSLATE("about"),
-               B_TRANSLATE("ActivityMonitor\n"
-               "\twritten by Axel Dörfler\n"
-               "\tCopyright 2008, Haiku Inc.\n"), B_TRANSLATE("OK"));
+       BString text;
+       text << kAppName << "\n"
+               << B_TRANSLATE("\twritten by Axel Dörfler\n"
+               "\tCopyright 2008, Haiku Inc.\n");
+
+       BAlert *alert = new BAlert(B_TRANSLATE("About"),
+               text.String(), B_TRANSLATE("OK"));
        BTextView *view = alert->TextView();
        BFont font;
 
@@ -76,7 +79,7 @@
        view->GetFont(&font);
        font.SetSize(18);
        font.SetFace(B_BOLD_FACE);
-       view->SetFontAndColor(0, 15, &font);
+       view->SetFontAndColor(0, strlen(kAppName), &font);
 
        alert->Go();
 }

Modified: haiku/trunk/src/apps/activitymonitor/ActivityMonitor.h
===================================================================
--- haiku/trunk/src/apps/activitymonitor/ActivityMonitor.h      2010-12-17 
09:10:12 UTC (rev 39876)
+++ haiku/trunk/src/apps/activitymonitor/ActivityMonitor.h      2010-12-17 
11:20:49 UTC (rev 39877)
@@ -7,11 +7,17 @@
 
 
 #include <Application.h>
+#include <Catalog.h>
 
 class BMessage;
 class ActivityWindow;
 
+#undef B_TRANSLATE_CONTEXT
+#define B_TRANSLATE_CONTEXT "ActivityWindow"
 
+static const char* kAppName = B_TRANSLATE_MARK("ActivityMonitor");
+
+
 class ActivityMonitor : public BApplication {
 public:
                                        ActivityMonitor();

Modified: haiku/trunk/src/apps/activitymonitor/ActivityWindow.cpp
===================================================================
--- haiku/trunk/src/apps/activitymonitor/ActivityWindow.cpp     2010-12-17 
09:10:12 UTC (rev 39876)
+++ haiku/trunk/src/apps/activitymonitor/ActivityWindow.cpp     2010-12-17 
11:20:49 UTC (rev 39877)
@@ -34,7 +34,7 @@
 
 
 ActivityWindow::ActivityWindow()
-       : BWindow(BRect(100, 100, 500, 350), "ActivityMonitor", B_TITLED_WINDOW,
+       : BWindow(BRect(100, 100, 500, 350), kAppName, B_TITLED_WINDOW,
                B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE)
 {
        BMessage settings;


Other related posts:

  • » [haiku-commits] r39877 - haiku/trunk/src/apps/activitymonitor - philippe . houdoin