Ticket #7350: processcontroller-fix.patch
File processcontroller-fix.patch, 13.8 KB (added by , 13 years ago) |
---|
-
src/apps/processcontroller/Preferences.cpp
34 34 #include <Mime.h> 35 35 #include <Path.h> 36 36 37 37 38 #undef B_TRANSLATE_CONTEXT 38 #define B_TRANSLATE_CONTEXT "Pr ocessController"39 #define B_TRANSLATE_CONTEXT "Preferences" 39 40 41 40 42 Preferences::Preferences(const char* name, const char* signature, bool doSave) 41 43 : BMessage('Pref'), BLocker("Preferences", true), 42 44 fSavePreferences(doSave) … … 116 118 BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"), 117 119 error.String(), B_TRANSLATE("Damned!"), NULL, NULL, 118 120 B_WIDTH_AS_USUAL, B_STOP_ALERT); 121 alert->SetShortcut(0, B_ESCAPE); 122 119 123 alert->Go(); 120 124 } 121 125 } -
src/apps/processcontroller/MemoryBarMenuItem.cpp
25 25 #include "ProcessController.h" 26 26 27 27 #include <Bitmap.h> 28 #include <Catalog.h>29 28 #include <StringForSize.h> 30 29 31 30 #include <stdio.h> 32 31 33 #undef B_TRANSLATE_CONTEXT34 #define B_TRANSLATE_CONTEXT "MemoryBarMenu"35 32 36 37 33 MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team, 38 34 BBitmap* icon, bool deleteIcon, BMessage* message) 39 35 : BMenuItem(label, message), -
src/apps/processcontroller/KernelMemoryBarMenuItem.cpp
29 29 #include <Catalog.h> 30 30 #include <StringForSize.h> 31 31 32 32 33 #undef B_TRANSLATE_CONTEXT 33 #define B_TRANSLATE_CONTEXT " ProcessController"34 #define B_TRANSLATE_CONTEXT "Kernel Memory Bar Menu Item" 34 35 35 36 36 37 KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo) -
src/apps/processcontroller/QuitMenu.cpp
29 29 30 30 class QuitMenuItem : public IconMenuItem { 31 31 public: 32 QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge = false); 32 QuitMenuItem(team_id team, BBitmap* icon, const char* title, 33 BMessage* m, bool purge = false); 33 34 team_id Team() { return fTeam; } 34 35 35 36 private: … … 37 38 }; 38 39 39 40 40 QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title, BMessage* m, bool purge) : 41 QuitMenuItem::QuitMenuItem(team_id team, BBitmap* icon, const char* title, 42 BMessage* m, bool purge) 43 : 41 44 IconMenuItem(icon, title, m, true, purge), fTeam(team) 42 45 { 43 46 } … … 112 115 message->AddInt32 ("team", tmid); 113 116 item = NULL; 114 117 if (t < fInfosCount) 115 item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name, message); 118 item = new QuitMenuItem(tmid, fInfos[t].team_icon, fInfos[t].team_name, 119 message); 116 120 else { 117 121 info_pack infos; 118 122 if (get_team_info(tmid, &infos.team_info) == B_OK 119 123 && get_team_name_and_icon(infos, true)) 120 item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, message, true); 124 item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, 125 message, true); 121 126 } 122 127 if (item) { 123 128 item->SetTarget(gPCView); -
src/apps/processcontroller/PCWorld.cpp
38 38 39 39 40 40 #undef B_TRANSLATE_CONTEXT 41 #define B_TRANSLATE_CONTEXT "P rocessController"41 #define B_TRANSLATE_CONTEXT "PCWorld" 42 42 43 43 44 44 class PCApplication : public BApplication { … … 55 55 const char* kTrackerSig = "application/x-vnd.Be-TRAK"; 56 56 const char* kDeskbarSig = "application/x-vnd.Be-TSKB"; 57 57 const char* kTerminalSig = "application/x-vnd.Haiku-Terminal"; 58 const char* kPreferencesFileName = "ProcessController Prefs";58 const char* kPreferencesFileName = B_TRANSLATE_MARK("ProcessController Prefs"); 59 59 60 const char* kPosPrefName = "Position";61 const char* kVersionName = "Version";60 const char* kPosPrefName = B_TRANSLATE_MARK("Position"); 61 const char* kVersionName = B_TRANSLATE_MARK("Version"); 62 62 const int kCurrentVersion = 311; 63 63 64 64 thread_id id = 0; … … 86 86 BDeskbar deskbar; 87 87 if (!deskbar.HasItem(kDeskbarItemName)) { 88 88 // We're not yet installed in the Deskbar, ask if we should 89 BAlert* alert = new BAlert( "",89 BAlert* alert = new BAlert(B_TRANSLATE("Info"), 90 90 B_TRANSLATE("You can run ProcessController in a window" 91 91 " or install it in the Deskbar."), B_TRANSLATE("Run in window"), 92 B_TRANSLATE("Install in Deskbar"), 93 NULL, B_WIDTH_AS_USUAL,B_WARNING_ALERT);92 B_TRANSLATE("Install in Deskbar"), NULL, B_WIDTH_AS_USUAL, 93 B_WARNING_ALERT); 94 94 alert->SetShortcut(0, B_ESCAPE); 95 95 96 96 if (alert->Go() != 0) { … … 101 101 return; 102 102 } 103 103 } else { 104 BAlert* alert = new BAlert( "",104 BAlert* alert = new BAlert(B_TRANSLATE("Info"), 105 105 B_TRANSLATE("ProcessController is already installed in Deskbar."), 106 B_TRANSLATE("OK"), NULL, 107 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 106 B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 108 107 alert->SetShortcut(0, B_ESCAPE); 108 109 109 alert->Go(); 110 110 } 111 111 -
src/apps/processcontroller/PriorityMenu.h
3 3 PriorityMenu.h 4 4 5 5 ProcessController 6 ©2000, Georges-Edouard Berenger, All Rights Reserved.6 (c) 2000, Georges-Edouard Berenger, All Rights Reserved. 7 7 Copyright (C) 2004 beunited.org 8 8 9 9 This library is free software; you can redistribute it and/or -
src/apps/processcontroller/NoiseBarMenuItem.h
3 3 NoiseBarMenuItem.h 4 4 5 5 ProcessController 6 ©2000, Georges-Edouard Berenger, All Rights Reserved.6 (C) 2000, Georges-Edouard Berenger, All Rights Reserved. 7 7 Copyright (C) 2004 beunited.org 8 8 9 9 This library is free software; you can redistribute it and/or -
src/apps/processcontroller/Jamfile
29 29 x-vnd.Haiku-ProcessController 30 30 : 31 31 KernelMemoryBarMenuItem.cpp 32 MemoryBarMenu.cpp33 MemoryBarMenuItem.cpp34 32 NoiseBarMenuItem.cpp 35 33 PCWorld.cpp 36 34 Preferences.cpp 37 35 PriorityMenu.cpp 38 36 ProcessController.cpp 39 37 ; 38 39 AddCatalogEntryAttribute ProcessController 40 : 41 x-vnd.Haiku-ProcessController:PCWindow:ProcessController 42 ; -
src/apps/processcontroller/PriorityMenu.cpp
27 27 28 28 #include <stdio.h> 29 29 30 30 31 #undef B_TRANSLATE_CONTEXT 31 #define B_TRANSLATE_CONTEXT "Pr ocessController"32 #define B_TRANSLATE_CONTEXT "Priority Menu" 32 33 34 33 35 PriorityMenu::PriorityMenu(thread_id thread, int32 priority) 34 36 : BMenu(B_EMPTY_STRING), 35 37 fThreadID(thread), … … 93 95 BString name; 94 96 const size_t size = B_OS_NAME_LENGTH * 4; 95 97 snprintf(name.LockBuffer(size), size, 96 B_TRANSLATE("%s [%d]"), priority->name, (int)priority->priority);98 "%s [%d]", priority->name, (int)priority->priority); 97 99 name.UnlockBuffer(); 98 100 item = new BMenuItem(name.String(), message); 99 101 item->SetTarget(gPCView); -
src/apps/processcontroller/NoiseBarMenuItem.cpp
23 23 #include "Colors.h" 24 24 #include "ProcessController.h" 25 25 26 26 27 #undef B_TRANSLATE_CONTEXT 27 #define B_TRANSLATE_CONTEXT " ProcessController"28 #define B_TRANSLATE_CONTEXT "Noise Bar Menu Item" 28 29 30 29 31 NoiseBarMenuItem::NoiseBarMenuItem() 30 32 : BMenuItem(B_TRANSLATE("Gone teams"B_UTF8_ELLIPSIS), NULL) 31 33 { -
src/apps/processcontroller/ProcessController.cpp
61 61 #define B_TRANSLATE_CONTEXT "ProcessController" 62 62 63 63 64 const char* kDeskbarItemName = "ProcessController";65 const char* kClassName = "ProcessController";64 const char* kDeskbarItemName = B_TRANSLATE_MARK("ProcessController"); 65 const char* kClassName = B_TRANSLATE_MARK("ProcessController"); 66 66 67 67 const char* kFrameColorPref = "deskbar_frame_color"; 68 68 const char* kIdleColorPref = "deskbar_idle_color"; … … 268 268 snprintf(question, sizeof(question), 269 269 B_TRANSLATE("Do you really want to kill the team \"%s\"?"), 270 270 infos.team_name); 271 alert = new BAlert("", question, 272 B_TRANSLATE("Cancel"), B_TRANSLATE("Yes, kill this team!"), 273 NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 271 alert = new BAlert(B_TRANSLATE("Question"), question, 272 B_TRANSLATE("Cancel"), 273 B_TRANSLATE("Yes, kill this team!"), NULL, 274 B_WIDTH_AS_USUAL, B_STOP_ALERT); 274 275 alert->SetShortcut(0, B_ESCAPE); 276 275 277 if (alert->Go()) 276 278 kill_team(team); 277 279 } else { 278 alert = new BAlert("", B_TRANSLATE("This team is already " 279 "gone"B_UTF8_ELLIPSIS), 280 B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL, 281 B_STOP_ALERT); 280 alert = new BAlert(B_TRANSLATE("Question"), 281 B_TRANSLATE("This team is already gone" 282 B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"), NULL, NULL, 283 B_WIDTH_AS_USUAL, B_STOP_ALERT); 284 alert->SetShortcut(0, B_ESCAPE); 285 282 286 alert->Go(); 283 287 } 284 288 } … … 292 296 snprintf(question, sizeof(question), 293 297 B_TRANSLATE("What do you want to do " 294 298 "with the thread \"%s\"?"), thinfo.name); 295 alert = new BAlert("", question, B_TRANSLATE("Cancel"), 296 B_TRANSLATE("Debug this thread!"), 297 B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, 298 B_STOP_ALERT); 299 alert = new BAlert(B_TRANSLATE("Question"), question, 300 B_TRANSLATE("Cancel"), 301 B_TRANSLATE("Debug this thread!"), 302 B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, 303 B_STOP_ALERT); 299 304 #define KILL 2 300 305 #else 301 306 snprintf(question, sizeof(question), 302 307 B_TRANSLATE("Are you sure you want " 303 308 "to kill the thread \"%s\"?"), thinfo.name); 304 alert = new BAlert("", question, B_TRANSLATE("Cancel"), 305 B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL, 306 B_STOP_ALERT); 309 alert = new BAlert(B_TRANSLATE("Question"), question, 310 B_TRANSLATE("Cancel"), 311 B_TRANSLATE("Kill this thread!"), NULL, 312 B_WIDTH_AS_USUAL, B_STOP_ALERT); 307 313 #define KILL 1 308 314 #endif 309 315 alert->SetShortcut(0, B_ESCAPE); 316 310 317 int r = alert->Go(); 311 318 if (r == KILL) 312 319 kill_thread(thread); … … 324 331 } 325 332 #endif 326 333 } else { 327 alert = new BAlert("", B_TRANSLATE("This thread is " 328 "already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"), 329 NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 334 alert = new BAlert(B_TRANSLATE("Thread is gone"), 335 B_TRANSLATE("This thread is already gone" 336 B_UTF8_ELLIPSIS), B_TRANSLATE("Ok!"), NULL, NULL, 337 B_WIDTH_AS_USUAL, B_STOP_ALERT); 338 alert->SetShortcut(0, B_ESCAPE); 339 330 340 alert->Go(); 331 341 } 332 342 } … … 376 386 } 377 387 } 378 388 if (last) { 379 alert = new BAlert("", B_TRANSLATE("This is the last " 380 "active processor...\nYou can't turn it off!"), 389 alert = new BAlert(B_TRANSLATE("CPU"), 390 B_TRANSLATE("This is the last active processor...\n" 391 "You can't turn it off!"), 381 392 B_TRANSLATE("That's no Fun!"), NULL, NULL, 382 393 B_WIDTH_AS_USUAL, B_WARNING_ALERT); 394 alert->SetShortcut(0, B_ESCAPE); 395 383 396 alert->Go(); 384 397 } else 385 398 _kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu)); … … 415 428 font.SetSize(font.Size() * 1.5); 416 429 font.SetFace(B_BOLD_FACE); 417 430 view->SetFontAndColor(0, strlen(B_TRANSLATE("ProcessController")), &font); 431 alert->SetShortcut(0, B_ESCAPE); 418 432 419 433 alert->Go(); 420 434 } -
src/apps/processcontroller/MemoryBarMenu.cpp
24 24 #include "ProcessController.h" 25 25 26 26 #include <Bitmap.h> 27 #include <Catalog.h>28 27 #include <Roster.h> 29 28 #include <StringForSize.h> 30 29 #include <Window.h> … … 36 35 37 36 float gMemoryTextWidth; 38 37 39 #undef B_TRANSLATE_CONTEXT40 #define B_TRANSLATE_CONTEXT "MemoryBarMenu"41 38 42 43 39 MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo) 44 40 : BMenu(name), 45 41 fFirstShow(true) -
src/apps/processcontroller/PCWindow.cpp
32 32 #include <StringView.h> 33 33 34 34 35 extern const char* kClassName; 36 37 35 38 PCWindow::PCWindow() 36 : BWindow(BRect(100, 150, 131, 181), "ProcessController", B_TITLED_WINDOW, 37 B_NOT_H_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS) 39 : BWindow(BRect(100, 150, 131, 181), kClassName, 40 B_TITLED_WINDOW, B_NOT_H_RESIZABLE | B_NOT_ZOOMABLE | 41 B_ASYNCHRONOUS_CONTROLS) 38 42 { 39 43 Preferences preferences(kPreferencesFileName); 40 44 preferences.SaveInt32(kCurrentVersion, kVersionName);