From 5a3577317d34fc8f3368b51a6ab11c98dff8b5d8 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 13 Mar 2021 11:23:20 +0100 Subject: [PATCH] show messagebox if settings cannot be edited --- src/singletons/WindowManager.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index ac7fc9e5f..c4f7cf191 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -11,6 +11,7 @@ #include #include +#include #include "Application.hpp" #include "common/Args.hpp" #include "common/QLogging.hpp" @@ -54,9 +55,18 @@ using SplitDirection = SplitContainer::Direction; void WindowManager::showSettingsDialog(QWidget *parent, SettingsDialogPreference preference) { - QTimer::singleShot(80, [parent, preference] { - SettingsDialog::showDialog(parent, preference); - }); + if (getArgs().dontSaveSettings) + { + QMessageBox::critical(parent, "Chatterino - Editing Settings Forbidden", + "Settings cannot be edited when running with " + "commandline arguments such as '-c'."); + } + else + { + QTimer::singleShot(80, [parent, preference] { + SettingsDialog::showDialog(parent, preference); + }); + } } void WindowManager::showAccountSelectPopup(QPoint point)