diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-25 03:34:51 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-25 03:34:51 -0500 |
| commit | f1b621d0babd33537cde97fc9d53e0dfa0ad5ea5 (patch) | |
| tree | f30bc74456e5b65f5298d9891d95caef9054148e /src/lootdialog.cpp | |
| parent | bd191f3a71fbdcb706de9db5c29d615bfa13c174 (diff) | |
save/restore state for loot dialog
Diffstat (limited to 'src/lootdialog.cpp')
| -rw-r--r-- | src/lootdialog.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lootdialog.cpp b/src/lootdialog.cpp index a8f73cdc..9e269fef 100644 --- a/src/lootdialog.cpp +++ b/src/lootdialog.cpp @@ -3,7 +3,6 @@ #include "loot.h" #include "organizercore.h" #include <utility.h> -#include <expanderwidget.h> #include <QWebChannel> using namespace MOBase; @@ -151,6 +150,20 @@ void LootDialog::openReport() shell::Open(path); } +int LootDialog::exec() +{ + auto& s = m_core.settings(); + + GeometrySaver gs(s, this); + s.geometry().restoreState(&m_expander); + + const auto r = QDialog::exec(); + + s.geometry().saveState(&m_expander); + + return r; +} + void LootDialog::accept() { // no-op @@ -193,11 +206,10 @@ void LootDialog::createUI() log::error("can't open '{}', {}", path, f.errorString()); } + m_expander.set(ui->details, ui->detailsPanel); ui->openJsonReport->setEnabled(false); connect(ui->openJsonReport, &QPushButton::clicked, [&]{ openReport(); }); - new ExpanderWidget(ui->details, ui->detailsPanel); - ui->buttons->setStandardButtons(QDialogButtonBox::Cancel); resize(650, 450); |
