diff main/main.cpp @ 5:0a687ed1b50f

* Add Thumbwheel widget for all our zooming needs * Use QSettings to save/restore window size and position -- precursor to switching our preferences to QSettings as well -- wish I'd noticed it sooner * Only suspend writes (not reads from the underlying cache objects) from the fft caches when repainting the spectrogram -- performance should now be significantly better
author Chris Cannam
date Thu, 03 Aug 2006 15:40:11 +0000
parents 40116f709d3b
children d4487202d0e8
line wrap: on
line diff
--- a/main/main.cpp	Wed Aug 02 16:42:17 2006 +0000
+++ b/main/main.cpp	Thu Aug 03 15:40:11 2006 +0000
@@ -28,6 +28,7 @@
 #include <QMessageBox>
 #include <QTranslator>
 #include <QLocale>
+#include <QSettings>
 
 #include <iostream>
 #include <signal.h>
@@ -63,6 +64,10 @@
 
     svSystemSpecificInitialisation();
 
+    QApplication::setOrganizationName("Sonic Visualiser");
+    QApplication::setOrganizationDomain("sonicvisualiser.org");
+    QApplication::setApplicationName("Sonic Visualiser");
+
     QString language = QLocale::system().name();
 
     QTranslator qtTranslator;
@@ -91,7 +96,15 @@
     if (height < 450) height = available.height() * 2 / 3;
     if (width > height * 2) width = height * 2;
 
-    gui.resize(width, height);
+    QSettings settings;
+    settings.beginGroup("MainWindow");
+    QSize size = settings.value("size", QSize(width, height)).toSize();
+    gui.resize(size);
+    if (settings.contains("position")) {
+        gui.move(settings.value("position").toPoint());
+    }
+    settings.endGroup();
+    
     gui.show();
 
     if (argc > 1) {
@@ -115,5 +128,6 @@
     cleanupMutex.lock();
     TempDirectory::getInstance()->cleanup();
     Preferences::getInstance()->getConfigFile()->commit();
+
     return rv;
 }