1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 21:01:45 -05:00

Merge pull request #946 from srcejon/fix_89

Save and restore main window position and size
This commit is contained in:
Edouard Griffiths 2021-07-01 21:58:23 +02:00 committed by GitHub
commit 697c709f99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,6 +269,11 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
delete splash;
// Restore window size and position
QSettings s;
restoreGeometry(qUncompress(QByteArray::fromBase64(s.value("mainWindowGeometry").toByteArray())));
restoreState(qUncompress(QByteArray::fromBase64(s.value("mainWindowState").toByteArray())));
qDebug() << "MainWindow::MainWindow: end";
}
@ -850,6 +855,11 @@ void MainWindow::closeEvent(QCloseEvent *closeEvent)
{
qDebug("MainWindow::closeEvent");
// Save window size and position
QSettings s;
s.setValue("mainWindowGeometry", qCompress(saveGeometry()).toBase64());
s.setValue("mainWindowState", qCompress(saveState()).toBase64());
savePresetSettings(m_mainCore->m_settings.getWorkingPreset(), 0);
saveFeatureSetPresetSettings(m_mainCore->m_settings.getWorkingFeatureSetPreset(), 0);
m_mainCore->m_settings.save();