diff options
author | Sky <git@bunnies.cc> | 2014-01-02 02:20:34 +0000 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2014-01-02 02:20:34 +0000 |
commit | eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4 (patch) | |
tree | 2befb9245b098a6b6368786791d4d51a10b61a64 /gui/dialogs/SettingsDialog.cpp | |
parent | 7f89da20439090cee0cd3090be582e263e25d6a1 (diff) | |
download | MultiMC-eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4.tar MultiMC-eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4.tar.gz MultiMC-eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4.tar.lz MultiMC-eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4.tar.xz MultiMC-eb4e7d3f6771d5c5fb6d70557c8013f745e72ca4.zip |
Save/restore settings dialog (and instance specific settings) window geometry
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r-- | gui/dialogs/SettingsDialog.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 569c8f63..9362075e 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -44,6 +44,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Se ui->jsonEditorTextBox->setClearButtonEnabled(true); #endif + restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("SettingsGeometry").toByteArray())); + loadSettings(MMC->settings().get()); updateCheckboxStuff(); } @@ -55,7 +57,13 @@ SettingsDialog::~SettingsDialog() void SettingsDialog::showEvent(QShowEvent *ev) { QDialog::showEvent(ev); - adjustSize(); +} + +void SettingsDialog::closeEvent(QCloseEvent *ev) +{ + MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); + + QDialog::closeEvent(ev); } void SettingsDialog::updateCheckboxStuff() @@ -180,6 +188,13 @@ void SettingsDialog::on_maximizedCheckBox_clicked(bool checked) void SettingsDialog::on_buttonBox_accepted() { applySettings(MMC->settings().get()); + + MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); +} + +void SettingsDialog::on_buttonBox_rejected() +{ + MMC->settings()->set("SettingsGeometry", saveGeometry().toBase64()); } void SettingsDialog::applySettings(SettingsObject *s) |