changeset 337:a3b2cba73143

* Add time display format preference
author Chris Cannam
date Fri, 25 Sep 2009 12:02:22 +0000
parents 193e0d6eb6de
children 33ae130b951f
files main/PreferencesDialog.cpp main/PreferencesDialog.h
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/PreferencesDialog.cpp	Fri Sep 25 10:22:36 2009 +0000
+++ b/main/PreferencesDialog.cpp	Fri Sep 25 12:02:22 2009 +0000
@@ -214,6 +214,18 @@
     connect(fontSize, SIGNAL(valueChanged(int)),
             this, SLOT(viewFontSizeChanged(int)));
 
+    QComboBox *ttMode = new QComboBox;
+    int tt = prefs->getPropertyRangeAndValue("Time To Text Mode", &min, &max,
+                                             &deflt);
+    m_timeToTextMode = tt;
+    for (i = min; i <= max; ++i) {
+        ttMode->addItem(prefs->getPropertyValueLabel("Time To Text Mode", i));
+    }
+    ttMode->setCurrentIndex(tt);
+
+    connect(ttMode, SIGNAL(currentIndexChanged(int)),
+            this, SLOT(timeToTextModeChanged(int)));
+
     // General tab
 
     QFrame *frame = new QFrame;
@@ -272,6 +284,11 @@
     subgrid->addWidget(fontSize, row++, 1, 1, 2);
 
     subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
+                                                ("Time To Text Mode"))),
+                       row, 0);
+    subgrid->addWidget(ttMode, row++, 1, 1, 2);
+
+    subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
                                                 ("Show Splash Screen"))),
                        row, 0);
     subgrid->addWidget(showSplash, row++, 1, 1, 1);
@@ -427,6 +444,13 @@
 }
 
 void
+PreferencesDialog::timeToTextModeChanged(int mode)
+{
+    m_timeToTextMode = mode;
+    m_applyButton->setEnabled(true);
+}
+
+void
 PreferencesDialog::viewFontSizeChanged(int sz)
 {
     m_viewFontSize = sz;
@@ -457,6 +481,7 @@
     prefs->setShowSplash(m_showSplash);
     prefs->setTemporaryDirectoryRoot(m_tempDirRoot);
     prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode));
+    prefs->setTimeToTextMode(Preferences::TimeToTextMode(m_timeToTextMode));
     prefs->setViewFontSize(m_viewFontSize);
     
     std::vector<QString> devices =
--- a/main/PreferencesDialog.h	Fri Sep 25 10:22:36 2009 +0000
+++ b/main/PreferencesDialog.h	Fri Sep 25 12:02:22 2009 +0000
@@ -46,6 +46,7 @@
     void resampleOnLoadChanged(int state);
     void tempDirRootChanged(QString root);
     void backgroundModeChanged(int mode);
+    void timeToTextModeChanged(int mode);
     void viewFontSizeChanged(int sz);
     void showSplashChanged(int state);
 
@@ -71,6 +72,7 @@
     bool m_resampleOnLoad;
     QString m_tempDirRoot;
     int m_backgroundMode;
+    int m_timeToTextMode;
     int m_viewFontSize;
     bool m_showSplash;