feat: add --safe-mode command line option (#4985)

This ensures the settings button isn't hidden, and disables plugins from being loaded to make sure the user can always recover from messing things up
This commit is contained in:
Mm2PL
2023-12-05 18:37:42 +01:00
committed by GitHub
parent 44abe6b487
commit c3d3903b6f
7 changed files with 58 additions and 9 deletions
+14
View File
@@ -2,6 +2,7 @@
# include "widgets/settingspages/PluginsPage.hpp"
# include "Application.hpp"
# include "common/Args.hpp"
# include "controllers/plugins/PluginController.hpp"
# include "singletons/Paths.hpp"
# include "singletons/Settings.hpp"
@@ -52,6 +53,15 @@ PluginsPage::PluginsPage()
this->rebuildContent();
});
groupLayout->addRow(box);
if (getArgs().safeMode)
{
box->setEnabled(false);
auto *disabledLabel = new QLabel(this);
disabledLabel->setText("Plugins will not be fully loaded because "
"Chatterino is in safe mode. You can still "
"enable and disable them.");
groupLayout->addRow(disabledLabel);
}
}
this->rebuildContent();
@@ -177,6 +187,10 @@ void PluginsPage::rebuildContent()
this->rebuildContent();
});
pluginEntry->addRow(reloadButton);
if (getArgs().safeMode)
{
reloadButton->setEnabled(false);
}
}
}