comparison main/PreferencesDialog.cpp @ 237:99fa3387dfef

* 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)
author Chris Cannam
date Wed, 06 Feb 2008 14:15:09 +0000
parents e3ff897a60bf
children cf8748822f4d
comparison
equal deleted inserted replaced
236:198915eac073 237:99fa3387dfef
143 tempDirButton->setIcon(IconLoader().load("fileopen")); 143 tempDirButton->setIcon(IconLoader().load("fileopen"));
144 connect(tempDirButton, SIGNAL(clicked()), 144 connect(tempDirButton, SIGNAL(clicked()),
145 this, SLOT(tempDirButtonClicked())); 145 this, SLOT(tempDirButtonClicked()));
146 tempDirButton->setFixedSize(QSize(24, 24)); 146 tempDirButton->setFixedSize(QSize(24, 24));
147 147
148 QCheckBox *showSplash = new QCheckBox;
149 m_showSplash = prefs->getShowSplash();
150 showSplash->setCheckState(m_showSplash ? Qt::Checked : Qt::Unchecked);
151 connect(showSplash, SIGNAL(stateChanged(int)),
152 this, SLOT(showSplashChanged(int)));
153
154 #ifndef Q_WS_MAC
155
148 QComboBox *bgMode = new QComboBox; 156 QComboBox *bgMode = new QComboBox;
149 int bg = prefs->getPropertyRangeAndValue("Background Mode", &min, &max, 157 int bg = prefs->getPropertyRangeAndValue("Background Mode", &min, &max,
150 &deflt); 158 &deflt);
151 m_backgroundMode = bg; 159 m_backgroundMode = bg;
152 for (i = min; i <= max; ++i) { 160 for (i = min; i <= max; ++i) {
154 } 162 }
155 bgMode->setCurrentIndex(bg); 163 bgMode->setCurrentIndex(bg);
156 164
157 connect(bgMode, SIGNAL(currentIndexChanged(int)), 165 connect(bgMode, SIGNAL(currentIndexChanged(int)),
158 this, SLOT(backgroundModeChanged(int))); 166 this, SLOT(backgroundModeChanged(int)));
167 #endif
159 168
160 QSpinBox *fontSize = new QSpinBox; 169 QSpinBox *fontSize = new QSpinBox;
161 int fs = prefs->getPropertyRangeAndValue("View Font Size", &min, &max, 170 int fs = prefs->getPropertyRangeAndValue("View Font Size", &min, &max,
162 &deflt); 171 &deflt);
163 m_viewFontSize = fs; 172 m_viewFontSize = fs;
193 ("View Font Size"))), 202 ("View Font Size"))),
194 row, 0); 203 row, 0);
195 subgrid->addWidget(fontSize, row++, 1, 1, 2); 204 subgrid->addWidget(fontSize, row++, 1, 1, 2);
196 205
197 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel 206 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
198 ("Resample On Load"))), 207 ("Show Splash Screen"))),
199 row, 0); 208 row, 0);
200 subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); 209 subgrid->addWidget(showSplash, row++, 1, 1, 1);
201
202 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
203 ("Resample Quality"))),
204 row, 0);
205 subgrid->addWidget(resampleQuality, row++, 1, 1, 2);
206 210
207 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel 211 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
208 ("Temporary Directory Root"))), 212 ("Temporary Directory Root"))),
209 row, 0); 213 row, 0);
210 subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1); 214 subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1);
211 subgrid->addWidget(tempDirButton, row, 2, 1, 1); 215 subgrid->addWidget(tempDirButton, row, 2, 1, 1);
212 row++; 216 row++;
217
218 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
219 ("Resample On Load"))),
220 row, 0);
221 subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1);
222
223 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
224 ("Resample Quality"))),
225 row, 0);
226 subgrid->addWidget(resampleQuality, row++, 1, 1, 2);
213 227
214 subgrid->setRowStretch(row, 10); 228 subgrid->setRowStretch(row, 10);
215 229
216 tab->addTab(frame, tr("&General")); 230 tab->addTab(frame, tr("&General"));
217 231
300 314
301 void 315 void
302 PreferencesDialog::resampleOnLoadChanged(int state) 316 PreferencesDialog::resampleOnLoadChanged(int state)
303 { 317 {
304 m_resampleOnLoad = (state == Qt::Checked); 318 m_resampleOnLoad = (state == Qt::Checked);
319 m_applyButton->setEnabled(true);
320 m_changesOnRestart = true;
321 }
322
323 void
324 PreferencesDialog::showSplashChanged(int state)
325 {
326 m_showSplash = (state == Qt::Checked);
305 m_applyButton->setEnabled(true); 327 m_applyButton->setEnabled(true);
306 m_changesOnRestart = true; 328 m_changesOnRestart = true;
307 } 329 }
308 330
309 void 331 void
357 prefs->setPropertyBoxLayout(Preferences::PropertyBoxLayout 379 prefs->setPropertyBoxLayout(Preferences::PropertyBoxLayout
358 (m_propertyLayout)); 380 (m_propertyLayout));
359 prefs->setTuningFrequency(m_tuningFrequency); 381 prefs->setTuningFrequency(m_tuningFrequency);
360 prefs->setResampleQuality(m_resampleQuality); 382 prefs->setResampleQuality(m_resampleQuality);
361 prefs->setResampleOnLoad(m_resampleOnLoad); 383 prefs->setResampleOnLoad(m_resampleOnLoad);
384 prefs->setShowSplash(m_showSplash);
362 prefs->setTemporaryDirectoryRoot(m_tempDirRoot); 385 prefs->setTemporaryDirectoryRoot(m_tempDirRoot);
363 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); 386 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode));
364 prefs->setViewFontSize(m_viewFontSize); 387 prefs->setViewFontSize(m_viewFontSize);
365 388
366 m_applyButton->setEnabled(false); 389 m_applyButton->setEnabled(false);