diff options
| author | Tannin <devnull@localhost> | 2013-11-06 18:35:27 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-11-06 18:35:27 +0100 |
| commit | f010c22a3b2ec31bc4ebc3f577ac4455c5de5dfb (patch) | |
| tree | ca37c8e7480b449289c091dd040bc3f782a52dd0 /src/problemsdialog.cpp | |
| parent | d1594798e6e78bb329e744a72e92d3f292f38a20 (diff) | |
- 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
Diffstat (limited to 'src/problemsdialog.cpp')
| -rw-r--r-- | src/problemsdialog.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
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<MOBase::IPluginDiagnose *> 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<unsigned int> activeProblems = diagnose->activeProblems();
foreach (unsigned int key, activeProblems) {
QTreeWidgetItem *newItem = new QTreeWidgetItem();
@@ -26,7 +41,7 @@ ProblemsDialog::ProblemsDialog(std::vector<MOBase::IPluginDiagnose *> 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<MOBase::IPluginDiagnose *> 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<IPluginDiagnose*>(ui->problemsWidget->currentItem()->data(1, Qt::UserRole).value<void*>());
plugin->startGuidedFix(ui->problemsWidget->currentItem()->data(1, Qt::UserRole + 1).toUInt());
+ runDiagnosis();
}
void ProblemsDialog::urlClicked(const QUrl &url)
|
