diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-17 14:28:43 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-17 14:28:43 +0100 |
| commit | 8886674379c507fe46bfc6cb2ef013537567441b (patch) | |
| tree | 587603a00cafa59664a94f8f9c77d67cae04a8be /src/settingsdialogplugins.cpp | |
| parent | bed3475362f68a660d56dd31546b13e49586e36e (diff) | |
Better dialog for warning when disabling proxy plugin.
Diffstat (limited to 'src/settingsdialogplugins.cpp')
| -rw-r--r-- | src/settingsdialogplugins.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/settingsdialogplugins.cpp b/src/settingsdialogplugins.cpp index eb0035b2..4313b85e 100644 --- a/src/settingsdialogplugins.cpp +++ b/src/settingsdialogplugins.cpp @@ -3,6 +3,7 @@ #include "noeditdelegate.h" #include <iplugin.h> +#include "disableproxyplugindialog.h" #include "organizercore.h" #include "plugincontainer.h" @@ -242,29 +243,20 @@ void PluginsSettingsTab::on_checkboxEnabled_clicked(bool checked) QMessageBox::warning( parentWidget(), QObject::tr("Cannot disable plugin"), QObject::tr("The '%1' plugin is used by the current game plugin and cannot disabled.") - .arg(plugin->localizedName()), QMessageBox::Ok); - ui->enabledCheckbox->setChecked(true); - return; + .arg(plugin->localizedName()), QMessageBox::Ok); + ui->enabledCheckbox->setChecked(true); + return; } // Check the proxied plugins: auto proxied = requirements.proxied(); - QStringList pluginNames; - for (auto& p : proxied) { - pluginNames.append(p->localizedName()); - } - pluginNames.sort(); - QString message = QObject::tr( - "<p>Disabling the '%1' plugin will prevent the following plugins from working:</p><ul>%1</ul>" - "<p>Do you want to continue? You will need to restart ModOrganizer2 for the change to take effect.</p>") - .arg(plugin->localizedName()).arg("<li>" + pluginNames.join("</li><li>") + "</li>"); - if (QMessageBox::critical( - parentWidget(), QObject::tr("Really disable plugin?"), message, - QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { - ui->enabledCheckbox->setChecked(true); - return; + if (!proxied.empty()) { + DisableProxyPluginDialog dialog(plugin, proxied, parentWidget()); + if (dialog.exec() != QDialog::Accepted) { + ui->enabledCheckbox->setChecked(true); + return; + } } - } // Check if the plugins is required for other plugins: |
