summaryrefslogtreecommitdiff
path: root/src/settingsdialogplugins.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-11-11 22:45:33 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2020-11-11 22:45:33 +0100
commit90beed8c7b356ef58431721ffe8eb4abff3da032 (patch)
treedae08a323a54f9a53d05e6d3d50cbe40fd094da1 /src/settingsdialogplugins.cpp
parent7ec0128eb59c085cd5961995280238cc22683b8e (diff)
Handle proxy dependencies differently.
Diffstat (limited to 'src/settingsdialogplugins.cpp')
-rw-r--r--src/settingsdialogplugins.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/settingsdialogplugins.cpp b/src/settingsdialogplugins.cpp
index 15c0b424..e9d36c57 100644
--- a/src/settingsdialogplugins.cpp
+++ b/src/settingsdialogplugins.cpp
@@ -225,6 +225,8 @@ void PluginsSettingsTab::on_checkboxEnabled_clicked(bool checked)
else {
// Custom check for proxy + current game:
if (m_pluginContainer->implementInterface<IPluginProxy>(plugin)) {
+
+ // Current game:
auto* game = m_pluginContainer->managedGame();
if (m_pluginContainer->requirements(game).proxy() == plugin) {
QMessageBox::warning(
@@ -233,6 +235,25 @@ void PluginsSettingsTab::on_checkboxEnabled_clicked(bool checked)
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 this plugin will prevent the following plugins from working correctly:</p><ul>%1</ul>"
+ "<p>Do you want to continue? You will need to restart ModOrganizer2 for the change to take effect.</p>")
+ .arg("<li>" + pluginNames.join("</li><li>") + "</li>");
+ if (QMessageBox::warning(
+ parentWidget(), QObject::tr("Really disable plugin?"), message,
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
+ ui->enabledCheckbox->setChecked(true);
+ return;
+ }
+
}
// Check if the plugins is required for other plugins:
@@ -256,6 +277,11 @@ void PluginsSettingsTab::on_checkboxEnabled_clicked(bool checked)
m_pluginContainer->setEnabled(plugin, false, true);
}
+ // Proxy was disabled / enabled, need restart:
+ if (m_pluginContainer->implementInterface<IPluginProxy>(plugin)) {
+ dialog().setExitNeeded(Exit::Restart);
+ }
+
updateListItems();
}