Patch by Mike Roll: localize Notifications

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40028 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-12-29 10:43:54 +00:00
parent c9e8f97a95
commit 4915d3ef43
6 changed files with 126 additions and 91 deletions

View File

@ -11,6 +11,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <Directory.h> #include <Directory.h>
#include <Message.h> #include <Message.h>
#include <FindDirectory.h> #include <FindDirectory.h>
@ -29,7 +30,9 @@
#include "DisplayView.h" #include "DisplayView.h"
#include "SettingsHost.h" #include "SettingsHost.h"
#define _T(str) (str)
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "DisplayView"
DisplayView::DisplayView(SettingsHost* host) DisplayView::DisplayView(SettingsHost* host)
@ -37,26 +40,27 @@ DisplayView::DisplayView(SettingsHost* host)
SettingsPane("display", host) SettingsPane("display", host)
{ {
// Window width // Window width
fWindowWidth = new BTextControl(_T("Window width:"), NULL, fWindowWidth = new BTextControl(B_TRANSLATE("Window width:"), NULL,
new BMessage(kSettingChanged)); new BMessage(kSettingChanged));
// Icon size // Icon size
fIconSize = new BMenu("iconSize"); fIconSize = new BMenu("iconSize");
fIconSize->AddItem(new BMenuItem(_T("Mini icon"), fIconSize->AddItem(new BMenuItem(B_TRANSLATE("Mini icon"),
new BMessage(kSettingChanged))); new BMessage(kSettingChanged)));
fIconSize->AddItem(new BMenuItem(_T("Large icon"), fIconSize->AddItem(new BMenuItem(B_TRANSLATE("Large icon"),
new BMessage(kSettingChanged))); new BMessage(kSettingChanged)));
fIconSize->SetLabelFromMarked(true); fIconSize->SetLabelFromMarked(true);
fIconSizeField = new BMenuField(_T("Icon size:"), fIconSize); fIconSizeField = new BMenuField(B_TRANSLATE("Icon size:"), fIconSize);
// Title position // Title position
fTitlePosition = new BMenu("titlePosition"); fTitlePosition = new BMenu("titlePosition");
fTitlePosition->AddItem(new BMenuItem(_T("Above icon"), fTitlePosition->AddItem(new BMenuItem(B_TRANSLATE("Above icon"),
new BMessage(kSettingChanged))); new BMessage(kSettingChanged)));
fTitlePosition->AddItem(new BMenuItem(_T("Right of icon"), fTitlePosition->AddItem(new BMenuItem(B_TRANSLATE("Right of icon"),
new BMessage(kSettingChanged))); new BMessage(kSettingChanged)));
fTitlePosition->SetLabelFromMarked(true); fTitlePosition->SetLabelFromMarked(true);
fTitlePositionField = new BMenuField(_T("Title position:"), fTitlePosition); fTitlePositionField = new BMenuField(B_TRANSLATE("Title position:"),
fTitlePosition);
// Load settings // Load settings
Load(); Load();
@ -111,9 +115,9 @@ DisplayView::Load()
if (create_directory(path.Path(), 0755) != B_OK) { if (create_directory(path.Path(), 0755) != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("There was a problem saving the preferences.\n" B_TRANSLATE("There was a problem saving the preferences.\n"
"It's possible you don't have write access to the " "It's possible you don't have write access to the "
"settings directory."), "OK", NULL, NULL, "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
} }
@ -205,9 +209,9 @@ DisplayView::Save()
status_t ret = settings.Flatten(&file); status_t ret = settings.Flatten(&file);
if (ret != B_OK) { if (ret != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("Can't save preferenes, you probably don't have write " B_TRANSLATE("Can't save preferenes, you probably don't have "
"access to the settings directory or the disk is full."), "OK", NULL, NULL, "write access to the settings directory or the disk is full."),
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return ret; return ret;
} }

View File

@ -18,6 +18,7 @@
#include <Alert.h> #include <Alert.h>
#include <Font.h> #include <Font.h>
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include <StringView.h> #include <StringView.h>
#include <TextControl.h> #include <TextControl.h>
#include <CheckBox.h> #include <CheckBox.h>
@ -36,14 +37,14 @@
#include "GeneralView.h" #include "GeneralView.h"
#include "SettingsHost.h" #include "SettingsHost.h"
#define _T(str) (str) #undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "GeneralView"
const int32 kServer = '_TSR'; const int32 kServer = '_TSR';
const char* kStartServer = _T("Enable notifications"); const char* kStartServer = B_TRANSLATE("Enable notifications");
const char* kStopServer = _T("Disable notifications"); const char* kStopServer = B_TRANSLATE("Disable notifications");
const char* kStarted = _T("Events are notified"); const char* kStarted = B_TRANSLATE("Events are notified");
const char* kStopped = _T("Events are not notified"); const char* kStopped = B_TRANSLATE("Events are not notified");
GeneralView::GeneralView(SettingsHost* host) GeneralView::GeneralView(SettingsHost* host)
@ -71,13 +72,14 @@ GeneralView::GeneralView(SettingsHost* host)
// Autostart // Autostart
fAutoStart = new BCheckBox("autostart", fAutoStart = new BCheckBox("autostart",
_T("Enable notifications at startup"), new BMessage(kSettingChanged)); B_TRANSLATE("Enable notifications at startup"),
new BMessage(kSettingChanged));
// Display time // Display time
fTimeout = new BTextControl(_T("Hide notifications from screen after"), NULL, fTimeout = new BTextControl(B_TRANSLATE("Hide notifications from screen"
new BMessage(kSettingChanged)); " after"), NULL, new BMessage(kSettingChanged));
BStringView* displayTimeLabel = new BStringView("dt_label", BStringView* displayTimeLabel = new BStringView("dt_label",
_T("seconds of inactivity")); B_TRANSLATE("seconds of inactivity");
// Default position // Default position
// TODO: Here will come a screen representation with the four corners clickable // TODO: Here will come a screen representation with the four corners clickable
@ -129,11 +131,11 @@ GeneralView::MessageReceived(BMessage* msg)
// Check if server is available // Check if server is available
if (!_CanFindServer(&ref)) { if (!_CanFindServer(&ref)) {
BAlert* alert = new BAlert(_T("Notifications"), BAlert* alert = new BAlert(B_TRANSLATE("Notifications"),
_T("The notifications server cannot be found, " B_TRANSLATE("The notifications server cannot be"
"this means your InfoPopper installation was not " " found, this means your InfoPopper installation was"
"successfully completed."), _T("OK"), NULL, " not successfully completed."), B_TRANSLATE("OK"),
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return; return;
} }
@ -146,20 +148,22 @@ GeneralView::MessageReceived(BMessage* msg)
status_t ret = B_ERROR; status_t ret = B_ERROR;
BMessenger messenger(kNotificationServerSignature, team, &ret); BMessenger messenger(kNotificationServerSignature, team, &ret);
if (ret != B_OK) { if (ret != B_OK) {
BAlert* alert = new BAlert(_T("Notifications"), BAlert* alert = new BAlert(B_TRANSLATE(
_T("Notifications cannot be stopped, because " "Notifications"), B_TRANSLATE("Notifications "
"the server can't be reached."), "cannot be stopped, because the server can't be"
_T("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); " reached."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return; return;
} }
// Send quit message // Send quit message
if (messenger.SendMessage(new BMessage(B_QUIT_REQUESTED)) != B_OK) { if (messenger.SendMessage(new BMessage(B_QUIT_REQUESTED)) != B_OK) {
BAlert* alert = new BAlert(_T("Notifications"), BAlert* alert = new BAlert(B_TRANSLATE(
_T("Cannot disable notifications because the server " "Notifications"), B_TRANSLATE("Cannot disable"
"can't be reached."), _T("OK"), NULL, " notifications because the server can't be "
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); "reached."), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return; return;
} }
@ -170,11 +174,13 @@ GeneralView::MessageReceived(BMessage* msg)
// Start server // Start server
status_t err = be_roster->Launch(kNotificationServerSignature); status_t err = be_roster->Launch(kNotificationServerSignature);
if (err != B_OK) { if (err != B_OK) {
BAlert* alert = new BAlert(_T("Notifications"), BAlert* alert = new BAlert(B_TRANSLATE(
_T("Cannot enable notifications because the server " "Notifications"), B_TRANSLATE("Cannot enable"
"cannot be found.\nThis means your InfoPopper " " notifications because the server cannot be "
"installation was not successfully completed."), "found.\nThis means your InfoPopper installation"
_T("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); " was not successfully completed.")),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return; return;
} }
@ -205,9 +211,9 @@ GeneralView::Load()
if (create_directory(path.Path(), 0755) != B_OK) { if (create_directory(path.Path(), 0755) != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("There was a problem saving the preferences.\n" B_TRANSLATE("There was a problem saving the preferences.\n"
"It's possible you don't have write access to the " "It's possible you don't have write access to the "
"settings directory."), "OK", NULL, NULL, "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
} }
@ -261,9 +267,9 @@ GeneralView::Save()
ret = settings.Flatten(&file); ret = settings.Flatten(&file);
if (ret != B_OK) { if (ret != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("An error is occurred saving the preferences.\n" B_TRANSLATE("An error occurred saving the preferences.\n"
"It's possible you are running out of disk space."), "It's possible you are running out of disk space."),
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return ret; return ret;
} }
@ -272,9 +278,9 @@ GeneralView::Save()
entry_ref ref; entry_ref ref;
if (!_CanFindServer(&ref)) { if (!_CanFindServer(&ref)) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("The notifications server cannot be found.\n" B_TRANSLATE("The notifications server cannot be found.\n"
"A possible cause is an installation not done correctly"), "A possible cause is an installation not done correctly"),
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return B_ERROR; return B_ERROR;
} }
@ -286,8 +292,9 @@ GeneralView::Save()
ret = find_directory(B_USER_BOOT_DIRECTORY, &path, true); ret = find_directory(B_USER_BOOT_DIRECTORY, &path, true);
if (ret != B_OK) { if (ret != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("Can't save preferences, you probably don't have write " B_TRANSLATE"Can't save preferences, you probably don't have "
"access to the boot settings directory."), "OK", NULL, NULL, "write access to the boot settings directory."), B_TRANSLATE("OK"),
NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return ret; return ret;
@ -305,8 +312,9 @@ GeneralView::Save()
if ((ret = directory.CreateSymLink(serverPath.Leaf(), if ((ret = directory.CreateSymLink(serverPath.Leaf(),
serverPath.Path(), NULL) != B_OK)) { serverPath.Path(), NULL) != B_OK)) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("Can't enable notifications at startup time, you probably don't have " B_TRANSLATE("Can't enable notifications at startup time, "
"write permission to the boot settings directory."), "OK", NULL, NULL, "you probably don't have write permission to the boot settings"
" directory."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return ret; return ret;

View File

@ -14,9 +14,19 @@ Application Notifications :
NotificationsView.cpp NotificationsView.cpp
IconRule.cpp IconRule.cpp
IconItem.cpp IconItem.cpp
: be translation libcolumnlistview.a libnotification.a $(TARGET_LIBSTDC++) : be translation libcolumnlistview.a libnotification.a $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS)
: Notifications.rdef : Notifications.rdef
; ;
Depends Notifications : libcolumnlistview.a ; Depends Notifications : libcolumnlistview.a ;
Depends Notifications : libnotification.a ; Depends Notifications : libnotification.a ;
DoCatalogs Notifications :
x-vnd.Haiku-Notifications
:
DisplayView.cpp
GeneralView.cpp
PrefletWin.cpp
PrefletView.cpp
NotificationsView.cpp
;

View File

@ -8,6 +8,7 @@
*/ */
#include <Alert.h> #include <Alert.h>
#include <Catalog.h>
#include <Directory.h> #include <Directory.h>
#include <FindDirectory.h> #include <FindDirectory.h>
#include <GroupLayout.h> #include <GroupLayout.h>
@ -25,7 +26,8 @@
#include "NotificationsView.h" #include "NotificationsView.h"
#define _T(str) (str) #undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "NotificationView"
const float kEdgePadding = 5.0; const float kEdgePadding = 5.0;
const float kCLVTitlePadding = 8.0; const float kCLVTitlePadding = 8.0;
@ -55,47 +57,47 @@ NotificationsView::NotificationsView()
BRect rect(0, 0, 100, 100); BRect rect(0, 0, 100, 100);
// Search application field // Search application field
fSearch = new BTextControl(_T("Search:"), NULL, fSearch = new BTextControl(B_TRANSLATE("Search:"), NULL,
new BMessage(kSettingChanged)); new BMessage(kSettingChanged));
// Applications list // Applications list
fApplications = new BColumnListView(rect, _T("Applications"), fApplications = new BColumnListView(rect, B_TRANSLATE("Applications"),
0, B_WILL_DRAW, B_FANCY_BORDER, true); 0, B_WILL_DRAW, B_FANCY_BORDER, true);
fApplications->SetSelectionMode(B_SINGLE_SELECTION_LIST); fApplications->SetSelectionMode(B_SINGLE_SELECTION_LIST);
fAppCol = new BStringColumn(_T("Application"), 200, fAppCol = new BStringColumn(B_TRANSLATE("Application"), 200,
be_plain_font->StringWidth(_T("Application")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE("Application")) +
rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
fApplications->AddColumn(fAppCol, kAppIndex); fApplications->AddColumn(fAppCol, kAppIndex);
fAppEnabledCol = new BStringColumn(_T("Enabled"), 10, fAppEnabledCol = new BStringColumn(B_TRANSLATE("Enabled"), 10,
be_plain_font->StringWidth(_T("Enabled")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE("Enabled")) +
rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
fApplications->AddColumn(fAppEnabledCol, kAppEnabledIndex); fApplications->AddColumn(fAppEnabledCol, kAppEnabledIndex);
// Notifications list // Notifications list
fNotifications = new BColumnListView(rect, _T("Notifications"), fNotifications = new BColumnListView(rect, B_TRANSLATE("Notifications"),
0, B_WILL_DRAW, B_FANCY_BORDER, true); 0, B_WILL_DRAW, B_FANCY_BORDER, true);
fNotifications->SetSelectionMode(B_SINGLE_SELECTION_LIST); fNotifications->SetSelectionMode(B_SINGLE_SELECTION_LIST);
fTitleCol = new BStringColumn(_T("Title"), 100, fTitleCol = new BStringColumn(B_TRANSLATE("Title"), 100,
be_plain_font->StringWidth(_T("Title")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE"Title")) +
rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
fNotifications->AddColumn(fTitleCol, kTitleIndex); fNotifications->AddColumn(fTitleCol, kTitleIndex);
fDateCol = new BDateColumn(_T("Last Received"), 100, fDateCol = new BDateColumn(B_TRANSLATE("Last Received"), 100,
be_plain_font->StringWidth(_T("Last Received")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE("Last Received")) +
rect.Width(), B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_ALIGN_LEFT);
fNotifications->AddColumn(fDateCol, kDateIndex); fNotifications->AddColumn(fDateCol, kDateIndex);
fTypeCol = new BStringColumn(_T("Type"), 100, fTypeCol = new BStringColumn(B_TRANSLATE("Type"), 100,
be_plain_font->StringWidth(_T("Type")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE("Type")) +
rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
fNotifications->AddColumn(fTypeCol, kTypeIndex); fNotifications->AddColumn(fTypeCol, kTypeIndex);
fAllowCol = new BStringColumn(_T("Allowed"), 100, fAllowCol = new BStringColumn(B_TRANSLATE("Allowed"), 100,
be_plain_font->StringWidth(_T("Allowed")) + (kCLVTitlePadding * 2), be_plain_font->StringWidth(B_TRANSLATE("Allowed")) +
rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT); (kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
fNotifications->AddColumn(fAllowCol, kAllowIndex); fNotifications->AddColumn(fAllowCol, kAllowIndex);
// Load the applications list // Load the applications list
@ -177,9 +179,9 @@ NotificationsView::_LoadAppUsage()
if (create_directory(path.Path(), 0755) != B_OK) { if (create_directory(path.Path(), 0755) != B_OK) {
BAlert* alert = new BAlert("", BAlert* alert = new BAlert("",
_T("There was a problem saving the preferences.\n" B_TRANSLATE("There was a problem saving the preferences.\n"
"It's possible you don't have write access to the " "It's possible you don't have write access to the "
"settings directory."), "OK", NULL, NULL, "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
(void)alert->Go(); (void)alert->Go();
return B_ERROR; return B_ERROR;
@ -247,24 +249,25 @@ NotificationsView::_Populate(AppUsage* usage)
for (int32 i = 0; i < size; i++) { for (int32 i = 0; i < size; i++) {
NotificationReceived* notification = usage->NotificationAt(i); NotificationReceived* notification = usage->NotificationAt(i);
time_t updated = notification->LastReceived(); time_t updated = notification->LastReceived();
const char* allow = notification->Allowed() ? _T("Yes") : _T("No"); const char* allow = notification->Allowed() ? B_TRANSLATE("Yes")
: B_TRANSLATE("No");
const char* type = ""; const char* type = "";
switch (notification->Type()) { switch (notification->Type()) {
case B_INFORMATION_NOTIFICATION: case B_INFORMATION_NOTIFICATION:
type = _T("Information"); type = B_TRANSLATE("Information");
break; break;
case B_IMPORTANT_NOTIFICATION: case B_IMPORTANT_NOTIFICATION:
type = _T("Important"); type = B_TRANSLATE("Important");
break; break;
case B_ERROR_NOTIFICATION: case B_ERROR_NOTIFICATION:
type = _T("Error"); type = B_TRANSLATE("Error");
break; break;
case B_PROGRESS_NOTIFICATION: case B_PROGRESS_NOTIFICATION:
type = _T("Progress"); type = B_TRANSLATE("Progress");
break; break;
default: default:
type = _T("Unknown"); type = B_TRANSLATE("Unknown");
} }
BRow* row = new BRow(); BRow* row = new BRow();

View File

@ -7,6 +7,7 @@
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
*/ */
#include <Catalog.h>
#include <Message.h> #include <Message.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
@ -20,7 +21,10 @@
#include "DisplayView.h" #include "DisplayView.h"
#include "NotificationsView.h" #include "NotificationsView.h"
#define _T(str) (str)
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "PrefletView"
const int32 kPageSelected = '_LCH'; const int32 kPageSelected = '_LCH';
@ -32,9 +36,9 @@ PrefletView::PrefletView(SettingsHost* host)
// Page selector // Page selector
fRule = new BIconRule("icon_rule"); fRule = new BIconRule("icon_rule");
fRule->SetSelectionMessage(new BMessage(kPageSelected)); fRule->SetSelectionMessage(new BMessage(kPageSelected));
fRule->AddIcon(_T("General"), NULL); fRule->AddIcon(B_TRANSLATE("General"), NULL);
fRule->AddIcon(_T("Display"), NULL); fRule->AddIcon(B_TRANSLATE("Display"), NULL);
//fRule->AddIcon(_T("Notifications"), NULL); //fRule->AddIcon(B_TRANSLATE("Notifications"), NULL);
// View for card layout // View for card layout
fPagesView = new BView("pages", B_WILL_DRAW); fPagesView = new BView("pages", B_WILL_DRAW);

View File

@ -11,11 +11,15 @@
#include <GroupLayout.h> #include <GroupLayout.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
#include <Button.h> #include <Button.h>
#include <Catalog.h>
#include "PrefletWin.h" #include "PrefletWin.h"
#include "PrefletView.h" #include "PrefletView.h"
#define _T(str) (str)
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "PrefletWin"
const int32 kRevert = '_RVT'; const int32 kRevert = '_RVT';
const int32 kSave = '_SAV'; const int32 kSave = '_SAV';
@ -23,16 +27,18 @@ const int32 kSave = '_SAV';
PrefletWin::PrefletWin() PrefletWin::PrefletWin()
: :
BWindow(BRect(0, 0, 1, 1), "Notifications", B_TITLED_WINDOW, B_NOT_ZOOMABLE BWindow(BRect(0, 0, 1, 1), B_TRANSLATE("Notifications"), B_TITLED_WINDOW,
| B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS) B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_AUTO_UPDATE_SIZE_LIMITS)
{ {
// Preflet container view // Preflet container view
fMainView = new PrefletView(this); fMainView = new PrefletView(this);
// Save and revert buttons // Save and revert buttons
fRevert = new BButton("revert", _T("Revert"), new BMessage(kRevert)); fRevert = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(kRevert));
fRevert->SetEnabled(false); fRevert->SetEnabled(false);
fSave = new BButton("save", _T("Save"), new BMessage(kSave)); fSave = new BButton("save", B_TRANSLATE("Save"), new BMessage(kSave));
fSave->SetEnabled(false); fSave->SetEnabled(false);
// Calculate inset // Calculate inset