diff options
| author | Tannin <devnull@localhost> | 2013-07-13 10:10:46 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-07-13 10:10:46 +0200 |
| commit | 8d34ae34135cfd495556a059c449a5f11ca6212c (patch) | |
| tree | 555ffc51d1e084ac148ccb4b928898ab1ed4fc62 /src/problemsdialog.cpp | |
| parent | 849a0a0ef40c9fa1feb15b880aa52fccdd84f234 (diff) | |
- some fixes to the refreshing behaviour
- "fix" buttons in problems dialog are now actually functional
- python proxy now has diagnosis functionality to warn user if correct proxy version is not available
- python proxy now has a configurable python path
Diffstat (limited to 'src/problemsdialog.cpp')
| -rw-r--r-- | src/problemsdialog.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/problemsdialog.cpp b/src/problemsdialog.cpp index 8173e1e2..d5700381 100644 --- a/src/problemsdialog.cpp +++ b/src/problemsdialog.cpp @@ -20,13 +20,19 @@ ProblemsDialog::ProblemsDialog(std::vector<MOBase::IPluginDiagnose *> diagnosePl QTreeWidgetItem *newItem = new QTreeWidgetItem();
newItem->setText(0, diagnose->shortDescription(key));
newItem->setData(0, Qt::UserRole, diagnose->fullDescription(key));
+ newItem->setData(1, Qt::UserRole, qVariantFromValue(reinterpret_cast<void*>(diagnose)));
+ newItem->setData(1, Qt::UserRole + 1, key);
+
+ ui->problemsWidget->addTopLevelItem(newItem);
if (diagnose->hasGuidedFix(key)) {
- ui->problemsWidget->setItemWidget(newItem, 1, new QPushButton(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);
} else {
newItem->setText(1, tr("No guided fix"));
}
- ui->problemsWidget->addTopLevelItem(newItem);
}
}
connect(ui->problemsWidget, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
@@ -52,6 +58,12 @@ void ProblemsDialog::selectionChanged() ui->descriptionText->setLineWrapMode(text.contains('\n') ? QTextEdit::NoWrap : QTextEdit::WidgetWidth);
}
+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());
+}
+
void ProblemsDialog::urlClicked(const QUrl &url)
{
::ShellExecuteW(NULL, L"open", ToWString(url.toString()).c_str(), NULL, NULL, SW_SHOWNORMAL);
|
