[haiku-commits] haiku: hrev44050 - src/apps/deskbar

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 18 Apr 2012 05:45:34 +0200 (CEST)

hrev44050 adds 1 changeset to branch 'master'
old head: 41651bb3fd80eeccaab6e46643085a7d0b2bd70c
new head: f5be13ecc7503a48a32b87995a78a2d0247ab401

----------------------------------------------------------------------------

f5be13e: 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.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44050
Commit:      f5be13ecc7503a48a32b87995a78a2d0247ab401
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f5be13e
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Wed Apr 18 03:38:12 2012 UTC

----------------------------------------------------------------------------

8 files changed, 6 insertions(+), 78 deletions(-)
src/apps/deskbar/BarApp.cpp            |    6 -----
src/apps/deskbar/BarApp.h              |    1 -
src/apps/deskbar/DeskbarMenu.cpp       |    1 -
src/apps/deskbar/PreferencesWindow.cpp |   20 +----------------
src/apps/deskbar/PreferencesWindow.h   |    3 --
src/apps/deskbar/StatusView.cpp        |   16 +-------------
src/apps/deskbar/TimeView.cpp          |   31 +--------------------------
src/apps/deskbar/TimeView.h            |    6 +----

----------------------------------------------------------------------------

diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index ba3e766..ae9b45c 100644
--- a/src/apps/deskbar/BarApp.cpp
+++ b/src/apps/deskbar/BarApp.cpp
@@ -207,7 +207,6 @@ TBarApp::SaveSettings()
                storedSettings.AddBool("showTime", fSettings.showTime);
                storedSettings.AddBool("showSeconds", fSettings.showSeconds);
                storedSettings.AddBool("showDayOfWeek", 
fSettings.showDayOfWeek);
-               storedSettings.AddBool("showTimeZone", fSettings.showTimeZone);
 
                storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc);
                storedSettings.AddInt32("recentAppsCount", 
fSettings.recentAppsCount);
@@ -248,7 +247,6 @@ TBarApp::InitSettings()
        settings.showTime = true;
        settings.showSeconds = false;
        settings.showDayOfWeek = false;
-       settings.showTimeZone = false;
        settings.state = kExpandoState;
        settings.width = 0;
        settings.switcherLoc = BPoint(5000, 5000);
@@ -315,10 +313,6 @@ TBarApp::InitSettings()
                                        != B_OK) {
                                settings.showDayOfWeek = false;
                        }
-                       if (storedSettings.FindBool("showTimeZone", 
&settings.showTimeZone)
-                                       != B_OK) {
-                               settings.showTimeZone = false;
-                       }
                        if (storedSettings.FindPoint("switcherLoc", 
&settings.switcherLoc)
                                        != B_OK) {
                                settings.switcherLoc = BPoint(5000, 5000);
diff --git a/src/apps/deskbar/BarApp.h b/src/apps/deskbar/BarApp.h
index 626286b..a184e32 100644
--- a/src/apps/deskbar/BarApp.h
+++ b/src/apps/deskbar/BarApp.h
@@ -78,7 +78,6 @@ struct desk_settings {
        bool showTime;
        bool showSeconds;
        bool showDayOfWeek;
-       bool showTimeZone;
        uint32 state;
        float width;
        BPoint switcherLoc;
diff --git a/src/apps/deskbar/DeskbarMenu.cpp b/src/apps/deskbar/DeskbarMenu.cpp
index 4b8c88c..e6839b7 100644
--- a/src/apps/deskbar/DeskbarMenu.cpp
+++ b/src/apps/deskbar/DeskbarMenu.cpp
@@ -401,7 +401,6 @@ TDeskbarMenu::ResetTargets()
                                case kShowHideTime:
                                case kShowSeconds:
                                case kShowDayOfWeek:
-                               case kShowTimeZone:
                                        
item->SetTarget(fBarView->fReplicantTray);
                                        break;
                        }
diff --git a/src/apps/deskbar/PreferencesWindow.cpp 
b/src/apps/deskbar/PreferencesWindow.cpp
index cf8386b..7e54c2a 100644
--- a/src/apps/deskbar/PreferencesWindow.cpp
+++ b/src/apps/deskbar/PreferencesWindow.cpp
@@ -90,8 +90,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
                new BMessage(kShowSeconds));
        fShowDayOfWeek = new BCheckBox(B_TRANSLATE("Show day of week"),
                new BMessage(kShowDayOfWeek));
