Author: leavengood Date: 2011-06-06 01:55:41 +0200 (Mon, 06 Jun 2011) New Revision: 41949 Changeset: https://dev.haiku-os.org/changeset/41949 Ticket: https://dev.haiku-os.org/ticket/7642 Modified: haiku/trunk/src/preferences/time/DateTimeView.cpp haiku/trunk/src/preferences/time/Jamfile haiku/trunk/src/preferences/time/NetworkTimeView.cpp haiku/trunk/src/preferences/time/ZoneView.cpp Log: Apply patches from Humdinger and mt (with some overlap) which adds localization to the Network time tab and makes the layout use more standard spacing. Also changed the name of the Synchronize button after a sync to Synchronize again. Fixes #7642. Modified: haiku/trunk/src/preferences/time/DateTimeView.cpp =================================================================== --- haiku/trunk/src/preferences/time/DateTimeView.cpp 2011-06-05 23:53:04 UTC (rev 41948) +++ haiku/trunk/src/preferences/time/DateTimeView.cpp 2011-06-05 23:55:41 UTC (rev 41949) @@ -19,6 +19,7 @@ #include <CalendarView.h> #include <Catalog.h> #include <CheckBox.h> +#include <ControlLook.h> #include <DateTime.h> #include <Entry.h> #include <File.h> @@ -240,22 +241,23 @@ B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER); divider->SetExplicitMaxSize(BSize(1, B_SIZE_UNLIMITED)); + const float kInset = be_control_look->DefaultItemSpacing(); BLayoutBuilder::Group<>(this) - .AddGroup(B_VERTICAL, 5) + .AddGroup(B_VERTICAL, kInset / 2) .Add(fDateEdit) .Add(fCalendarView) .End() .Add(divider) - .AddGroup(B_VERTICAL, 5) + .AddGroup(B_VERTICAL, 0) .Add(fTimeEdit) .Add(fClock) .Add(text) - .AddGroup(B_HORIZONTAL, 5) + .AddGroup(B_HORIZONTAL, kInset) .Add(fLocalTime) .Add(fGmtTime) .End() .End() - .SetInsets(5, 5, 5, 5); + .SetInsets(kInset, kInset, kInset, kInset); } Modified: haiku/trunk/src/preferences/time/Jamfile =================================================================== --- haiku/trunk/src/preferences/time/Jamfile 2011-06-05 23:53:04 UTC (rev 41948) +++ haiku/trunk/src/preferences/time/Jamfile 2011-06-05 23:55:41 UTC (rev 41949) @@ -38,6 +38,7 @@ x-vnd.Haiku-Time : DateTimeView.cpp + NetworkTimeView.cpp Time.cpp TimeWindow.cpp ZoneView.cpp Modified: haiku/trunk/src/preferences/time/NetworkTimeView.cpp =================================================================== --- haiku/trunk/src/preferences/time/NetworkTimeView.cpp 2011-06-05 23:53:04 UTC (rev 41948) +++ haiku/trunk/src/preferences/time/NetworkTimeView.cpp 2011-06-05 23:55:41 UTC (rev 41949) @@ -14,7 +14,9 @@ #include <Alert.h> #include <Button.h> +#include <Catalog.h> #include <CheckBox.h> +#include <ControlLook.h> #include <File.h> #include <FindDirectory.h> #include <ListView.h> @@ -26,6 +28,9 @@ #include "TimeMessages.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "Time" + Settings::Settings() : fMessage(kMsgNetworkTimeSettings) @@ -391,10 +396,11 @@ { fServerTextControl = new BTextControl(NULL, NULL, NULL); - fAddButton = new BButton("add", "Add", new BMessage(kMsgAddServer)); - fRemoveButton = new BButton("remove", "Remove", + fAddButton = new BButton("add", B_TRANSLATE("Add"), + new BMessage(kMsgAddServer)); + fRemoveButton = new BButton("remove", B_TRANSLATE("Remove"), new BMessage(kMsgRemoveServer)); - fResetButton = new BButton("reset", "Reset", + fResetButton = new BButton("reset", B_TRANSLATE("Reset"), new BMessage(kMsgResetServerList)); fServerListView = new BListView("serverList"); @@ -405,24 +411,25 @@ _UpdateServerList(); fTryAllServersCheckBox = new BCheckBox("tryAllServers", - "Try all servers", new BMessage(kMsgTryAllServers)); + B_TRANSLATE("Try all servers"), new BMessage(kMsgTryAllServers)); fTryAllServersCheckBox->SetValue(fSettings.GetTryAllServers()); fSynchronizeAtBootCheckBox = new BCheckBox("autoUpdate", - "Synchronize at boot", new BMessage(kMsgSynchronizeAtBoot)); + B_TRANSLATE("Synchronize at boot"), new BMessage(kMsgSynchronizeAtBoot)); fSynchronizeAtBootCheckBox->SetValue(fSettings.GetSynchronizeAtBoot()); - fSynchronizeButton = new BButton("update", "Synchronize now", + fSynchronizeButton = new BButton("update", B_TRANSLATE("Synchronize now"), new BMessage(kMsgSynchronize)); fSynchronizeButton->SetExplicitAlignment( BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); + const float kInset = be_control_look->DefaultItemSpacing(); BLayoutBuilder::Group<>(this) .AddGroup(B_HORIZONTAL) .AddGroup(B_VERTICAL, 0) .Add(fServerTextControl) .Add(scrollView) .End() - .AddGroup(B_VERTICAL) + .AddGroup(B_VERTICAL, kInset / 2) .Add(fAddButton) .Add(fRemoveButton) .Add(fResetButton) @@ -430,13 +437,13 @@ .End() .End() .AddGroup(B_HORIZONTAL) - .AddGroup(B_VERTICAL) + .AddGroup(B_VERTICAL, 0) .Add(fTryAllServersCheckBox) .Add(fSynchronizeAtBootCheckBox) .End() .Add(fSynchronizeButton) .End() - .SetInsets(5, 5, 5, 5); + .SetInsets(kInset, kInset, kInset, kInset); } @@ -460,7 +467,7 @@ NetworkTimeView::_DoneSynchronizing() { fUpdateThread = -1; - fSynchronizeButton->SetLabel("Synchronize"); + fSynchronizeButton->SetLabel(B_TRANSLATE("Synchronize again")); fSynchronizeButton->Message()->what = kMsgSynchronize; } Modified: haiku/trunk/src/preferences/time/ZoneView.cpp =================================================================== --- haiku/trunk/src/preferences/time/ZoneView.cpp 2011-06-05 23:53:04 UTC (rev 41948) +++ haiku/trunk/src/preferences/time/ZoneView.cpp 2011-06-05 23:55:41 UTC (rev 41949) @@ -24,6 +24,7 @@ #include <Button.h> #include <Catalog.h> #include <Collator.h> +#include <ControlLook.h> #include <Country.h> #include <Directory.h> #include <Entry.h> @@ -248,15 +249,16 @@ fSetZone->SetExplicitAlignment( BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); + const float kInset = be_control_look->DefaultItemSpacing(); BLayoutBuilder::Group<>(this) .Add(scrollList) - .AddGroup(B_VERTICAL, 5) + .AddGroup(B_VERTICAL, kInset) .Add(fCurrent) .Add(fPreview) .AddGlue() .Add(fSetZone) .End() - .SetInsets(5, 5, 5, 5); + .SetInsets(kInset, kInset, kInset, kInset); }