comparison main/main.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 e8a7a935128e
children a47d7116aedf
comparison
equal deleted inserted replaced
236:198915eac073 237:99fa3387dfef
232 232
233 QPixmap pixmap(":/icons/sv-splash.png"); 233 QPixmap pixmap(":/icons/sv-splash.png");
234 QSplashScreen splash(pixmap); 234 QSplashScreen splash(pixmap);
235 235
236 QSettings settings; 236 QSettings settings;
237 settings.beginGroup("MainWindow"); 237
238 238 settings.beginGroup("Preferences");
239 if (settings.value("showsplash", true).toBool()) { 239 if (settings.value("show-splash", true).toBool()) {
240 splash.show(); 240 splash.show();
241 application.processEvents(); 241 application.processEvents();
242 } 242 }
243 settings.endGroup();
243 244
244 QIcon icon; 245 QIcon icon;
245 int sizes[] = { 16, 22, 24, 32, 48, 64, 128 }; 246 int sizes[] = { 16, 22, 24, 32, 48, 64, 128 };
246 for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) { 247 for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) {
247 icon.addFile(QString(":icons/sv-%1x%2.png").arg(sizes[i]).arg(sizes[i])); 248 icon.addFile(QString(":icons/sv-%1x%2.png").arg(sizes[i]).arg(sizes[i]));
287 int width = available.width() * 2 / 3; 288 int width = available.width() * 2 / 3;
288 int height = available.height() / 2; 289 int height = available.height() / 2;
289 if (height < 450) height = available.height() * 2 / 3; 290 if (height < 450) height = available.height() * 2 / 3;
290 if (width > height * 2) width = height * 2; 291 if (width > height * 2) width = height * 2;
291 292
293 settings.beginGroup("MainWindow");
292 QSize size = settings.value("size", QSize(width, height)).toSize(); 294 QSize size = settings.value("size", QSize(width, height)).toSize();
293 gui->resize(size); 295 gui->resize(size);
294 if (settings.contains("position")) { 296 if (settings.contains("position")) {
295 gui->move(settings.value("position").toPoint()); 297 gui->move(settings.value("position").toPoint());
296 } 298 }