-       fShowTimeZone = new BCheckBox(B_TRANSLATE("Show time zone"),
-               new BMessage(kShowTimeZone));
 
        // Get settings from BarApp
        TBarApp* barApp = static_cast<TBarApp*>(be_app);
@@ -157,11 +155,9 @@ PreferencesWindow::PreferencesWindow(BRect frame)
        if (replicantTray->Time() != NULL) {
                fShowSeconds->SetValue(replicantTray->Time()->ShowSeconds());
                
fShowDayOfWeek->SetValue(replicantTray->Time()->ShowDayOfWeek());
-               fShowTimeZone->SetValue(replicantTray->Time()->ShowTimeZone());
        } else {
                fShowSeconds->SetValue(settings->showSeconds);
                fShowDayOfWeek->SetValue(settings->showDayOfWeek);
-               fShowTimeZone->SetValue(settings->showTimeZone);
        }
 
        EnableDisableDependentItems();
@@ -179,7 +175,6 @@ PreferencesWindow::PreferencesWindow(BRect frame)
 
        fShowSeconds->SetTarget(replicantTray);
        fShowDayOfWeek->SetTarget(replicantTray);
-       fShowTimeZone->SetTarget(replicantTray);
 
        // Layout
        fMenuBox = new BBox("fMenuBox");
@@ -253,14 +248,8 @@ PreferencesWindow::PreferencesWindow(BRect frame)
 
        view = BLayoutBuilder::Group<>()
                .AddGroup(B_VERTICAL, 0)
-                       .AddGroup(B_VERTICAL, 0)
-                               .SetInsets(0, 0, 0, B_USE_DEFAULT_SPACING)
-                               .Add(fShowSeconds)
-                               .Add(fShowDayOfWeek)
-                               .Add(fShowTimeZone)
-                               .End()
-                       .Add(new BButton(B_TRANSLATE("Time preferences" 
B_UTF8_ELLIPSIS),
-                               new BMessage(kTimePreferences)))
+                       .Add(fShowSeconds)
+                       .Add(fShowDayOfWeek)
                        .AddGlue()
                        .SetInsets(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();
                        break;
 
-               case kTimePreferences:
-                       // launch the time prefs app
-                       be_roster->Launch("application/x-vnd.Haiku-Time");
-                       break;
-
                default:
                        BWindow::MessageReceived(message);
                        break;
diff --git a/src/apps/deskbar/PreferencesWindow.h 
b/src/apps/deskbar/PreferencesWindow.h
index 1d26197..d777126 100644
--- a/src/apps/deskbar/PreferencesWindow.h
+++ b/src/apps/deskbar/PreferencesWindow.h
@@ -26,8 +26,6 @@ const uint32 kAutoHide                                = 
'AtHd';
 const uint32 kShowHideTime                     = 'ShTm';
 const uint32 kShowSeconds                      = 'SwSc';
 const uint32 kShowDayOfWeek                    = 'SwDw';
-const uint32 kShowTimeZone                     = 'SwTz';
-const uint32 kTimePreferences          = 'TmPr';
 
 class BBox;
 class BButton;
@@ -76,7 +74,6 @@ private:
 
                        BCheckBox*              fShowSeconds;
                        BCheckBox*              fShowDayOfWeek;
-                       BCheckBox*              fShowTimeZone;
 };
 
 
diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp
index aad0290..3747b41 100644
--- a/src/apps/deskbar/StatusView.cpp
+++ b/src/apps/deskbar/StatusView.cpp
@@ -150,8 +150,7 @@ TReplicantTray::TReplicantTray(TBarView* parent, bool 
vertical)
 
        // Create the time view
        fTime = new TTimeView(fMinimumTrayWidth, kMaxReplicantHeight - 1.0,
-               use24HourClock, settings->showSeconds, settings->showDayOfWeek,
-               settings->showTimeZone);
+               use24HourClock, settings->showSeconds, settings->showDayOfWeek);
 }
 
 
