summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lootdialog.cpp18
-rw-r--r--src/lootdialog.h3
2 files changed, 18 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);
diff --git a/src/lootdialog.h b/src/lootdialog.h
index fcdeb304..bc8c01fb 100644
--- a/src/lootdialog.h
+++ b/src/lootdialog.h
@@ -3,6 +3,7 @@
#include <lootcli/lootcli.h>
#include <log.h>
+#include <expanderwidget.h>
namespace Ui { class LootDialog; }
@@ -53,11 +54,13 @@ public:
void cancel();
void openReport();
+ int exec() override;
void accept() override;
void reject() override;
private:
std::unique_ptr<Ui::LootDialog> ui;
+ MOBase::ExpanderWidget m_expander;
OrganizerCore& m_core;
Loot& m_loot;
bool m_finished;