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:
commit
697c709f99
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user