summaryrefslogtreecommitdiffstats
path: root/application/dialogs
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-09 01:54:28 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-09 01:54:28 +0200
commit8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6 (patch)
treef9a6e15dde62a503d27e5f0c2b3c424ee4a6725d /application/dialogs
parent0f311e12eea395a65f9173df90a5cc557989d2a3 (diff)
downloadMultiMC-8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6.tar
MultiMC-8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6.tar.gz
MultiMC-8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6.tar.lz
MultiMC-8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6.tar.xz
MultiMC-8fe18cfabc8c42d10e6b4345f80dfd3ea67233d6.zip
GH-1882 save UpdateDialog geometry
Diffstat (limited to 'application/dialogs')
-rw-r--r--application/dialogs/UpdateDialog.cpp7
-rw-r--r--application/dialogs/UpdateDialog.h6
2 files changed, 11 insertions, 2 deletions
diff --git a/application/dialogs/UpdateDialog.cpp b/application/dialogs/UpdateDialog.cpp
index 4bf27cf8..c935ec3b 100644
--- a/application/dialogs/UpdateDialog.cpp
+++ b/application/dialogs/UpdateDialog.cpp
@@ -23,6 +23,7 @@ UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), u
ui->btnUpdateLater->setText(tr("Close"));
}
loadChangelog();
+ restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("UpdateDialogGeometry").toByteArray()));
}
UpdateDialog::~UpdateDialog()
@@ -166,3 +167,9 @@ void UpdateDialog::on_btnUpdateNow_clicked()
{
done(UPDATE_NOW);
}
+
+void UpdateDialog::closeEvent(QCloseEvent* evt)
+{
+ MMC->settings()->set("UpdateDialogGeometry", saveGeometry().toBase64());
+ QDialog::closeEvent(evt);
+}
diff --git a/application/dialogs/UpdateDialog.h b/application/dialogs/UpdateDialog.h
index 8a9d9a2b..8099464b 100644
--- a/application/dialogs/UpdateDialog.h
+++ b/application/dialogs/UpdateDialog.h
@@ -43,8 +43,6 @@ public:
explicit UpdateDialog(bool hasUpdate = true, QWidget *parent = 0);
~UpdateDialog();
-private:
- Ui::UpdateDialog *ui;
public slots:
void on_btnUpdateNow_clicked();
void on_btnUpdateLater_clicked();
@@ -58,7 +56,11 @@ public slots:
/// Slot for when the chengelog fails to load...
void changelogFailed(QString reason);
+protected:
+ void closeEvent(QCloseEvent * ) override;
+
private:
+ Ui::UpdateDialog *ui;
QByteArray changelogData;
NetJobPtr dljob;
ChangelogType m_changelogType = CHANGELOG_MARKDOWN;