summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-07-25 23:18:47 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-03 11:39:05 -0500
commitb1e681e129d87cb2f8aab89a734ab7b185975bcd (patch)
tree14d2e1cc78f3093a2fcc0394f7b9b97a21f40e3e /src/mainwindow.cpp
parent8987693dcf7dc116361869f128fd443716511f0c (diff)
hide tutorial question option
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp30
1 files changed, 25 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 {