Mercurial > hg > sonic-visualiser
comparison 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 |
comparison
equal
deleted
inserted
replaced
336:193e0d6eb6de | 337:a3b2cba73143 |
---|---|
212 fontSize->setValue(fs); | 212 fontSize->setValue(fs); |
213 | 213 |
214 connect(fontSize, SIGNAL(valueChanged(int)), | 214 connect(fontSize, SIGNAL(valueChanged(int)), |
215 this, SLOT(viewFontSizeChanged(int))); | 215 this, SLOT(viewFontSizeChanged(int))); |
216 | 216 |
217 QComboBox *ttMode = new QComboBox; | |
218 int tt = prefs->getPropertyRangeAndValue("Time To Text Mode", &min, &max, | |
219 &deflt); | |
220 m_timeToTextMode = tt; | |
221 for (i = min; i <= max; ++i) { | |
222 ttMode->addItem(prefs->getPropertyValueLabel("Time To Text Mode", i)); | |
223 } | |
224 ttMode->setCurrentIndex(tt); | |
225 | |
226 connect(ttMode, SIGNAL(currentIndexChanged(int)), | |
227 this, SLOT(timeToTextModeChanged(int))); | |
228 | |
217 // General tab | 229 // General tab |
218 | 230 |
219 QFrame *frame = new QFrame; | 231 QFrame *frame = new QFrame; |
220 | 232 |
221 QGridLayout *subgrid = new QGridLayout; | 233 QGridLayout *subgrid = new QGridLayout; |
268 | 280 |
269 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 281 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
270 ("View Font Size"))), | 282 ("View Font Size"))), |
271 row, 0); | 283 row, 0); |
272 subgrid->addWidget(fontSize, row++, 1, 1, 2); | 284 subgrid->addWidget(fontSize, row++, 1, 1, 2); |
285 | |
286 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | |
287 ("Time To Text Mode"))), | |
288 row, 0); | |
289 subgrid->addWidget(ttMode, row++, 1, 1, 2); | |
273 | 290 |
274 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 291 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
275 ("Show Splash Screen"))), | 292 ("Show Splash Screen"))), |
276 row, 0); | 293 row, 0); |
277 subgrid->addWidget(showSplash, row++, 1, 1, 1); | 294 subgrid->addWidget(showSplash, row++, 1, 1, 1); |
422 PreferencesDialog::backgroundModeChanged(int mode) | 439 PreferencesDialog::backgroundModeChanged(int mode) |
423 { | 440 { |
424 m_backgroundMode = mode; | 441 m_backgroundMode = mode; |
425 m_applyButton->setEnabled(true); | 442 m_applyButton->setEnabled(true); |
426 m_changesOnRestart = true; | 443 m_changesOnRestart = true; |
444 } | |
445 | |
446 void | |
447 PreferencesDialog::timeToTextModeChanged(int mode) | |
448 { | |
449 m_timeToTextMode = mode; | |
450 m_applyButton->setEnabled(true); | |
427 } | 451 } |
428 | 452 |
429 void | 453 void |
430 PreferencesDialog::viewFontSizeChanged(int sz) | 454 PreferencesDialog::viewFontSizeChanged(int sz) |
431 { | 455 { |
455 prefs->setResampleQuality(m_resampleQuality); | 479 prefs->setResampleQuality(m_resampleQuality); |
456 prefs->setResampleOnLoad(m_resampleOnLoad); | 480 prefs->setResampleOnLoad(m_resampleOnLoad); |
457 prefs->setShowSplash(m_showSplash); | 481 prefs->setShowSplash(m_showSplash); |
458 prefs->setTemporaryDirectoryRoot(m_tempDirRoot); | 482 prefs->setTemporaryDirectoryRoot(m_tempDirRoot); |
459 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); | 483 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); |
484 prefs->setTimeToTextMode(Preferences::TimeToTextMode(m_timeToTextMode)); | |
460 prefs->setViewFontSize(m_viewFontSize); | 485 prefs->setViewFontSize(m_viewFontSize); |
461 | 486 |
462 std::vector<QString> devices = | 487 std::vector<QString> devices = |
463 AudioTargetFactory::getInstance()->getCallbackTargetNames(); | 488 AudioTargetFactory::getInstance()->getCallbackTargetNames(); |
464 | 489 |