Localization. Cleanup.
CID 6338, 6339, 8912 - Replace strcpy with strlcpy. CID 9523 - Initialize class member. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41243 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,8 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
UsePrivateHeaders input interface shared tracker ;
|
UsePrivateHeaders input interface shared tracker ;
|
||||||
UsePrivateSystemHeaders ;
|
UsePrivateSystemHeaders ;
|
||||||
|
|
||||||
|
AddResources <input>keyboard : Keyboard.rdef ;
|
||||||
|
|
||||||
Addon <input>keyboard :
|
Addon <input>keyboard :
|
||||||
KeyboardInputDevice.cpp
|
KeyboardInputDevice.cpp
|
||||||
Keymap.cpp
|
Keymap.cpp
|
||||||
@@ -12,8 +14,15 @@ Addon <input>keyboard :
|
|||||||
TeamMonitorWindow.cpp
|
TeamMonitorWindow.cpp
|
||||||
TeamListItem.cpp
|
TeamListItem.cpp
|
||||||
|
|
||||||
: input_server be libshared.a $(TARGET_LIBSUPC++) ;
|
: input_server be libshared.a $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) ;
|
||||||
|
|
||||||
Package haiku-inputkit-cvs :
|
Package haiku-inputkit-cvs :
|
||||||
<input>keyboard :
|
<input>keyboard :
|
||||||
boot home config add-ons input_server devices ;
|
boot home config add-ons input_server devices ;
|
||||||
|
|
||||||
|
DoCatalogs <input>keyboard :
|
||||||
|
x-vnd.Haiku-KeyboardInputServerDevice
|
||||||
|
:
|
||||||
|
TeamMonitorWindow.cpp
|
||||||
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-KeyboardInputServerDevice" ;
|
||||||
@@ -137,7 +137,7 @@ KeyboardDevice::KeyboardDevice(KeyboardInputDevice* owner, const char* path)
|
|||||||
{
|
{
|
||||||
KD_CALLED();
|
KD_CALLED();
|
||||||
|
|
||||||
strcpy(fPath, path);
|
strlcpy(fPath, path, B_PATH_NAME_LENGTH);
|
||||||
fDeviceRef.name = get_short_name(path);
|
fDeviceRef.name = get_short_name(path);
|
||||||
fDeviceRef.type = B_KEYBOARD_DEVICE;
|
fDeviceRef.type = B_KEYBOARD_DEVICE;
|
||||||
fDeviceRef.cookie = this;
|
fDeviceRef.cookie = this;
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ TeamListItem::TeamListItem(team_info &tinfo)
|
|||||||
:
|
:
|
||||||
fInfo(tinfo),
|
fInfo(tinfo),
|
||||||
fIcon(BRect(0, 0, 15, 15), B_RGBA32),
|
fIcon(BRect(0, 0, 15, 15), B_RGBA32),
|
||||||
fLargeIcon(BRect(0, 0, 31, 31), B_RGBA32)
|
fLargeIcon(BRect(0, 0, 31, 31), B_RGBA32),
|
||||||
|
fFound(false)
|
||||||
{
|
{
|
||||||
int32 cookie = 0;
|
int32 cookie = 0;
|
||||||
image_info info;
|
image_info info;
|
||||||
@@ -156,8 +157,5 @@ TeamListItem::IsSystemServer()
|
|||||||
bool
|
bool
|
||||||
TeamListItem::IsApplication()
|
TeamListItem::IsApplication()
|
||||||
{
|
{
|
||||||
if (fAppSignature.Length() > 0)
|
return !fAppSignature.IsEmpty();
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <CardLayout.h>
|
#include <CardLayout.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupView.h>
|
#include <GroupView.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
@@ -32,6 +33,10 @@
|
|||||||
#include "TeamListItem.h"
|
#include "TeamListItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Team Monitor"
|
||||||
|
|
||||||
|
|
||||||
class TeamDescriptionView : public BBox {
|
class TeamDescriptionView : public BBox {
|
||||||
public:
|
public:
|
||||||
TeamDescriptionView();
|
TeamDescriptionView();
|
||||||
@@ -67,7 +72,8 @@ static const uint32 kMsgRebootTick = 'TMrt';
|
|||||||
|
|
||||||
|
|
||||||
TeamMonitorWindow::TeamMonitorWindow()
|
TeamMonitorWindow::TeamMonitorWindow()
|
||||||
: BWindow(BRect(0, 0, 350, 300), "Team Monitor",
|
:
|
||||||
|
BWindow(BRect(0, 0, 350, 300), B_TRANSLATE("Team Monitor"),
|
||||||
B_TITLED_WINDOW_LOOK, B_MODAL_ALL_WINDOW_FEEL,
|
B_TITLED_WINDOW_LOOK, B_MODAL_ALL_WINDOW_FEEL,
|
||||||
B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
|
B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
|
||||||
| B_CLOSE_ON_ESCAPE,
|
| B_CLOSE_ON_ESCAPE,
|
||||||
@@ -93,12 +99,12 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
BGroupView* groupView = new BGroupView(B_HORIZONTAL);
|
BGroupView* groupView = new BGroupView(B_HORIZONTAL);
|
||||||
layout->AddView(groupView);
|
layout->AddView(groupView);
|
||||||
|
|
||||||
fKillButton = new BButton("kill", "Kill Application",
|
fKillButton = new BButton("kill", B_TRANSLATE("Kill Application"),
|
||||||
new BMessage(TM_KILL_APPLICATION));
|
new BMessage(TM_KILL_APPLICATION));
|
||||||
groupView->AddChild(fKillButton);
|
groupView->AddChild(fKillButton);
|
||||||
fKillButton->SetEnabled(false);
|
fKillButton->SetEnabled(false);
|
||||||
|
|
||||||
fQuitButton = new BButton("quit", "Quit Application",
|
fQuitButton = new BButton("quit", B_TRANSLATE("Quit Application"),
|
||||||
new BMessage(TM_QUIT_APPLICATION));
|
new BMessage(TM_QUIT_APPLICATION));
|
||||||
groupView->AddChild(fQuitButton);
|
groupView->AddChild(fQuitButton);
|
||||||
fQuitButton->SetEnabled(false);
|
fQuitButton->SetEnabled(false);
|
||||||
@@ -111,7 +117,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
groupView = new BGroupView(B_HORIZONTAL);
|
groupView = new BGroupView(B_HORIZONTAL);
|
||||||
layout->AddView(groupView);
|
layout->AddView(groupView);
|
||||||
|
|
||||||
BButton* forceReboot = new BButton("force", "Force Reboot",
|
BButton* forceReboot = new BButton("force", B_TRANSLATE("Force Reboot"),
|
||||||
new BMessage(TM_FORCE_REBOOT));
|
new BMessage(TM_FORCE_REBOOT));
|
||||||
groupView->GroupLayout()->AddView(forceReboot);
|
groupView->GroupLayout()->AddView(forceReboot);
|
||||||
|
|
||||||
@@ -119,7 +125,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
glue->SetExplicitMinSize(BSize(inset, -1));
|
glue->SetExplicitMinSize(BSize(inset, -1));
|
||||||
groupView->GroupLayout()->AddItem(glue);
|
groupView->GroupLayout()->AddItem(glue);
|
||||||
|
|
||||||
fRestartButton = new BButton("restart", "Restart the Desktop",
|
fRestartButton = new BButton("restart", B_TRANSLATE("Restart the Desktop"),
|
||||||
new BMessage(TM_RESTART_DESKTOP));
|
new BMessage(TM_RESTART_DESKTOP));
|
||||||
SetDefaultButton(fRestartButton);
|
SetDefaultButton(fRestartButton);
|
||||||
groupView->GroupLayout()->AddView(fRestartButton);
|
groupView->GroupLayout()->AddView(fRestartButton);
|
||||||
@@ -128,7 +134,7 @@ TeamMonitorWindow::TeamMonitorWindow()
|
|||||||
glue->SetExplicitMinSize(BSize(inset, -1));
|
glue->SetExplicitMinSize(BSize(inset, -1));
|
||||||
groupView->GroupLayout()->AddItem(glue);
|
groupView->GroupLayout()->AddItem(glue);
|
||||||
|
|
||||||
fCancelButton = new BButton("cancel", "Cancel",
|
fCancelButton = new BButton("cancel", B_TRANSLATE("Cancel"),
|
||||||
new BMessage(TM_CANCEL));
|
new BMessage(TM_CANCEL));
|
||||||
SetDefaultButton(fCancelButton);
|
SetDefaultButton(fCancelButton);
|
||||||
groupView->GroupLayout()->AddView(fCancelButton);
|
groupView->GroupLayout()->AddView(fCancelButton);
|
||||||
@@ -269,7 +275,8 @@ TeamMonitorWindow::UpdateList()
|
|||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int32 i = 0; i < fListView->CountItems(); i++) {
|
for (int32 i = 0; i < fListView->CountItems(); i++) {
|
||||||
TeamListItem* item = dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
|
TeamListItem* item
|
||||||
|
= dynamic_cast<TeamListItem*>(fListView->ItemAt(i));
|
||||||
if (item != NULL && item->GetInfo()->team == info.team) {
|
if (item != NULL && item->GetInfo()->team == info.team) {
|
||||||
item->SetFound(true);
|
item->SetFound(true);
|
||||||
found = true;
|
found = true;
|
||||||
@@ -345,7 +352,8 @@ TeamMonitorWindow::Disable()
|
|||||||
|
|
||||||
|
|
||||||
TeamDescriptionView::TeamDescriptionView()
|
TeamDescriptionView::TeamDescriptionView()
|
||||||
: BBox("description view", B_WILL_DRAW | B_PULSE_NEEDED, B_NO_BORDER),
|
:
|
||||||
|
BBox("description view", B_WILL_DRAW | B_PULSE_NEEDED, B_NO_BORDER),
|
||||||
fItem(NULL),
|
fItem(NULL),
|
||||||
fSeconds(4),
|
fSeconds(4),
|
||||||
fRebootRunner(NULL)
|
fRebootRunner(NULL)
|
||||||
@@ -362,9 +370,12 @@ TeamDescriptionView::TeamDescriptionView()
|
|||||||
*/
|
*/
|
||||||
SetFont(be_plain_font);
|
SetFont(be_plain_font);
|
||||||
|
|
||||||
fText[0] = "Select an application from the list above and click the";
|
fText[0] = B_TRANSLATE(
|
||||||
fText[1] = "\"Kill Application\" button in order to close it.";
|
"Select an application from the list above and click the");
|
||||||
fText[2] = "Hold CONTROL+ALT+DELETE for %ld seconds to reboot.";
|
fText[1] = B_TRANSLATE(
|
||||||
|
"\"Kill Application\" button in order to close it.");
|
||||||
|
fText[2] = B_TRANSLATE(
|
||||||
|
"Hold CONTROL+ALT+DELETE for %ld seconds to reboot.");
|
||||||
|
|
||||||
float width, height;
|
float width, height;
|
||||||
GetPreferredSize(&width, &height);
|
GetPreferredSize(&width, &height);
|
||||||
@@ -448,7 +459,7 @@ TeamDescriptionView::Draw(BRect rect)
|
|||||||
if (fItem->IsSystemServer()) {
|
if (fItem->IsSystemServer()) {
|
||||||
line.y += height;
|
line.y += height;
|
||||||
//SetFont(be_bold_font);
|
//SetFont(be_bold_font);
|
||||||
DrawString("(This team is a system component)", line);
|
DrawString(B_TRANSLATE("(This team is a system component)"), line);
|
||||||
//SetFont(be_plain_font);
|
//SetFont(be_plain_font);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -463,7 +474,7 @@ TeamDescriptionView::Draw(BRect rect)
|
|||||||
if (fSeconds >= 0)
|
if (fSeconds >= 0)
|
||||||
snprintf(text, sizeof(text), fText[2], fSeconds);
|
snprintf(text, sizeof(text), fText[2], fSeconds);
|
||||||
else
|
else
|
||||||
strcpy(text, "Booom!");
|
strlcpy(text, B_TRANSLATE("Booom!"), sizeof(text));
|
||||||
|
|
||||||
line.y += height;
|
line.y += height;
|
||||||
DrawString(text, line);
|
DrawString(text, line);
|
||||||
|
|||||||
Reference in New Issue
Block a user