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
+8
View File
@@ -38,6 +38,9 @@ Args::Args(const QApplication &app)
"Attaches to the Console on windows, "
"allowing you to see debug output."});
crashRecoveryOption.setFlags(QCommandLineOption::HiddenFromHelp);
QCommandLineOption safeModeOption(
"safe-mode", "Starts Chatterino without loading Plugins and always "
"show the settings button.");
parser.addOptions({
{{"V", "version"}, "Displays version information."},
@@ -45,6 +48,7 @@ Args::Args(const QApplication &app)
parentWindowOption,
parentWindowIdOption,
verboseOption,
safeModeOption,
});
parser.addOption(QCommandLineOption(
{"c", "channels"},
@@ -89,6 +93,10 @@ Args::Args(const QApplication &app)
this->parentWindowId = parser.value(parentWindowIdOption).toULongLong();
}
if (parser.isSet(safeModeOption))
{
this->safeMode = true;
}
}
void Args::applyCustomChannelLayout(const QString &argValue)
+1
View File
@@ -26,6 +26,7 @@ public:
bool dontLoadMainWindow{};
std::optional<WindowLayout> customChannelLayout;
bool verbose{};
bool safeMode{};
private:
void applyCustomChannelLayout(const QString &argValue);