# HG changeset patch # User Chris Cannam # Date 1253880142 0 # Node ID a3b2cba73143fca0e4ef26154698d32cf34cf10b # Parent 193e0d6eb6de22a9f88ae8b2d0e04fd9a17931b1 * Add time display format preference diff -r 193e0d6eb6de -r a3b2cba73143 main/PreferencesDialog.cpp --- 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 devices = diff -r 193e0d6eb6de -r a3b2cba73143 main/PreferencesDialog.h --- 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;