changeset 906:fbd2534d17f8

Add option to toggle H:M:S time display (when off, just show seconds even when more than 60)
author Chris Cannam
date Wed, 18 Feb 2015 12:08:17 +0000
parents 26528b83d2ff
children d0b89689f2b4
files .hgsubstate main/PreferencesDialog.cpp main/PreferencesDialog.h
diffstat 3 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Fri Feb 13 13:30:37 2015 +0000
+++ b/.hgsubstate	Wed Feb 18 12:08:17 2015 +0000
@@ -1,5 +1,5 @@
 d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay
 879bdc878826bebec67130326f99397c430419b1 sv-dependency-builds
 7b2dd0d4c366057ce25547a4015f3a76981abedc svapp
-920699b6989df6a8ca846f1dd88a73fb8010e894 svcore
+344c9ea901812553a087da7fecbf5d3596257fa4 svcore
 78e041e45ff0ff3c103e0d794c6f66f391020aff svgui
--- a/main/PreferencesDialog.cpp	Fri Feb 13 13:30:37 2015 +0000
+++ b/main/PreferencesDialog.cpp	Wed Feb 18 12:08:17 2015 +0000
@@ -292,6 +292,14 @@
     connect(ttMode, SIGNAL(currentIndexChanged(int)),
             this, SLOT(timeToTextModeChanged(int)));
 
+    QCheckBox *hms = new QCheckBox;
+    int showHMS = prefs->getPropertyRangeAndValue
+        ("Show Hours And Minutes", &min, &max, &deflt);
+    m_showHMS = (showHMS != 0);
+    hms->setCheckState(m_showHMS ? Qt::Checked : Qt::Unchecked);
+    connect(hms, SIGNAL(stateChanged(int)),
+            this, SLOT(showHMSChanged(int)));
+    
     // General tab
 
     QFrame *frame = new QFrame;
@@ -342,6 +350,11 @@
     row = 0;
 
     subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
+                                                ("Show Splash Screen"))),
+                       row, 0);
+    subgrid->addWidget(showSplash, row++, 1, 1, 1);
+
+    subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
                                                 ("Property Box Layout"))),
                        row, 0);
     subgrid->addWidget(propertyLayout, row++, 1, 1, 2);
@@ -364,9 +377,9 @@
     subgrid->addWidget(ttMode, row++, 1, 1, 2);
 
     subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
-                                                ("Show Splash Screen"))),
+                                                ("Show Hours And Minutes"))),
                        row, 0);
-    subgrid->addWidget(showSplash, row++, 1, 1, 1);
+    subgrid->addWidget(hms, row++, 1, 1, 1);
 
     subgrid->setRowStretch(row, 10);
     
@@ -609,6 +622,13 @@
 }
 
 void
+PreferencesDialog::showHMSChanged(int state)
+{
+    m_showHMS = (state == Qt::Checked);
+    m_applyButton->setEnabled(true);
+}
+
+void
 PreferencesDialog::octaveSystemChanged(int system)
 {
     m_octaveSystem = system;
@@ -647,6 +667,7 @@
     prefs->setTemporaryDirectoryRoot(m_tempDirRoot);
     prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode));
     prefs->setTimeToTextMode(Preferences::TimeToTextMode(m_timeToTextMode));
+    prefs->setShowHMS(m_showHMS);
     prefs->setViewFontSize(m_viewFontSize);
     
     prefs->setProperty("Octave Numbering System", m_octaveSystem);
--- a/main/PreferencesDialog.h	Fri Feb 13 13:30:37 2015 +0000
+++ b/main/PreferencesDialog.h	Wed Feb 18 12:08:17 2015 +0000
@@ -57,6 +57,7 @@
     void tempDirRootChanged(QString root);
     void backgroundModeChanged(int mode);
     void timeToTextModeChanged(int mode);
+    void showHMSChanged(int state);
     void octaveSystemChanged(int system);
     void viewFontSizeChanged(int sz);
     void showSplashChanged(int state);
@@ -97,6 +98,7 @@
     QString m_tempDirRoot;
     int m_backgroundMode;
     int m_timeToTextMode;
+    bool m_showHMS;
     int m_octaveSystem;
     int m_viewFontSize;
     bool m_showSplash;