From ca6f9990c691a5d20e2b8d97ad98e4ad80c13a9e Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 17 Dec 2019 06:32:08 -0500 Subject: added text in when running loot stop indeterminate progress bar on errors add errors and warnings to report --- src/lootdialog.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/lootdialog.cpp') diff --git a/src/lootdialog.cpp b/src/lootdialog.cpp index ae3b1164..5ac65907 100644 --- a/src/lootdialog.cpp +++ b/src/lootdialog.cpp @@ -212,6 +212,8 @@ void LootDialog::createUI() ui->buttons->setStandardButtons(QDialogButtonBox::Cancel); + m_report.setText(tr("Running LOOT...")); + resize(650, 450); } @@ -243,9 +245,15 @@ void LootDialog::onFinished() close(); } else { log::debug("loot dialog: showing report"); + showReport(); + ui->openJsonReport->setEnabled(true); ui->buttons->setStandardButtons(QDialogButtonBox::Close); + + // if loot failed, the Done progress won't be received; this makes sure + // the progress bar is stopped + setProgress(lootcli::Progress::Done); } } @@ -262,16 +270,14 @@ void LootDialog::log(log::Levels lv, const QString& s) void LootDialog::showReport() { - if (m_loot.result()) { - const auto& lootReport = m_loot.report(); + const auto& lootReport = m_loot.report(); + if (m_loot.result()) { m_core.pluginList()->clearAdditionalInformation(); for (auto&& p : lootReport.plugins) { m_core.pluginList()->addLootReport(p.name, p); } - - m_report.setText(lootReport.toMarkdown()); - } else { - m_report.setText("**" + tr("Loot failed to run") + "**"); } + + m_report.setText(lootReport.toMarkdown()); } -- cgit v1.3.1