summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp30
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/settings.cpp11
-rw-r--r--src/settings.h3
4 files changed, 40 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c2d83e36..60ad77a0 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1334,6 +1334,30 @@ void MainWindow::hookUpWindowTutorials()
}
}
+bool MainWindow::shouldStartTutorial() const
+{
+ if (GlobalSettings::hideTutorialQuestion()) {
+ return false;
+ }
+
+ QMessageBox dlg(
+ QMessageBox::Question, tr("Show tutorial?"),
+ tr("You are starting Mod Organizer for the first time. "
+ "Do you want to show a tutorial of its basic features? If you choose "
+ "no you can always start the tutorial from the \"Help\"-menu."),
+ QMessageBox::Yes | QMessageBox::No);
+
+ dlg.setCheckBox(new QCheckBox(tr("Never ask to show tutorials")));
+
+ const auto r = dlg.exec();
+
+ if (dlg.checkBox()->isChecked()) {
+ GlobalSettings::setHideTutorialQuestion(true);
+ }
+
+ return (r == QMessageBox::Yes);
+}
+
void MainWindow::showEvent(QShowEvent *event)
{
QMainWindow::showEvent(event);
@@ -1360,11 +1384,7 @@ void MainWindow::showEvent(QShowEvent *event)
if (m_OrganizerCore.settings().firstStart()) {
QString firstStepsTutorial = ToQString(AppConfig::firstStepsTutorial());
if (TutorialManager::instance().hasTutorial(firstStepsTutorial)) {
- if (QMessageBox::question(this, tr("Show tutorial?"),
- tr("You are starting Mod Organizer for the first time. "
- "Do you want to show a tutorial of its basic features? If you choose "
- "no you can always start the tutorial from the \"Help\"-menu."),
- QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ if (shouldStartTutorial()) {
TutorialManager::instance().activateTutorial("MainWindow", firstStepsTutorial);
}
} else {
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 814e0363..8b2188c8 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -506,6 +506,7 @@ private slots:
void hideSaveGameInfo();
void hookUpWindowTutorials();
+ bool shouldStartTutorial() const;
void resumeDownload(int downloadIndex);
void endorseMod(ModInfo::Ptr mod);
diff --git a/src/settings.cpp b/src/settings.cpp
index 4ee4cd81..a0758bd4 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2212,7 +2212,18 @@ void GlobalSettings::setHideCreateInstanceIntro(bool b)
settings().setValue("HideCreateInstanceIntro", b);
}
+bool GlobalSettings::hideTutorialQuestion()
+{
+ return settings().value("HideTutorialQuestion", false).toBool();
+}
+
+void GlobalSettings::setHideTutorialQuestion(bool b)
+{
+ settings().setValue("HideTutorialQuestion", b);
+}
+
void GlobalSettings::resetDialogs()
{
setHideCreateInstanceIntro(false);
+ setHideTutorialQuestion(false);
}
diff --git a/src/settings.h b/src/settings.h
index dd8abf3f..a9501b9d 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -841,6 +841,9 @@ public:
static bool hideCreateInstanceIntro();
static void setHideCreateInstanceIntro(bool b);
+ static bool hideTutorialQuestion();
+ static void setHideTutorialQuestion(bool b);
+
// resets anything that the user can disable
static void resetDialogs();