From eb7f5bb5d1d40e70934d201a4e25d9b98b0d3384 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Mon, 27 Dec 2021 00:34:45 -0700 Subject: Add first start dialog and help menu entry --- src/mainwindow.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7c34c195..a7d187c2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1045,6 +1045,12 @@ void MainWindow::createHelpMenu() connect(wikiAction, SIGNAL(triggered()), this, SLOT(wikiTriggered())); menu->addAction(wikiAction); + if(!m_OrganizerCore.managedGame()->getSupportURL().isEmpty()) { + QAction *gameSupportAction = new QAction(tr("Game Support Wiki"), menu); + connect(gameSupportAction, SIGNAL(triggered()), this, SLOT(gameSupportTriggered())); + menu->addAction(gameSupportAction); + } + QAction *discordAction = new QAction(tr("Chat on Discord"), menu); connect(discordAction, SIGNAL(triggered()), this, SLOT(discordTriggered())); menu->addAction(discordAction); @@ -1149,7 +1155,7 @@ bool MainWindow::shouldStartTutorial() const 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."), + "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"))); @@ -1201,6 +1207,13 @@ void MainWindow::showEvent(QShowEvent *event) QObject::tr("Please use \"Help\" from the toolbar to get usage instructions to all elements")); } + if (!m_OrganizerCore.managedGame()->getSupportURL().isEmpty()) { + QMessageBox::information(this, tr("Game Support Wiki"), + tr("Do you know how to mod this game? Do you need to learn? There's a game support wiki available! " + "Click OK to open the wiki. In the future, you can access this link from the \"Help\" menu."), QMessageBox::Ok); + gameSupportTriggered(); + } + m_OrganizerCore.settings().setFirstStart(false); } @@ -2165,6 +2178,11 @@ void MainWindow::wikiTriggered() shell::Open(QUrl("https://modorganizer2.github.io/")); } +void MainWindow::gameSupportTriggered() +{ + shell::Open(QUrl(m_OrganizerCore.managedGame()->getSupportURL())); +} + void MainWindow::discordTriggered() { shell::Open(QUrl("https://discord.gg/6GKR9jZ")); -- cgit v1.3.1