Updated to use B_TRANSLATE* macros. relates to #5408.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36686 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,12 +32,13 @@ KeyboardApplication::MessageReceived(BMessage* message)
|
|||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case ERROR_DETECTED:
|
case ERROR_DETECTED:
|
||||||
{
|
{
|
||||||
BAlert* errorAlert = new BAlert("Error", TR("Something has gone wrong!"),
|
BAlert* errorAlert = new BAlert("Error",
|
||||||
TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
|
B_TRANSLATE("Something has gone wrong!"),
|
||||||
B_WARNING_ALERT);
|
B_TRANSLATE("OK"), NULL, NULL,
|
||||||
|
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
|
||||||
errorAlert->Go();
|
errorAlert->Go();
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
@@ -49,7 +50,8 @@ KeyboardApplication::MessageReceived(BMessage* message)
|
|||||||
void
|
void
|
||||||
KeyboardApplication::AboutRequested()
|
KeyboardApplication::AboutRequested()
|
||||||
{
|
{
|
||||||
(new BAlert("about", TR("Written by Andrew Edward McCall"), TR("OK")))->Go();
|
(new BAlert("about", B_TRANSLATE("Written by Andrew Edward McCall"),
|
||||||
|
B_TRANSLATE("OK")))->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,37 +28,37 @@
|
|||||||
|
|
||||||
KeyboardView::KeyboardView()
|
KeyboardView::KeyboardView()
|
||||||
: BGroupView()
|
: BGroupView()
|
||||||
{
|
{
|
||||||
fIconBitmap = BTranslationUtils::GetBitmap("key_bmap");
|
fIconBitmap = BTranslationUtils::GetBitmap("key_bmap");
|
||||||
fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap");
|
fClockBitmap = BTranslationUtils::GetBitmap("clock_bmap");
|
||||||
|
|
||||||
// Create the "Key repeat rate" slider...
|
// Create the "Key repeat rate" slider...
|
||||||
fRepeatSlider = new BSlider("key_repeat_rate",
|
fRepeatSlider = new BSlider("key_repeat_rate",
|
||||||
TR("Key repeat rate"),
|
B_TRANSLATE("Key repeat rate"),
|
||||||
new BMessage(SLIDER_REPEAT_RATE),
|
new BMessage(SLIDER_REPEAT_RATE),
|
||||||
20, 300, B_HORIZONTAL);
|
20, 300, B_HORIZONTAL);
|
||||||
fRepeatSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
fRepeatSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
fRepeatSlider->SetHashMarkCount(5);
|
fRepeatSlider->SetHashMarkCount(5);
|
||||||
fRepeatSlider->SetLimitLabels(TR("Slow"),TR("Fast"));
|
fRepeatSlider->SetLimitLabels(B_TRANSLATE("Slow"),B_TRANSLATE("Fast"));
|
||||||
|
|
||||||
|
|
||||||
// Create the "Delay until key repeat" slider...
|
// Create the "Delay until key repeat" slider...
|
||||||
fDelaySlider = new BSlider("delay_until_key_repeat",
|
fDelaySlider = new BSlider("delay_until_key_repeat",
|
||||||
TR("Delay until key repeat"),
|
B_TRANSLATE("Delay until key repeat"),
|
||||||
new BMessage(SLIDER_DELAY_RATE),
|
new BMessage(SLIDER_DELAY_RATE),
|
||||||
250000, 1000000, B_HORIZONTAL);
|
250000, 1000000, B_HORIZONTAL);
|
||||||
fDelaySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
fDelaySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
fDelaySlider->SetHashMarkCount(4);
|
fDelaySlider->SetHashMarkCount(4);
|
||||||
fDelaySlider->SetLimitLabels(TR("Short"),TR("Long"));
|
fDelaySlider->SetLimitLabels(B_TRANSLATE("Short"),B_TRANSLATE("Long"));
|
||||||
|
|
||||||
// Create the "Typing test area" text box...
|
// Create the "Typing test area" text box...
|
||||||
BTextControl* textcontrol = new BTextControl(NULL,
|
BTextControl* textcontrol = new BTextControl(NULL,
|
||||||
TR("Typing test area"),
|
B_TRANSLATE("Typing test area"),
|
||||||
new BMessage('TTEA'));
|
new BMessage('TTEA'));
|
||||||
textcontrol->SetAlignment(B_ALIGN_LEFT, B_ALIGN_CENTER);
|
textcontrol->SetAlignment(B_ALIGN_LEFT, B_ALIGN_CENTER);
|
||||||
textcontrol->SetExplicitMinSize(BSize(
|
textcontrol->SetExplicitMinSize(BSize(
|
||||||
textcontrol->StringWidth(TR("Typing test area")), B_SIZE_UNSET));
|
textcontrol->StringWidth(B_TRANSLATE("Typing test area")), B_SIZE_UNSET));
|
||||||
|
|
||||||
// Build the layout
|
// Build the layout
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#define TR_CONTEXT "KeyboardWindow"
|
#define TR_CONTEXT "KeyboardWindow"
|
||||||
|
|
||||||
KeyboardWindow::KeyboardWindow()
|
KeyboardWindow::KeyboardWindow()
|
||||||
: BWindow(BRect(0, 0, 200, 200), TR("Keyboard"), B_TITLED_WINDOW,
|
: BWindow(BRect(0, 0, 200, 200), B_TRANSLATE("Keyboard"), B_TITLED_WINDOW,
|
||||||
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
|
||||||
| B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
@@ -38,17 +38,17 @@ KeyboardWindow::KeyboardWindow()
|
|||||||
fSettingsView = new KeyboardView();
|
fSettingsView = new KeyboardView();
|
||||||
BBox* fSettingsBox = new BBox("keyboard_box");
|
BBox* fSettingsBox = new BBox("keyboard_box");
|
||||||
fSettingsBox->AddChild(fSettingsView);
|
fSettingsBox->AddChild(fSettingsView);
|
||||||
|
|
||||||
// Add the "Default" button..
|
// Add the "Default" button..
|
||||||
fDefaultsButton = new BButton(TR("Defaults"), new BMessage(BUTTON_DEFAULTS));
|
fDefaultsButton = new BButton(B_TRANSLATE("Defaults"), new BMessage(BUTTON_DEFAULTS));
|
||||||
|
|
||||||
// Add the "Revert" button...
|
// Add the "Revert" button...
|
||||||
fRevertButton = new BButton(TR("Revert"), new BMessage(BUTTON_REVERT));
|
fRevertButton = new BButton(B_TRANSLATE("Revert"), new BMessage(BUTTON_REVERT));
|
||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
|
|
||||||
// Build the layout
|
// Build the layout
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
|
||||||
.Add(fSettingsBox)
|
.Add(fSettingsBox)
|
||||||
.AddGroup(B_HORIZONTAL, 7)
|
.AddGroup(B_HORIZONTAL, 7)
|
||||||
@@ -60,11 +60,11 @@ KeyboardWindow::KeyboardWindow()
|
|||||||
);
|
);
|
||||||
|
|
||||||
BSlider* slider = (BSlider* )FindView("key_repeat_rate");
|
BSlider* slider = (BSlider* )FindView("key_repeat_rate");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatRate());
|
slider->SetValue(fSettings.KeyboardRepeatRate());
|
||||||
|
|
||||||
slider = (BSlider* )FindView("delay_until_key_repeat");
|
slider = (BSlider* )FindView("delay_until_key_repeat");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
||||||
|
|
||||||
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
||||||
@@ -73,7 +73,7 @@ KeyboardWindow::KeyboardWindow()
|
|||||||
BScreen screen;
|
BScreen screen;
|
||||||
if (screen.Frame().right < Frame().right
|
if (screen.Frame().right < Frame().right
|
||||||
|| screen.Frame().bottom < Frame().bottom) {
|
|| screen.Frame().bottom < Frame().bottom) {
|
||||||
CenterOnScreen();
|
CenterOnScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -109,11 +109,11 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
fSettings.Defaults();
|
fSettings.Defaults();
|
||||||
|
|
||||||
slider = (BSlider* )FindView("key_repeat_rate");
|
slider = (BSlider* )FindView("key_repeat_rate");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatRate());
|
slider->SetValue(fSettings.KeyboardRepeatRate());
|
||||||
|
|
||||||
slider = (BSlider* )FindView("delay_until_key_repeat");
|
slider = (BSlider* )FindView("delay_until_key_repeat");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
||||||
|
|
||||||
fDefaultsButton->SetEnabled(false);
|
fDefaultsButton->SetEnabled(false);
|
||||||
@@ -124,13 +124,13 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
case BUTTON_REVERT:
|
case BUTTON_REVERT:
|
||||||
{
|
{
|
||||||
fSettings.Revert();
|
fSettings.Revert();
|
||||||
|
|
||||||
slider = (BSlider* )FindView("key_repeat_rate");
|
slider = (BSlider* )FindView("key_repeat_rate");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatRate());
|
slider->SetValue(fSettings.KeyboardRepeatRate());
|
||||||
|
|
||||||
slider = (BSlider* )FindView("delay_until_key_repeat");
|
slider = (BSlider* )FindView("delay_until_key_repeat");
|
||||||
if (slider !=NULL)
|
if (slider !=NULL)
|
||||||
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
slider->SetValue(fSettings.KeyboardRepeatDelay());
|
||||||
|
|
||||||
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
||||||
@@ -171,7 +171,7 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
fSettings.SetKeyboardRepeatDelay(delay);
|
fSettings.SetKeyboardRepeatDelay(delay);
|
||||||
|
|
||||||
slider = (BSlider* )FindView("delay_until_key_repeat");
|
slider = (BSlider* )FindView("delay_until_key_repeat");
|
||||||
if (slider != NULL)
|
if (slider != NULL)
|
||||||
slider->SetValue(delay);
|
slider->SetValue(delay);
|
||||||
|
|
||||||
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
|
||||||
|
|||||||
Reference in New Issue
Block a user