# HG changeset patch # User Chris Cannam # Date 1202307309 0 # Node ID 99fa3387dfef9b497c21ef7201e189f3118cc7c9 # Parent 198915eac0737d7b61ff1f228f97b123b47a8463 * Update remaining editable layers to support proper realignment on copy/paste * Permit pasting when no suitable layer is current: create a new layer on paste * Add preference for showing the splash screen or not * Rename spectrogram smoothing prefs (partly following Craig's suggestions) diff -r 198915eac073 -r 99fa3387dfef main/PreferencesDialog.cpp --- a/main/PreferencesDialog.cpp Wed Feb 06 12:49:49 2008 +0000 +++ b/main/PreferencesDialog.cpp Wed Feb 06 14:15:09 2008 +0000 @@ -145,6 +145,14 @@ this, SLOT(tempDirButtonClicked())); tempDirButton->setFixedSize(QSize(24, 24)); + QCheckBox *showSplash = new QCheckBox; + m_showSplash = prefs->getShowSplash(); + showSplash->setCheckState(m_showSplash ? Qt::Checked : Qt::Unchecked); + connect(showSplash, SIGNAL(stateChanged(int)), + this, SLOT(showSplashChanged(int))); + +#ifndef Q_WS_MAC + QComboBox *bgMode = new QComboBox; int bg = prefs->getPropertyRangeAndValue("Background Mode", &min, &max, &deflt); @@ -156,6 +164,7 @@ connect(bgMode, SIGNAL(currentIndexChanged(int)), this, SLOT(backgroundModeChanged(int))); +#endif QSpinBox *fontSize = new QSpinBox; int fs = prefs->getPropertyRangeAndValue("View Font Size", &min, &max, @@ -195,6 +204,18 @@ subgrid->addWidget(fontSize, 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); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("Temporary Directory Root"))), + row, 0); + subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1); + subgrid->addWidget(tempDirButton, row, 2, 1, 1); + row++; + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel ("Resample On Load"))), row, 0); subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); @@ -204,13 +225,6 @@ row, 0); subgrid->addWidget(resampleQuality, row++, 1, 1, 2); - subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel - ("Temporary Directory Root"))), - row, 0); - subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1); - subgrid->addWidget(tempDirButton, row, 2, 1, 1); - row++; - subgrid->setRowStretch(row, 10); tab->addTab(frame, tr("&General")); @@ -307,6 +321,14 @@ } void +PreferencesDialog::showSplashChanged(int state) +{ + m_showSplash = (state == Qt::Checked); + m_applyButton->setEnabled(true); + m_changesOnRestart = true; +} + +void PreferencesDialog::tempDirRootChanged(QString r) { m_tempDirRoot = r; @@ -359,6 +381,7 @@ prefs->setTuningFrequency(m_tuningFrequency); prefs->setResampleQuality(m_resampleQuality); prefs->setResampleOnLoad(m_resampleOnLoad); + prefs->setShowSplash(m_showSplash); prefs->setTemporaryDirectoryRoot(m_tempDirRoot); prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); prefs->setViewFontSize(m_viewFontSize); diff -r 198915eac073 -r 99fa3387dfef main/PreferencesDialog.h --- a/main/PreferencesDialog.h Wed Feb 06 12:49:49 2008 +0000 +++ b/main/PreferencesDialog.h Wed Feb 06 14:15:09 2008 +0000 @@ -45,6 +45,7 @@ void tempDirRootChanged(QString root); void backgroundModeChanged(int mode); void viewFontSizeChanged(int sz); + void showSplashChanged(int state); void tempDirButtonClicked(); @@ -67,6 +68,7 @@ QString m_tempDirRoot; int m_backgroundMode; int m_viewFontSize; + bool m_showSplash; bool m_changesOnRestart; }; diff -r 198915eac073 -r 99fa3387dfef main/main.cpp --- a/main/main.cpp Wed Feb 06 12:49:49 2008 +0000 +++ b/main/main.cpp Wed Feb 06 14:15:09 2008 +0000 @@ -234,12 +234,13 @@ QSplashScreen splash(pixmap); QSettings settings; - settings.beginGroup("MainWindow"); - - if (settings.value("showsplash", true).toBool()) { + + settings.beginGroup("Preferences"); + if (settings.value("show-splash", true).toBool()) { splash.show(); application.processEvents(); } + settings.endGroup(); QIcon icon; int sizes[] = { 16, 22, 24, 32, 48, 64, 128 }; @@ -289,6 +290,7 @@ if (height < 450) height = available.height() * 2 / 3; if (width > height * 2) width = height * 2; + settings.beginGroup("MainWindow"); QSize size = settings.value("size", QSize(width, height)).toSize(); gui->resize(size); if (settings.contains("position")) {