@@ -319,17 +318,6 @@ TReplicantTray::MessageReceived(BMessage* message)
                        AdjustPlacement();
                        break;
 
-               case kShowTimeZone:
-                       if (fTime == NULL)
-                               return;
-
-                       fTime->SetShowTimeZone(!fTime->ShowTimeZone());
-
-                       // time string reformat -> realign
-                       RealignReplicants();
-                       AdjustPlacement();
-                       break;
-
 #ifdef DB_ADDONS
                case B_NODE_MONITOR:
                        HandleEntryUpdate(message);
@@ -1252,7 +1240,6 @@ TReplicantTray::SaveTimeSettings()
        settings->showTime = !fTime->IsHidden();
        settings->showSeconds = fTime->ShowSeconds();
        settings->showDayOfWeek = fTime->ShowDayOfWeek();
-       settings->showTimeZone = fTime->ShowTimeZone();
 }
 
 
@@ -1599,4 +1586,3 @@ TDragRegion::SetDragRegionLocation(int32 location)
        fDragLocation = location;
        Invalidate();
 }
-
diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp
index 6b90bda..c212aa2 100644
--- a/src/apps/deskbar/TimeView.cpp
+++ b/src/apps/deskbar/TimeView.cpp
@@ -68,7 +68,7 @@ enum {
 
 
 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_",
                B_FOLLOW_RIGHT | B_FOLLOW_TOP,
@@ -79,8 +79,7 @@ TTimeView::TTimeView(float maxWidth, float height, bool 
use24HourClock,
        fOrientation(true),
        fUse24HourClock(use24HourClock),
        fShowSeconds(showSeconds),
-       fShowDayOfWeek(showDayOfWeek),
-       fShowTimeZone(showTimeZone)
+       fShowDayOfWeek(showDayOfWeek)
 {
        fCurrentTime = fLastTime = time(NULL);
        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
 TTimeView::ShowCalendar(BPoint where)
 {
@@ -433,14 +417,6 @@ TTimeView::CalculateTextPlacement()
        BFont 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];
        stringArray[0] = fCurrentTimeStr;
        BRect rectArray[1];
@@ -517,8 +493,5 @@ TTimeView::UpdateTimeFormat()
        if (!fUse24HourClock)
                timeFormat.Append(" a");
 
-       if (fShowTimeZone)
-               timeFormat.Append(" V");
-
        fTimeFormat = timeFormat;
 }
diff --git a/src/apps/deskbar/TimeView.h b/src/apps/deskbar/TimeView.h
index fcb26f1..24c5495 100644
--- a/src/apps/deskbar/TimeView.h
+++ b/src/apps/deskbar/TimeView.h
@@ -55,7 +55,7 @@ class TTimeView : public BView {
 public:
                                                                TTimeView(float 
maxWidth, float height,
                                                                        bool 
use24HourClock, bool showSeconds,
-                                                                       bool 
showDayOfWeek, bool showTimeZone);
+                                                                       bool 
showDayOfWeek);
                                                                
TTimeView(BMessage* data);
                                                                ~TTimeView();
 
@@ -86,9 +86,6 @@ public:
                                bool                    ShowDayOfWeek() const;
                                void                    SetShowDayOfWeek(bool 
show);
 
-                               bool                    ShowTimeZone() const;
-                               void                    SetShowTimeZone(bool 
show);
-
                                void                    ShowCalendar(BPoint 
where);
 
 private:
@@ -123,7 +120,6 @@ private:
                                bool                    fUse24HourClock;
                                bool                    fShowSeconds;
                                bool                    fShowDayOfWeek;
-                               bool                    fShowTimeZone;
                                BString                 fTimeFormat;
 
                                BPoint                  fTimeLocation;


Other related posts: