show messagebox if settings cannot be edited

This commit is contained in:
fourtf 2021-03-13 11:23:20 +01:00
parent 8b4cbce237
commit 5a3577317d

View file

@ -11,6 +11,7 @@
#include <boost/optional.hpp>
#include <chrono>
#include <QMessageBox>
#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)
{
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)