Mercurial > hg > sonic-visualiser
diff main/PreferencesDialog.cpp @ 337:a3b2cba73143
* Add time display format preference
author | Chris Cannam |
---|---|
date | Fri, 25 Sep 2009 12:02:22 +0000 |
parents | 15ce557e1bf8 |
children | ae68fc09bf16 6d827453657f |
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 =