# HG changeset patch # User Chris Cannam # Date 1154619611 0 # Node ID 0a687ed1b50f8d7ea49eb266d493a17a89f9872d # Parent a8b4a6efefff185617f2b7898d2ff4fd96959171 * 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 diff -r a8b4a6efefff -r 0a687ed1b50f main/MainWindow.cpp --- a/main/MainWindow.cpp Wed Aug 02 16:42:17 2006 +0000 +++ b/main/MainWindow.cpp Thu Aug 03 15:40:11 2006 +0000 @@ -74,6 +74,7 @@ #include #include #include +#include #include #include @@ -2115,6 +2116,12 @@ return; } + QSettings settings; + settings.beginGroup("MainWindow"); + settings.setValue("size", size()); + settings.setValue("position", pos()); + settings.endGroup(); + e->accept(); return; } diff -r a8b4a6efefff -r 0a687ed1b50f main/main.cpp --- 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 #include #include +#include #include #include @@ -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; }