From f010c22a3b2ec31bc4ebc3f577ac4455c5de5dfb Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 6 Nov 2013 18:35:27 +0100 Subject: - diagnosis plugins can now request to be re-evaluated - main application now contains means for plugins to react on some changes (to be extended) - plugins can now retrieve more information about a mod - user-agent sent to nexus now automatically contains the current MO version - included updated russian translation - problems dialog now refreshes itself after a fix was applied - fixed new esp/asset ordering diagnosis. May be fully functional now - bugfix: restoring locked load order could leave MO in an endless loop (not sure if this fix is correct yet) - bugfix: plugin list was not visually updated after some changes - bugfix: nmm importer threw away mod ordering --- src/problemsdialog.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src/problemsdialog.cpp') diff --git a/src/problemsdialog.cpp b/src/problemsdialog.cpp index d5700381..edb34f39 100644 --- a/src/problemsdialog.cpp +++ b/src/problemsdialog.cpp @@ -10,11 +10,26 @@ using namespace MOBase; ProblemsDialog::ProblemsDialog(std::vector diagnosePlugins, QWidget *parent) - : QDialog(parent), ui(new Ui::ProblemsDialog) + : QDialog(parent), ui(new Ui::ProblemsDialog), m_DiagnosePlugins(diagnosePlugins) { ui->setupUi(this); - foreach (IPluginDiagnose *diagnose, diagnosePlugins) { + runDiagnosis(); + + connect(ui->problemsWidget, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(ui->descriptionText, SIGNAL(anchorClicked(QUrl)), this, SLOT(urlClicked(QUrl))); +} + + +ProblemsDialog::~ProblemsDialog() +{ + delete ui; +} + +void ProblemsDialog::runDiagnosis() +{ + ui->problemsWidget->clear(); + foreach (IPluginDiagnose *diagnose, m_DiagnosePlugins) { std::vector activeProblems = diagnose->activeProblems(); foreach (unsigned int key, activeProblems) { QTreeWidgetItem *newItem = new QTreeWidgetItem(); @@ -26,7 +41,7 @@ ProblemsDialog::ProblemsDialog(std::vector diagnosePl ui->problemsWidget->addTopLevelItem(newItem); if (diagnose->hasGuidedFix(key)) { - newItem->setText(1, tr("fix")); + newItem->setText(1, tr("Fix")); QPushButton *fixButton = new QPushButton(tr("Fix")); connect(fixButton, SIGNAL(clicked()), this, SLOT(startFix())); ui->problemsWidget->setItemWidget(newItem, 1, fixButton); @@ -35,17 +50,8 @@ ProblemsDialog::ProblemsDialog(std::vector diagnosePl } } } - connect(ui->problemsWidget, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); - connect(ui->descriptionText, SIGNAL(anchorClicked(QUrl)), this, SLOT(urlClicked(QUrl))); -} - - -ProblemsDialog::~ProblemsDialog() -{ - delete ui; } - bool ProblemsDialog::hasProblems() const { return ui->problemsWidget->topLevelItemCount() != 0; @@ -62,6 +68,7 @@ void ProblemsDialog::startFix() { IPluginDiagnose *plugin = reinterpret_cast(ui->problemsWidget->currentItem()->data(1, Qt::UserRole).value()); plugin->startGuidedFix(ui->problemsWidget->currentItem()->data(1, Qt::UserRole + 1).toUInt()); + runDiagnosis(); } void ProblemsDialog::urlClicked(const QUrl &url) -- cgit v1.3.1