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.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41949 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2011-06-05 23:55:41 +00:00
parent 6eabc83386
commit 365839fb2d
4 changed files with 28 additions and 16 deletions

View File

@ -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 @@ DateTimeView::_InitView()
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);
}

View File

@ -38,6 +38,7 @@ DoCatalogs Time :
x-vnd.Haiku-Time
:
DateTimeView.cpp
NetworkTimeView.cpp
Time.cpp
TimeWindow.cpp
ZoneView.cpp

View File

@ -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 @@ NetworkTimeView::_InitView()
{
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 @@ NetworkTimeView::_InitView()
_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 @@ NetworkTimeView::_InitView()
.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 @@ void
NetworkTimeView::_DoneSynchronizing()
{
fUpdateThread = -1;
fSynchronizeButton->SetLabel("Synchronize");
fSynchronizeButton->SetLabel(B_TRANSLATE("Synchronize again"));
fSynchronizeButton->Message()->what = kMsgSynchronize;
}

View File

@ -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 @@ TimeZoneView::_InitView()
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);
}