Patch by Mike Roll as part of GCI: localize Screen.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40027 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
@@ -25,6 +26,10 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
AlertView::AlertView(BRect frame, const char *name)
|
AlertView::AlertView(BRect frame, const char *name)
|
||||||
: BView(frame, name, B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED),
|
: BView(frame, name, B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED),
|
||||||
// we will wait 12 seconds until we send a message
|
// we will wait 12 seconds until we send a message
|
||||||
@@ -35,7 +40,7 @@ AlertView::AlertView(BRect frame, const char *name)
|
|||||||
|
|
||||||
BRect rect(60, 8, 400, 36);
|
BRect rect(60, 8, 400, 36);
|
||||||
BStringView *stringView = new BStringView(rect, NULL,
|
BStringView *stringView = new BStringView(rect, NULL,
|
||||||
"Do you wish to keep these settings?");
|
B_TRANSLATE("Do you wish to keep these settings?"));
|
||||||
stringView->SetFont(be_bold_font);
|
stringView->SetFont(be_bold_font);
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
@@ -47,12 +52,12 @@ AlertView::AlertView(BRect frame, const char *name)
|
|||||||
fCountdownView->ResizeToPreferred();
|
fCountdownView->ResizeToPreferred();
|
||||||
AddChild(fCountdownView);
|
AddChild(fCountdownView);
|
||||||
|
|
||||||
BButton* keepButton = new BButton(rect, "keep", "Keep",
|
BButton* keepButton = new BButton(rect, "keep", B_TRANSLATE("Keep"),
|
||||||
new BMessage(BUTTON_KEEP_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(BUTTON_KEEP_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
keepButton->ResizeToPreferred();
|
keepButton->ResizeToPreferred();
|
||||||
AddChild(keepButton);
|
AddChild(keepButton);
|
||||||
|
|
||||||
BButton* button = new BButton(rect, "undo", "Undo",
|
BButton* button = new BButton(rect, "undo", B_TRANSLATE("Undo"),
|
||||||
new BMessage(BUTTON_UNDO_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(BUTTON_UNDO_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
button->ResizeToPreferred();
|
button->ResizeToPreferred();
|
||||||
AddChild(button);
|
AddChild(button);
|
||||||
@@ -129,7 +134,8 @@ void
|
|||||||
AlertView::UpdateCountdownView()
|
AlertView::UpdateCountdownView()
|
||||||
{
|
{
|
||||||
BString string;
|
BString string;
|
||||||
string << "Settings will revert in " << fSeconds << " seconds.";
|
string << B_TRANSLATE("Settings will revert in %fSeconds seconds.");
|
||||||
|
string.ReplaceAll(%fSeconds, fSeconds);
|
||||||
fCountdownView->SetText(string.String());
|
fCountdownView->SetText(string.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,17 @@
|
|||||||
#include "AlertView.h"
|
#include "AlertView.h"
|
||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
AlertWindow::AlertWindow(BMessenger target)
|
AlertWindow::AlertWindow(BMessenger target)
|
||||||
: BWindow(BRect(100.0, 100.0, 400.0, 193.0), "Undo",
|
: BWindow(BRect(100.0, 100.0, 400.0, 193.0), B_TRANSLATE("Undo"),
|
||||||
B_MODAL_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
|
B_MODAL_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
|
||||||
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES),
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES),
|
||||||
fTarget(target)
|
fTarget(target)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Preference Screen :
|
|||||||
ScreenSettings.cpp
|
ScreenSettings.cpp
|
||||||
ScreenWindow.cpp
|
ScreenWindow.cpp
|
||||||
Utility.cpp
|
Utility.cpp
|
||||||
: be $(TARGET_LIBSUPC++)
|
: be $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: Screen.rdef
|
: Screen.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -28,3 +28,14 @@ if $(TARGET_PLATFORM) = libbe_test {
|
|||||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Screen
|
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Screen
|
||||||
: tests!apps ;
|
: tests!apps ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DoCatalogs Screen :
|
||||||
|
x-vnd.Haiku-Screen
|
||||||
|
:
|
||||||
|
AlertView.cpp
|
||||||
|
AlertWindow.cpp
|
||||||
|
RefreshSlider.cpp
|
||||||
|
RefreshWindow.cpp
|
||||||
|
ScreenApplication.cpp
|
||||||
|
ScreenWindow.cpp
|
||||||
|
;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "RefreshSlider.h"
|
#include "RefreshSlider.h"
|
||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
@@ -19,8 +20,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
RefreshSlider::RefreshSlider(BRect frame, float min, float max, uint32 resizingMode)
|
RefreshSlider::RefreshSlider(BRect frame, float min, float max, uint32 resizingMode)
|
||||||
: BSlider(frame, "Screen", "Refresh Rate:",
|
: BSlider(frame, B_TRANSLATE("Screen"), B_TRANSLATE("Refresh Rate:"),
|
||||||
new BMessage(SLIDER_INVOKE_MSG), (int32)rintf(min * 10), (int32)rintf(max * 10),
|
new BMessage(SLIDER_INVOKE_MSG), (int32)rintf(min * 10), (int32)rintf(max * 10),
|
||||||
B_BLOCK_THUMB, resizingMode),
|
B_BLOCK_THUMB, resizingMode),
|
||||||
fStatus(new (std::nothrow) char[32])
|
fStatus(new (std::nothrow) char[32])
|
||||||
@@ -91,7 +96,7 @@ const char*
|
|||||||
RefreshSlider::UpdateText() const
|
RefreshSlider::UpdateText() const
|
||||||
{
|
{
|
||||||
if (fStatus != NULL)
|
if (fStatus != NULL)
|
||||||
snprintf(fStatus, 32, "%.1f Hz", (float)Value() / 10);
|
snprintf(fStatus, 32, B_TRANSLATE("%.1f Hz"), (float)Value() / 10);
|
||||||
|
|
||||||
return fStatus;
|
return fStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,18 @@
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
RefreshWindow::RefreshWindow(BPoint position, float current, float min, float max)
|
RefreshWindow::RefreshWindow(BPoint position, float current, float min, float max)
|
||||||
: BWindow(BRect(0, 0, 300, 200), "Refresh Rate", B_MODAL_WINDOW,
|
: BWindow(BRect(0, 0, 300, 200), B_TRANSLATE("Refresh Rate"), B_MODAL_WINDOW,
|
||||||
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
|
||||||
{
|
{
|
||||||
min = ceilf(min);
|
min = ceilf(min);
|
||||||
@@ -35,7 +40,7 @@ RefreshWindow::RefreshWindow(BPoint position, float current, float min, float ma
|
|||||||
|
|
||||||
BRect rect = Bounds().InsetByCopy(8, 8);
|
BRect rect = Bounds().InsetByCopy(8, 8);
|
||||||
BStringView* stringView = new BStringView(rect, "info",
|
BStringView* stringView = new BStringView(rect, "info",
|
||||||
"Type or use the left and right arrow keys.");
|
B_TRANSLATE("Type or use the left and right arrow keys."));
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
topView->AddChild(stringView);
|
topView->AddChild(stringView);
|
||||||
|
|
||||||
@@ -48,15 +53,16 @@ RefreshWindow::RefreshWindow(BPoint position, float current, float min, float ma
|
|||||||
fRefreshSlider->ResizeTo(rect.Width(), height);
|
fRefreshSlider->ResizeTo(rect.Width(), height);
|
||||||
topView->AddChild(fRefreshSlider);
|
topView->AddChild(fRefreshSlider);
|
||||||
|
|
||||||
BButton* doneButton = new BButton(rect, "DoneButton", "Done",
|
BButton* doneButton = new BButton(rect, "DoneButton", B_TRANSLATE("Done"),
|
||||||
new BMessage(BUTTON_DONE_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(BUTTON_DONE_MSG), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
doneButton->ResizeToPreferred();
|
doneButton->ResizeToPreferred();
|
||||||
doneButton->MoveTo(Bounds().Width() - doneButton->Bounds().Width() - 8,
|
doneButton->MoveTo(Bounds().Width() - doneButton->Bounds().Width() - 8,
|
||||||
Bounds().Height() - doneButton->Bounds().Height() - 8);
|
Bounds().Height() - doneButton->Bounds().Height() - 8);
|
||||||
topView->AddChild(doneButton);
|
topView->AddChild(doneButton);
|
||||||
|
|
||||||
BButton* button = new BButton(doneButton->Frame(), "CancelButton", "Cancel",
|
BButton* button = new BButton(doneButton->Frame(), "CancelButton",
|
||||||
new BMessage(B_QUIT_REQUESTED), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED),
|
||||||
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
button->ResizeToPreferred();
|
button->ResizeToPreferred();
|
||||||
button->MoveBy(-button->Bounds().Width() - 10, 0);
|
button->MoveBy(-button->Bounds().Width() - 10, 0);
|
||||||
topView->AddChild(button);
|
topView->AddChild(button);
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
static const char* kAppSignature = "application/x-vnd.Be-SCRN";
|
static const char* kAppSignature = "application/x-vnd.Be-SCRN";
|
||||||
@@ -32,8 +37,9 @@ ScreenApplication::ScreenApplication()
|
|||||||
void
|
void
|
||||||
ScreenApplication::AboutRequested()
|
ScreenApplication::AboutRequested()
|
||||||
{
|
{
|
||||||
BAlert *aboutAlert = new BAlert("About", "Screen preferences by the Haiku team",
|
BAlert *aboutAlert = new BAlert(B_TRANSLATE("About"),
|
||||||
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
|
B_TRANSLATE("Screen preferences by the Haiku team"), B_TRANSLATE("OK"),
|
||||||
|
NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
|
||||||
aboutAlert->SetShortcut(0, B_OK);
|
aboutAlert->SetShortcut(0, B_OK);
|
||||||
aboutAlert->Go();
|
aboutAlert->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
@@ -61,6 +62,10 @@
|
|||||||
#include "multimon.h" // the usual: DANGER WILL, ROBINSON!
|
#include "multimon.h" // the usual: DANGER WILL, ROBINSON!
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Screen"
|
||||||
|
|
||||||
|
|
||||||
const char* kBackgroundsSignature = "application/x-vnd.Haiku-Backgrounds";
|
const char* kBackgroundsSignature = "application/x-vnd.Haiku-Backgrounds";
|
||||||
|
|
||||||
// list of officially supported colour spaces
|
// list of officially supported colour spaces
|
||||||
@@ -69,11 +74,11 @@ static const struct {
|
|||||||
int32 bits_per_pixel;
|
int32 bits_per_pixel;
|
||||||
const char* label;
|
const char* label;
|
||||||
} kColorSpaces[] = {
|
} kColorSpaces[] = {
|
||||||
{ B_CMAP8, 8, "8 bits/pixel, 256 colors" },
|
{ B_CMAP8, 8, B_TRANSATE("8 bits/pixel, 256 colors") },
|
||||||
{ B_RGB15, 15, "15 bits/pixel, 32768 colors" },
|
{ B_RGB15, 15, B_TRANSLATE("15 bits/pixel, 32768 colors") },
|
||||||
{ B_RGB16, 16, "16 bits/pixel, 65536 colors" },
|
{ B_RGB16, 16, B_TRANSLATE("16 bits/pixel, 65536 colors") },
|
||||||
{ B_RGB24, 24, "24 bits/pixel, 16 Million colors" },
|
{ B_RGB24, 24, B_TRANSLATE("24 bits/pixel, 16 Million colors") },
|
||||||
{ B_RGB32, 32, "32 bits/pixel, 16 Million colors" }
|
{ B_RGB32, 32, B_TRANSLATE("32 bits/pixel, 16 Million colors") }
|
||||||
};
|
};
|
||||||
static const int32 kColorSpaceCount
|
static const int32 kColorSpaceCount
|
||||||
= sizeof(kColorSpaces) / sizeof(kColorSpaces[0]);
|
= sizeof(kColorSpaces) / sizeof(kColorSpaces[0]);
|
||||||
@@ -88,9 +93,9 @@ static const struct {
|
|||||||
combine_mode mode;
|
combine_mode mode;
|
||||||
const char *name;
|
const char *name;
|
||||||
} kCombineModes[] = {
|
} kCombineModes[] = {
|
||||||
{ kCombineDisable, "disable" },
|
{ kCombineDisable, B_TRANSLATE("disable") },
|
||||||
{ kCombineHorizontally, "horizontally" },
|
{ kCombineHorizontally, B_TRANSLATE("horizontally") },
|
||||||
{ kCombineVertically, "vertically" }
|
{ kCombineVertically, B_TRANSLATE("vertically") }
|
||||||
};
|
};
|
||||||
static const int32 kCombineModeCount
|
static const int32 kCombineModeCount
|
||||||
= sizeof(kCombineModes) / sizeof(kCombineModes[0]);
|
= sizeof(kCombineModes) / sizeof(kCombineModes[0]);
|
||||||
@@ -137,7 +142,7 @@ refresh_rate_to_string(float refresh, BString &string,
|
|||||||
string.UnlockBuffer();
|
string.UnlockBuffer();
|
||||||
|
|
||||||
if (appendUnit)
|
if (appendUnit)
|
||||||
string << " Hz";
|
string << B_TRANSLATE(" Hz");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -146,7 +151,7 @@ screen_errors(status_t status)
|
|||||||
{
|
{
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case B_ENTRY_NOT_FOUND:
|
case B_ENTRY_NOT_FOUND:
|
||||||
return "Unknown mode";
|
return B_TRANSLATE("Unknown mode");
|
||||||
// TODO: add more?
|
// TODO: add more?
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -160,7 +165,7 @@ screen_errors(status_t status)
|
|||||||
|
|
||||||
ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
||||||
:
|
:
|
||||||
BWindow(settings->WindowFrame(), "Screen", B_TITLED_WINDOW,
|
BWindow(settings->WindowFrame(), B_TRANSLATE("Screen"), B_TITLED_WINDOW,
|
||||||
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
|
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS,
|
||||||
B_ALL_WORKSPACES),
|
B_ALL_WORKSPACES),
|
||||||
fBootWorkspaceApplied(false),
|
fBootWorkspaceApplied(false),
|
||||||
@@ -183,11 +188,12 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
|
|
||||||
// we need the "Current Workspace" first to get its height
|
// we need the "Current Workspace" first to get its height
|
||||||
|
|
||||||
BPopUpMenu *popUpMenu = new BPopUpMenu("Current workspace", true, true);
|
BPopUpMenu *popUpMenu = new BPopUpMenu(B_TRANSLATE("Current workspace"),
|
||||||
fAllWorkspacesItem = new BMenuItem("All workspaces",
|
true, true);
|
||||||
|
fAllWorkspacesItem = new BMenuItem(B_TRANSLATE("All workspaces"),
|
||||||
new BMessage(WORKSPACE_CHECK_MSG));
|
new BMessage(WORKSPACE_CHECK_MSG));
|
||||||
popUpMenu->AddItem(fAllWorkspacesItem);
|
popUpMenu->AddItem(fAllWorkspacesItem);
|
||||||
BMenuItem *item = new BMenuItem("Current workspace",
|
BMenuItem *item = new BMenuItem(B_TRANSLATE("Current workspace"),
|
||||||
new BMessage(WORKSPACE_CHECK_MSG));
|
new BMessage(WORKSPACE_CHECK_MSG));
|
||||||
|
|
||||||
popUpMenu->AddItem(item);
|
popUpMenu->AddItem(item);
|
||||||
@@ -207,17 +213,18 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
fMonitorInfo = new BStringView("monitor info", "");
|
fMonitorInfo = new BStringView("monitor info", "");
|
||||||
screenBox->AddChild(fMonitorInfo);
|
screenBox->AddChild(fMonitorInfo);
|
||||||
|
|
||||||
fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0), "monitor",
|
fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0),
|
||||||
screen.Frame().IntegerWidth() + 1, screen.Frame().IntegerHeight() + 1);
|
B_TRANSLATE("monitor"), screen.Frame().IntegerWidth() + 1,
|
||||||
|
screen.Frame().IntegerHeight() + 1);
|
||||||
screenBox->AddChild(fMonitorView);
|
screenBox->AddChild(fMonitorView);
|
||||||
|
|
||||||
fColumnsControl = new BTextControl("Columns:", "0",
|
fColumnsControl = new BTextControl(B_TRANSLATE("Columns:"), "0",
|
||||||
new BMessage(kMsgWorkspaceColumnsChanged));
|
new BMessage(kMsgWorkspaceColumnsChanged));
|
||||||
fRowsControl = new BTextControl("Rows:", "0",
|
fRowsControl = new BTextControl(B_TRANSLATE("Rows:"), "0",
|
||||||
new BMessage(kMsgWorkspaceRowsChanged));
|
new BMessage(kMsgWorkspaceRowsChanged));
|
||||||
|
|
||||||
screenBox->AddChild(BLayoutBuilder::Grid<>(5.0, 5.0)
|
screenBox->AddChild(BLayoutBuilder::Grid<>(5.0, 5.0)
|
||||||
.Add(new BStringView("", "Workspaces"), 0, 0, 3)
|
.Add(new BStringView("", B_TRANSLATE("Workspaces")), 0, 0, 3)
|
||||||
.AddTextControl(fColumnsControl, 0, 1, B_ALIGN_RIGHT)
|
.AddTextControl(fColumnsControl, 0, 1, B_ALIGN_RIGHT)
|
||||||
.AddGroup(B_HORIZONTAL, 0, 2, 1)
|
.AddGroup(B_HORIZONTAL, 0, 2, 1)
|
||||||
.Add(_CreateColumnRowButton(true, false))
|
.Add(_CreateColumnRowButton(true, false))
|
||||||
@@ -231,7 +238,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
.View());
|
.View());
|
||||||
|
|
||||||
fBackgroundsButton = new BButton("BackgroundsButton",
|
fBackgroundsButton = new BButton("BackgroundsButton",
|
||||||
"Set background" B_UTF8_ELLIPSIS,
|
B_TRANSLATE("Set background" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(BUTTON_LAUNCH_BACKGROUNDS_MSG));
|
new BMessage(BUTTON_LAUNCH_BACKGROUNDS_MSG));
|
||||||
fBackgroundsButton->SetFontSize(be_plain_font->Size() * 0.9);
|
fBackgroundsButton->SetFontSize(be_plain_font->Size() * 0.9);
|
||||||
screenBox->AddChild(fBackgroundsButton);
|
screenBox->AddChild(fBackgroundsButton);
|
||||||
@@ -244,7 +251,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
outerControlsView->GroupLayout()->SetInsets(10, 10, 10, 10);
|
outerControlsView->GroupLayout()->SetInsets(10, 10, 10, 10);
|
||||||
controlsBox->AddChild(outerControlsView);
|
controlsBox->AddChild(outerControlsView);
|
||||||
|
|
||||||
fResolutionMenu = new BPopUpMenu("resolution", true, true);
|
fResolutionMenu = new BPopUpMenu(B_TRANSLATE("resolution"), true, true);
|
||||||
|
|
||||||
uint16 maxWidth = 0;
|
uint16 maxWidth = 0;
|
||||||
uint16 maxHeight = 0;
|
uint16 maxHeight = 0;
|
||||||
@@ -275,10 +282,10 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
|
|
||||||
fMonitorView->SetMaxResolution(maxWidth, maxHeight);
|
fMonitorView->SetMaxResolution(maxWidth, maxHeight);
|
||||||
|
|
||||||
fResolutionField = new BMenuField("ResolutionMenu", "Resolution:",
|
fResolutionField = new BMenuField("ResolutionMenu",
|
||||||
fResolutionMenu, NULL);
|
B_TRANSLATE("Resolution:"), fResolutionMenu, NULL);
|
||||||
|
|
||||||
fColorsMenu = new BPopUpMenu("colors", true, false);
|
fColorsMenu = new BPopUpMenu(B_TRANSLATE("colors"), true, false);
|
||||||
|
|
||||||
for (int32 i = 0; i < kColorSpaceCount; i++) {
|
for (int32 i = 0; i < kColorSpaceCount; i++) {
|
||||||
if ((fSupportedColorSpaces & (1 << i)) == 0)
|
if ((fSupportedColorSpaces & (1 << i)) == 0)
|
||||||
@@ -295,9 +302,10 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
fColorsMenu->AddItem(item);
|
fColorsMenu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
fColorsField = new BMenuField("ColorsMenu", "Colors:", fColorsMenu, NULL);
|
fColorsField = new BMenuField("ColorsMenu", B_TRANSLATE("Colors:"),
|
||||||
|
fColorsMenu, NULL);
|
||||||
|
|
||||||
fRefreshMenu = new BPopUpMenu("refresh rate", true, true);
|
fRefreshMenu = new BPopUpMenu(B_TRANSLATE("refresh rate"), true, true);
|
||||||
|
|
||||||
BMessage *message;
|
BMessage *message;
|
||||||
|
|
||||||
@@ -306,7 +314,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
// This is a special case for drivers that only support a single
|
// This is a special case for drivers that only support a single
|
||||||
// frequency, like the VESA driver
|
// frequency, like the VESA driver
|
||||||
BString name;
|
BString name;
|
||||||
name << min << " Hz";
|
name << min << B_TRANSLATE(" Hz");
|
||||||
|
|
||||||
message = new BMessage(POP_REFRESH_MSG);
|
message = new BMessage(POP_REFRESH_MSG);
|
||||||
message->AddFloat("refresh", min);
|
message->AddFloat("refresh", min);
|
||||||
@@ -325,7 +333,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
BString name;
|
BString name;
|
||||||
name << kRefreshRates[i] << " Hz";
|
name << kRefreshRates[i] << B_TRANSLATE(" Hz");
|
||||||
|
|
||||||
message = new BMessage(POP_REFRESH_MSG);
|
message = new BMessage(POP_REFRESH_MSG);
|
||||||
message->AddFloat("refresh", kRefreshRates[i]);
|
message->AddFloat("refresh", kRefreshRates[i]);
|
||||||
@@ -335,11 +343,12 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
|
|
||||||
message = new BMessage(POP_OTHER_REFRESH_MSG);
|
message = new BMessage(POP_OTHER_REFRESH_MSG);
|
||||||
|
|
||||||
fOtherRefresh = new BMenuItem("Other" B_UTF8_ELLIPSIS, message);
|
fOtherRefresh = new BMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS),
|
||||||
|
message);
|
||||||
fRefreshMenu->AddItem(fOtherRefresh);
|
fRefreshMenu->AddItem(fOtherRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
fRefreshField = new BMenuField("RefreshMenu", "Refresh rate:",
|
fRefreshField = new BMenuField("RefreshMenu", B_TRANSLATE("Refresh rate:"),
|
||||||
fRefreshMenu, NULL);
|
fRefreshMenu, NULL);
|
||||||
|
|
||||||
if (_IsVesa())
|
if (_IsVesa())
|
||||||
@@ -360,7 +369,8 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
// even if there is no support, we still create all controls
|
// even if there is no support, we still create all controls
|
||||||
// to make sure we don't access NULL pointers later on
|
// to make sure we don't access NULL pointers later on
|
||||||
|
|
||||||
fCombineMenu = new BPopUpMenu("CombineDisplays", true, true);
|
fCombineMenu = new BPopUpMenu(B_TRANSLATE("CombineDisplays"),
|
||||||
|
true, true);
|
||||||
|
|
||||||
for (int32 i = 0; i < kCombineModeCount; i++) {
|
for (int32 i = 0; i < kCombineModeCount; i++) {
|
||||||
message = new BMessage(POP_COMBINE_DISPLAYS_MSG);
|
message = new BMessage(POP_COMBINE_DISPLAYS_MSG);
|
||||||
@@ -371,46 +381,50 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fCombineField = new BMenuField("CombineMenu",
|
fCombineField = new BMenuField("CombineMenu",
|
||||||
"Combine displays:", fCombineMenu, NULL);
|
B_TRANSLATE("Combine displays:"), fCombineMenu, NULL);
|
||||||
|
|
||||||
if (!multiMonSupport)
|
if (!multiMonSupport)
|
||||||
fCombineField->Hide();
|
fCombineField->Hide();
|
||||||
|
|
||||||
fSwapDisplaysMenu = new BPopUpMenu("SwapDisplays", true, true);
|
fSwapDisplaysMenu = new BPopUpMenu(B_TRANSLATE("SwapDisplays"),
|
||||||
|
true, true);
|
||||||
|
|
||||||
// !order is important - we rely that boolean value == idx
|
// !order is important - we rely that boolean value == idx
|
||||||
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
|
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
|
||||||
message->AddBool("swap", false);
|
message->AddBool("swap", false);
|
||||||
fSwapDisplaysMenu->AddItem(new BMenuItem("no", message));
|
fSwapDisplaysMenu->AddItem(new BMenuItem(B_TRANSLATE("no"), message));
|
||||||
|
|
||||||
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
|
message = new BMessage(POP_SWAP_DISPLAYS_MSG);
|
||||||
message->AddBool("swap", true);
|
message->AddBool("swap", true);
|
||||||
fSwapDisplaysMenu->AddItem(new BMenuItem("yes", message));
|
fSwapDisplaysMenu->AddItem(new BMenuItem(B_TRANSLATE("yes"), message));
|
||||||
|
|
||||||
fSwapDisplaysField = new BMenuField("SwapMenu", "Swap displays:",
|
fSwapDisplaysField = new BMenuField("SwapMenu",
|
||||||
fSwapDisplaysMenu, NULL);
|
B_TRANSLATE("Swap displays:"), fSwapDisplaysMenu, NULL);
|
||||||
|
|
||||||
if (!multiMonSupport)
|
if (!multiMonSupport)
|
||||||
fSwapDisplaysField->Hide();
|
fSwapDisplaysField->Hide();
|
||||||
|
|
||||||
fUseLaptopPanelMenu = new BPopUpMenu("UseLaptopPanel", true, true);
|
fUseLaptopPanelMenu = new BPopUpMenu(B_TRANSLATE("UseLaptopPanel"),
|
||||||
|
true, true);
|
||||||
|
|
||||||
// !order is important - we rely that boolean value == idx
|
// !order is important - we rely that boolean value == idx
|
||||||
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
|
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
|
||||||
message->AddBool("use", false);
|
message->AddBool("use", false);
|
||||||
fUseLaptopPanelMenu->AddItem(new BMenuItem("if needed", message));
|
fUseLaptopPanelMenu->AddItem(new BMenuItem(B_TRANSLATE("if needed"),
|
||||||
|
message));
|
||||||
|
|
||||||
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
|
message = new BMessage(POP_USE_LAPTOP_PANEL_MSG);
|
||||||
message->AddBool("use", true);
|
message->AddBool("use", true);
|
||||||
fUseLaptopPanelMenu->AddItem(new BMenuItem("always", message));
|
fUseLaptopPanelMenu->AddItem(new BMenuItem(B_TRANSLATE("always"),
|
||||||
|
message));
|
||||||
|
|
||||||
fUseLaptopPanelField = new BMenuField("UseLaptopPanel",
|
fUseLaptopPanelField = new BMenuField("UseLaptopPanel",
|
||||||
"Use laptop panel:", fUseLaptopPanelMenu, NULL);
|
B_TRANSLATE("Use laptop panel:"), fUseLaptopPanelMenu, NULL);
|
||||||
|
|
||||||
if (!useLaptopPanelSupport)
|
if (!useLaptopPanelSupport)
|
||||||
fUseLaptopPanelField->Hide();
|
fUseLaptopPanelField->Hide();
|
||||||
|
|
||||||
fTVStandardMenu = new BPopUpMenu("TVStandard", true, true);
|
fTVStandardMenu = new BPopUpMenu(B_TRANSLATE("TVStandard"), true, true);
|
||||||
|
|
||||||
// arbitrary limit
|
// arbitrary limit
|
||||||
uint32 i;
|
uint32 i;
|
||||||
@@ -427,8 +441,8 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
fTVStandardMenu->AddItem(new BMenuItem(name.String(), message));
|
fTVStandardMenu->AddItem(new BMenuItem(name.String(), message));
|
||||||
}
|
}
|
||||||
|
|
||||||
fTVStandardField = new BMenuField("tv standard", "Video format:",
|
fTVStandardField = new BMenuField("tv standard",
|
||||||
fTVStandardMenu, NULL);
|
B_TRANSLATE("Video format:"), fTVStandardMenu, NULL);
|
||||||
fTVStandardField->SetAlignment(B_ALIGN_RIGHT);
|
fTVStandardField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
|
|
||||||
if (!tvStandardSupport || i == 0)
|
if (!tvStandardSupport || i == 0)
|
||||||
@@ -450,7 +464,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
/* fDefaultsButton = new BButton(buttonRect, "DefaultsButton", "Defaults",
|
/* fDefaultsButton = new BButton(buttonRect, "DefaultsButton", "Defaults",
|
||||||
new BMessage(BUTTON_DEFAULTS_MSG));*/
|
new BMessage(BUTTON_DEFAULTS_MSG));*/
|
||||||
|
|
||||||
fApplyButton = new BButton("ApplyButton", "Apply",
|
fApplyButton = new BButton("ApplyButton", B_TRANSLATE("Apply"),
|
||||||
new BMessage(BUTTON_APPLY_MSG));
|
new BMessage(BUTTON_APPLY_MSG));
|
||||||
fApplyButton->SetEnabled(false);
|
fApplyButton->SetEnabled(false);
|
||||||
BLayoutBuilder::Group<>(outerControlsView)
|
BLayoutBuilder::Group<>(outerControlsView)
|
||||||
@@ -459,7 +473,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
.AddGlue()
|
.AddGlue()
|
||||||
.Add(fApplyButton);
|
.Add(fApplyButton);
|
||||||
|
|
||||||
fRevertButton = new BButton("RevertButton", "Revert",
|
fRevertButton = new BButton("RevertButton", B_TRANSLATE("Revert"),
|
||||||
new BMessage(BUTTON_REVERT_MSG));
|
new BMessage(BUTTON_REVERT_MSG));
|
||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
|
|
||||||
@@ -497,10 +511,11 @@ ScreenWindow::QuitRequested()
|
|||||||
if (fBootWorkspaceApplied && fScreenMode.Get(vesaMode, 0) == B_OK) {
|
if (fBootWorkspaceApplied && fScreenMode.Get(vesaMode, 0) == B_OK) {
|
||||||
status_t status = _WriteVesaModeFile(vesaMode);
|
status_t status = _WriteVesaModeFile(vesaMode);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
BString warning = "Could not write VESA mode settings file:\n\t";
|
BString warning = B_TRANSLATE("Could not write VESA mode settings"
|
||||||
|
" file:\n\t");
|
||||||
warning << strerror(status);
|
warning << strerror(status);
|
||||||
(new BAlert("VesaAlert", warning.String(), "OK", NULL, NULL,
|
(new BAlert("VesaAlert", warning.String(), B_TRANSLATE("OK"), NULL,
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,7 +671,7 @@ ScreenWindow::_UpdateRefreshControl()
|
|||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
|
|
||||||
// "Other…" items only contains a refresh rate when active
|
// "Other…" items only contains a refresh rate when active
|
||||||
fOtherRefresh->SetLabel("Other" B_UTF8_ELLIPSIS);
|
fOtherRefresh->SetLabel(B_TRANSLATE("Other" B_UTF8_ELLIPSIS_);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -667,7 +682,7 @@ ScreenWindow::_UpdateRefreshControl()
|
|||||||
|
|
||||||
fRefreshMenu->Superitem()->SetLabel(string.String());
|
fRefreshMenu->Superitem()->SetLabel(string.String());
|
||||||
|
|
||||||
string.Append("/other" B_UTF8_ELLIPSIS);
|
string.Append(B_TRANSLATE("/other" B_UTF8_ELLIPSIS));
|
||||||
fOtherRefresh->SetLabel(string.String());
|
fOtherRefresh->SetLabel(string.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -928,7 +943,7 @@ ScreenWindow::MessageReceived(BMessage* message)
|
|||||||
case POP_REFRESH_MSG:
|
case POP_REFRESH_MSG:
|
||||||
{
|
{
|
||||||
message->FindFloat("refresh", &fSelected.refresh);
|
message->FindFloat("refresh", &fSelected.refresh);
|
||||||
fOtherRefresh->SetLabel("Other" B_UTF8_ELLIPSIS);
|
fOtherRefresh->SetLabel(B_TRANSLATE("Other" B_UTF8_ELLIPSIS));
|
||||||
// revert "Other…" label - it might have a refresh rate prefix
|
// revert "Other…" label - it might have a refresh rate prefix
|
||||||
|
|
||||||
_CheckApplyEnabled();
|
_CheckApplyEnabled();
|
||||||
@@ -1193,16 +1208,16 @@ ScreenWindow::_UpdateMonitor()
|
|||||||
&& info.min_vertical_frequency != 0
|
&& info.min_vertical_frequency != 0
|
||||||
&& info.max_pixel_clock != 0) {
|
&& info.max_pixel_clock != 0) {
|
||||||
length = snprintf(text, sizeof(text),
|
length = snprintf(text, sizeof(text),
|
||||||
"Horizonal frequency:\t%lu - %lu kHz\n"
|
B_TRANSLATE("Horizonal frequency:\t%lu - %lu kHz\n"
|
||||||
"Vertical frequency:\t%lu - %lu Hz\n\n"
|
"Vertical frequency:\t%lu - %lu Hz\n\n"
|
||||||
"Maximum pixel clock:\t%g MHz",
|
"Maximum pixel clock:\t%g MHz"),
|
||||||
info.min_horizontal_frequency, info.max_horizontal_frequency,
|
info.min_horizontal_frequency, info.max_horizontal_frequency,
|
||||||
info.min_vertical_frequency, info.max_vertical_frequency,
|
info.min_vertical_frequency, info.max_vertical_frequency,
|
||||||
info.max_pixel_clock / 1000.0);
|
info.max_pixel_clock / 1000.0);
|
||||||
}
|
}
|
||||||
if (info.serial_number[0] && length < sizeof(text)) {
|
if (info.serial_number[0] && length < sizeof(text)) {
|
||||||
length += snprintf(text + length, sizeof(text) - length,
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
"%sSerial no.: %s", length ? "\n\n" : "",
|
B_TRANSLATE("%sSerial no.: %s"), length ? "\n\n" : "",
|
||||||
info.serial_number);
|
info.serial_number);
|
||||||
if (info.produced.week != 0 && info.produced.year != 0
|
if (info.produced.week != 0 && info.produced.year != 0
|
||||||
&& length < sizeof(text)) {
|
&& length < sizeof(text)) {
|
||||||
@@ -1237,7 +1252,7 @@ void
|
|||||||
ScreenWindow::_UpdateColorLabel()
|
ScreenWindow::_UpdateColorLabel()
|
||||||
{
|
{
|
||||||
BString string;
|
BString string;
|
||||||
string << fSelected.BitsPerPixel() << " bits/pixel";
|
string << fSelected.BitsPerPixel() << B_TRANSLATE(" bits/pixel");
|
||||||
fColorsMenu->Superitem()->SetLabel(string.String());
|
fColorsMenu->Superitem()->SetLabel(string.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1277,8 +1292,10 @@ ScreenWindow::_Apply()
|
|||||||
} else {
|
} else {
|
||||||
char message[256];
|
char message[256];
|
||||||
snprintf(message, sizeof(message),
|
snprintf(message, sizeof(message),
|
||||||
"The screen mode could not be set:\n\t%s\n", screen_errors(status));
|
B_TRANSLATE("The screen mode could not be set:\n\t%s\n"),
|
||||||
BAlert* alert = new BAlert("Screen Alert", message, "OK", NULL, NULL,
|
screen_errors(status));
|
||||||
|
BAlert* alert = new BAlert(B_TRANSLATE("Screen Alert"), message,
|
||||||
|
B_TRANSLATE("OK"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user