Localized some still missed strings pointed out by Diver. Thanks!
Use more safe snprintf calls instead of sprintf ones. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40746 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -28,6 +28,8 @@ DoCatalogs ProcessController :
|
|||||||
x-vnd.Haiku-ProcessController
|
x-vnd.Haiku-ProcessController
|
||||||
:
|
:
|
||||||
KernelMemoryBarMenuItem.cpp
|
KernelMemoryBarMenuItem.cpp
|
||||||
|
MemoryBarMenu.cpp
|
||||||
|
MemoryBarMenuItem.cpp
|
||||||
NoiseBarMenuItem.cpp
|
NoiseBarMenuItem.cpp
|
||||||
PCWorld.cpp
|
PCWorld.cpp
|
||||||
Preferences.cpp
|
Preferences.cpp
|
||||||
|
|||||||
@@ -152,11 +152,13 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
|
|||||||
menu->SetHighColor(kBlack);
|
menu->SetHighColor(kBlack);
|
||||||
|
|
||||||
char infos[128];
|
char infos[128];
|
||||||
sprintf(infos, B_TRANSLATE("%.1f MB"), fCachedMemory / 1024.f);
|
snprintf(infos, sizeof(infos),
|
||||||
|
B_TRANSLATE("%.1f MB"), fCachedMemory / 1024.f);
|
||||||
BPoint loc(cadre.left, cadre.bottom + 1);
|
BPoint loc(cadre.left, cadre.bottom + 1);
|
||||||
loc.x -= kMargin + gMemoryTextWidth / 2 + menu->StringWidth(infos);
|
loc.x -= kMargin + gMemoryTextWidth / 2 + menu->StringWidth(infos);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
sprintf(infos, B_TRANSLATE("%.1f MB"), fCommittedMemory / 1024.f);
|
snprintf(infos, sizeof(infos),
|
||||||
|
B_TRANSLATE("%.1f MB"), fCommittedMemory / 1024.f);
|
||||||
loc.x = cadre.left - kMargin - menu->StringWidth(infos);
|
loc.x = cadre.left - kMargin - menu->StringWidth(infos);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
fLastSum = sum;
|
fLastSum = sum;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "ProcessController.h"
|
#include "ProcessController.h"
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
@@ -34,6 +35,9 @@
|
|||||||
|
|
||||||
float gMemoryTextWidth;
|
float gMemoryTextWidth;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
|
||||||
|
|
||||||
|
|
||||||
MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo)
|
MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& systemInfo)
|
||||||
: BMenu(name),
|
: BMenu(name),
|
||||||
@@ -53,7 +57,7 @@ MemoryBarMenu::MemoryBarMenu(const char* name, info_pack* infos, system_info& sy
|
|||||||
fTeamList[k++] = -1;
|
fTeamList[k++] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gMemoryTextWidth = 2 * StringWidth("99999 KB") + 20;
|
gMemoryTextWidth = 2 * StringWidth(B_TRANSLATE("99999 KB")) + 20;
|
||||||
|
|
||||||
fRecycleCount = EXTRA;
|
fRecycleCount = EXTRA;
|
||||||
fRecycleList = (MRecycleItem*)malloc(sizeof(MRecycleItem) * fRecycleCount);
|
fRecycleList = (MRecycleItem*)malloc(sizeof(MRecycleItem) * fRecycleCount);
|
||||||
|
|||||||
@@ -25,9 +25,13 @@
|
|||||||
#include "ProcessController.h"
|
#include "ProcessController.h"
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "MemoryBarMenu"
|
||||||
|
|
||||||
|
|
||||||
MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team,
|
MemoryBarMenuItem::MemoryBarMenuItem(const char *label, team_id team,
|
||||||
BBitmap* icon, bool deleteIcon, BMessage* message)
|
BBitmap* icon, bool deleteIcon, BMessage* message)
|
||||||
@@ -210,13 +214,13 @@ MemoryBarMenuItem::DrawBar(bool force)
|
|||||||
menu->SetHighColor(kBlack);
|
menu->SetHighColor(kBlack);
|
||||||
|
|
||||||
char infos[128];
|
char infos[128];
|
||||||
sprintf(infos, "%d KB", fWriteMemory);
|
snprintf(infos, sizeof(infos), B_TRANSLATE("%d KB"), fWriteMemory);
|
||||||
|
|
||||||
BPoint loc(rect.left - kMargin - gMemoryTextWidth / 2 - menu->StringWidth(infos),
|
BPoint loc(rect.left - kMargin - gMemoryTextWidth / 2 - menu->StringWidth(infos),
|
||||||
rect.bottom + 1);
|
rect.bottom + 1);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
|
|
||||||
sprintf(infos, "%d KB", fAllMemory);
|
snprintf(infos, sizeof(infos), B_TRANSLATE("%d KB"), fAllMemory);
|
||||||
loc.x = rect.left - kMargin - menu->StringWidth(infos);
|
loc.x = rect.left - kMargin - menu->StringWidth(infos);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ static PriorityRec priorities[] = {
|
|||||||
{ "", -1 }
|
{ "", -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
PriorityRec customPriority = {"Custom", 0 };
|
PriorityRec customPriority = { B_TRANSLATE("Custom priority"), 0 };
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ ProcessController::MessageReceived(BMessage *message)
|
|||||||
info_pack infos;
|
info_pack infos;
|
||||||
if (get_team_info(team, &infos.team_info) == B_OK) {
|
if (get_team_info(team, &infos.team_info) == B_OK) {
|
||||||
get_team_name_and_icon(infos);
|
get_team_name_and_icon(infos);
|
||||||
sprintf(question,
|
snprintf(question, sizeof(question),
|
||||||
B_TRANSLATE("Do you really want to kill the team \"%s\"?"),
|
B_TRANSLATE("Do you really want to kill the team \"%s\"?"),
|
||||||
infos.team_name);
|
infos.team_name);
|
||||||
alert = new BAlert("", question,
|
alert = new BAlert("", question,
|
||||||
@@ -289,16 +289,18 @@ ProcessController::MessageReceived(BMessage *message)
|
|||||||
thread_info thinfo;
|
thread_info thinfo;
|
||||||
if (get_thread_info(thread, &thinfo) == B_OK) {
|
if (get_thread_info(thread, &thinfo) == B_OK) {
|
||||||
#if DEBUG_THREADS
|
#if DEBUG_THREADS
|
||||||
sprintf(question, B_TRANSLATE("What do you want to do "
|
snprintf(question, sizeof(question),
|
||||||
"with the thread \"%s\"?"), thinfo.name);
|
B_TRANSLATE("What do you want to do "
|
||||||
|
"with the thread \"%s\"?"), thinfo.name);
|
||||||
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
|
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
|
||||||
B_TRANSLATE("Debug this thread!"),
|
B_TRANSLATE("Debug this thread!"),
|
||||||
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
|
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
|
||||||
B_STOP_ALERT);
|
B_STOP_ALERT);
|
||||||
#define KILL 2
|
#define KILL 2
|
||||||
#else
|
#else
|
||||||
sprintf(question, B_TRANSLATE("Are you sure you want "
|
snprintf(question, sizeof(question),
|
||||||
"to kill the thread \"%s\"?"), thinfo.name);
|
B_TRANSLATE("Are you sure you want "
|
||||||
|
"to kill the thread \"%s\"?"), thinfo.name);
|
||||||
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
|
alert = new BAlert("", question, B_TRANSLATE("Cancel"),
|
||||||
B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL,
|
B_TRANSLATE("Kill this thread!"), NULL, B_WIDTH_AS_USUAL,
|
||||||
B_STOP_ALERT);
|
B_STOP_ALERT);
|
||||||
|
|||||||
Reference in New Issue
Block a user