Remove time zone clock option and Time preferences button.

* Nobody thought time zone was a particularly useful option to have
  in the clock.
* You can still open Time preferences from Deskbar by right clicking
  on the clock, but, since there isn't a big connection between
  the clock settings in Deskbar and Time preferences anymore
  this button isn't needed here.
* There are still 2 clock options, Show seconds, and Show day of week
  and day of week is localized as well so this wasn't a total wash.
This commit is contained in:
John Scipione
2012-04-17 23:38:12 -04:00
parent 41651bb3fd
commit f5be13ecc7
8 changed files with 6 additions and 78 deletions
-6
View File
@@ -207,7 +207,6 @@ TBarApp::SaveSettings()
storedSettings.AddBool("showTime", fSettings.showTime); storedSettings.AddBool("showTime", fSettings.showTime);
storedSettings.AddBool("showSeconds", fSettings.showSeconds); storedSettings.AddBool("showSeconds", fSettings.showSeconds);
storedSettings.AddBool("showDayOfWeek", fSettings.showDayOfWeek); storedSettings.AddBool("showDayOfWeek", fSettings.showDayOfWeek);
storedSettings.AddBool("showTimeZone", fSettings.showTimeZone);
storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc); storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount); storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount);
@@ -248,7 +247,6 @@ TBarApp::InitSettings()
settings.showTime = true; settings.showTime = true;
settings.showSeconds = false; settings.showSeconds = false;
settings.showDayOfWeek = false; settings.showDayOfWeek = false;
settings.showTimeZone = false;
settings.state = kExpandoState; settings.state = kExpandoState;
settings.width = 0; settings.width = 0;
settings.switcherLoc = BPoint(5000, 5000); settings.switcherLoc = BPoint(5000, 5000);
@@ -315,10 +313,6 @@ TBarApp::InitSettings()
!= B_OK) { != B_OK) {
settings.showDayOfWeek = false; settings.showDayOfWeek = false;
} }
if (storedSettings.FindBool("showTimeZone", &settings.showTimeZone)
!= B_OK) {
settings.showTimeZone = false;
}
if (storedSettings.FindPoint("switcherLoc", &settings.switcherLoc) if (storedSettings.FindPoint("switcherLoc", &settings.switcherLoc)
!= B_OK) { != B_OK) {
settings.switcherLoc = BPoint(5000, 5000); settings.switcherLoc = BPoint(5000, 5000);
-1
View File
@@ -78,7 +78,6 @@ struct desk_settings {
bool showTime; bool showTime;
bool showSeconds; bool showSeconds;
bool showDayOfWeek; bool showDayOfWeek;
bool showTimeZone;
uint32 state; uint32 state;
float width; float width;
BPoint switcherLoc; BPoint switcherLoc;
-1
View File
@@ -401,7 +401,6 @@ TDeskbarMenu::ResetTargets()
case kShowHideTime: case kShowHideTime:
case kShowSeconds: case kShowSeconds:
case kShowDayOfWeek: case kShowDayOfWeek:
case kShowTimeZone:
item->SetTarget(fBarView->fReplicantTray); item->SetTarget(fBarView->fReplicantTray);
break; break;
} }
+2 -18
View File
@@ -90,8 +90,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
new BMessage(kShowSeconds)); new BMessage(kShowSeconds));
fShowDayOfWeek = new BCheckBox(B_TRANSLATE("Show day of week"), fShowDayOfWeek = new BCheckBox(B_TRANSLATE("Show day of week"),
new BMessage(kShowDayOfWeek)); new BMessage(kShowDayOfWeek));
fShowTimeZone = new BCheckBox(B_TRANSLATE("Show time zone"),
new BMessage(kShowTimeZone));
// Get settings from BarApp // Get settings from BarApp
TBarApp* barApp = static_cast<TBarApp*>(be_app); TBarApp* barApp = static_cast<TBarApp*>(be_app);
@@ -157,11 +155,9 @@ PreferencesWindow::PreferencesWindow(BRect frame)
if (replicantTray->Time() != NULL) { if (replicantTray->Time() != NULL) {
fShowSeconds->SetValue(replicantTray->Time()->ShowSeconds()); fShowSeconds->SetValue(replicantTray->Time()->ShowSeconds());
fShowDayOfWeek->SetValue(replicantTray->Time()->ShowDayOfWeek()); fShowDayOfWeek->SetValue(replicantTray->Time()->ShowDayOfWeek());
fShowTimeZone->SetValue(replicantTray->Time()->ShowTimeZone());
} else { } else {
fShowSeconds->SetValue(settings->showSeconds); fShowSeconds->SetValue(settings->showSeconds);
fShowDayOfWeek->SetValue(settings->showDayOfWeek); fShowDayOfWeek->SetValue(settings->showDayOfWeek);
fShowTimeZone->SetValue(settings->showTimeZone);
} }
EnableDisableDependentItems(); EnableDisableDependentItems();
@@ -179,7 +175,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
fShowSeconds->SetTarget(replicantTray); fShowSeconds->SetTarget(replicantTray);
fShowDayOfWeek->SetTarget(replicantTray); fShowDayOfWeek->SetTarget(replicantTray);
fShowTimeZone->SetTarget(replicantTray);
// Layout // Layout
fMenuBox = new BBox("fMenuBox"); fMenuBox = new BBox("fMenuBox");
@@ -253,14 +248,8 @@ PreferencesWindow::PreferencesWindow(BRect frame)
view = BLayoutBuilder::Group<>() view = BLayoutBuilder::Group<>()
.AddGroup(B_VERTICAL, 0) .AddGroup(B_VERTICAL, 0)
.AddGroup(B_VERTICAL, 0) .Add(fShowSeconds)
.SetInsets(0, 0, 0, B_USE_DEFAULT_SPACING) .Add(fShowDayOfWeek)
.Add(fShowSeconds)
.Add(fShowDayOfWeek)
.Add(fShowTimeZone)
.End()
.Add(new BButton(B_TRANSLATE("Time preferences" B_UTF8_ELLIPSIS),
new BMessage(kTimePreferences)))
.AddGlue() .AddGlue()
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
@@ -311,11 +300,6 @@ PreferencesWindow::MessageReceived(BMessage* message)
EnableDisableDependentItems(); EnableDisableDependentItems();
break; break;
case kTimePreferences:
// launch the time prefs app
be_roster->Launch("application/x-vnd.Haiku-Time");
break;
default: default:
BWindow::MessageReceived(message); BWindow::MessageReceived(message);
break; break;
-3
View File
@@ -26,8 +26,6 @@ const uint32 kAutoHide = 'AtHd';
const uint32 kShowHideTime = 'ShTm'; const uint32 kShowHideTime = 'ShTm';
const uint32 kShowSeconds = 'SwSc'; const uint32 kShowSeconds = 'SwSc';
const uint32 kShowDayOfWeek = 'SwDw'; const uint32 kShowDayOfWeek = 'SwDw';
const uint32 kShowTimeZone = 'SwTz';
const uint32 kTimePreferences = 'TmPr';
class BBox; class BBox;
class BButton; class BButton;
@@ -76,7 +74,6 @@ private:
BCheckBox* fShowSeconds; BCheckBox* fShowSeconds;
BCheckBox* fShowDayOfWeek; BCheckBox* fShowDayOfWeek;
BCheckBox* fShowTimeZone;
}; };
+1 -15
View File
@@ -150,8 +150,7 @@ TReplicantTray::TReplicantTray(TBarView* parent, bool vertical)
// Create the time view // Create the time view
fTime = new TTimeView(fMinimumTrayWidth, kMaxReplicantHeight - 1.0, fTime = new TTimeView(fMinimumTrayWidth, kMaxReplicantHeight - 1.0,
use24HourClock, settings->showSeconds, settings->showDayOfWeek, use24HourClock, settings->showSeconds, settings->showDayOfWeek);
settings->showTimeZone);
} }
@@ -319,17 +318,6 @@ TReplicantTray::MessageReceived(BMessage* message)
AdjustPlacement(); AdjustPlacement();
break; break;
case kShowTimeZone:
if (fTime == NULL)
return;
fTime->SetShowTimeZone(!fTime->ShowTimeZone());
// time string reformat -> realign
RealignReplicants();
AdjustPlacement();
break;
#ifdef DB_ADDONS #ifdef DB_ADDONS
case B_NODE_MONITOR: case B_NODE_MONITOR:
HandleEntryUpdate(message); HandleEntryUpdate(message);
@@ -1252,7 +1240,6 @@ TReplicantTray::SaveTimeSettings()
settings->showTime = !fTime->IsHidden(); settings->showTime = !fTime->IsHidden();
settings->showSeconds = fTime->ShowSeconds(); settings->showSeconds = fTime->ShowSeconds();
settings->showDayOfWeek = fTime->ShowDayOfWeek(); settings->showDayOfWeek = fTime->ShowDayOfWeek();
settings->showTimeZone = fTime->ShowTimeZone();
} }
@@ -1599,4 +1586,3 @@ TDragRegion::SetDragRegionLocation(int32 location)
fDragLocation = location; fDragLocation = location;
Invalidate(); Invalidate();
} }
+2 -29
View File
@@ -68,7 +68,7 @@ enum {
TTimeView::TTimeView(float maxWidth, float height, bool use24HourClock, TTimeView::TTimeView(float maxWidth, float height, bool use24HourClock,
bool showSeconds, bool showDayOfWeek, bool showTimeZone) bool showSeconds, bool showDayOfWeek)
: :
BView(BRect(-100, -100, -90, -90), "_deskbar_tv_", BView(BRect(-100, -100, -90, -90), "_deskbar_tv_",
B_FOLLOW_RIGHT | B_FOLLOW_TOP, B_FOLLOW_RIGHT | B_FOLLOW_TOP,
@@ -79,8 +79,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool use24HourClock,
fOrientation(true), fOrientation(true),
fUse24HourClock(use24HourClock), fUse24HourClock(use24HourClock),
fShowSeconds(showSeconds), fShowSeconds(showSeconds),
fShowDayOfWeek(showDayOfWeek), fShowDayOfWeek(showDayOfWeek)
fShowTimeZone(showTimeZone)
{ {
fCurrentTime = fLastTime = time(NULL); fCurrentTime = fLastTime = time(NULL);
fSeconds = fMinute = fHour = 0; fSeconds = fMinute = fHour = 0;
@@ -354,21 +353,6 @@ TTimeView::SetShowDayOfWeek(bool show)
} }
bool
TTimeView::ShowTimeZone() const
{
return fShowTimeZone;
}
void
TTimeView::SetShowTimeZone(bool show)
{
fShowTimeZone = show;
Update();
}
void void
TTimeView::ShowCalendar(BPoint where) TTimeView::ShowCalendar(BPoint where)
{ {
@@ -433,14 +417,6 @@ TTimeView::CalculateTextPlacement()
BFont font; BFont font;
GetFont(&font); GetFont(&font);
// If 12 hour clock with all options turned on shrink font size to fit.
if (!fUse24HourClock && fShowSeconds && fShowDayOfWeek && fShowTimeZone)
font.SetSize(11.0);
else
font.SetSize(12.0);
SetFont(&font, B_FONT_SIZE);
const char* stringArray[1]; const char* stringArray[1];
stringArray[0] = fCurrentTimeStr; stringArray[0] = fCurrentTimeStr;
BRect rectArray[1]; BRect rectArray[1];
@@ -517,8 +493,5 @@ TTimeView::UpdateTimeFormat()
if (!fUse24HourClock) if (!fUse24HourClock)
timeFormat.Append(" a"); timeFormat.Append(" a");
if (fShowTimeZone)
timeFormat.Append(" V");
fTimeFormat = timeFormat; fTimeFormat = timeFormat;
} }
+1 -5
View File
@@ -55,7 +55,7 @@ class TTimeView : public BView {
public: public:
TTimeView(float maxWidth, float height, TTimeView(float maxWidth, float height,
bool use24HourClock, bool showSeconds, bool use24HourClock, bool showSeconds,
bool showDayOfWeek, bool showTimeZone); bool showDayOfWeek);
TTimeView(BMessage* data); TTimeView(BMessage* data);
~TTimeView(); ~TTimeView();
@@ -86,9 +86,6 @@ public:
bool ShowDayOfWeek() const; bool ShowDayOfWeek() const;
void SetShowDayOfWeek(bool show); void SetShowDayOfWeek(bool show);
bool ShowTimeZone() const;
void SetShowTimeZone(bool show);
void ShowCalendar(BPoint where); void ShowCalendar(BPoint where);
private: private:
@@ -123,7 +120,6 @@ private:
bool fUse24HourClock; bool fUse24HourClock;
bool fShowSeconds; bool fShowSeconds;
bool fShowDayOfWeek; bool fShowDayOfWeek;
bool fShowTimeZone;
BString fTimeFormat; BString fTimeFormat;
BPoint fTimeLocation; BPoint fTimeLocation;