summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-23 16:47:56 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-27 16:05:41 (GMT)
commitef03124237a1bbbb47b71faaecbaac174839d1e4 (patch)
tree3ba05bce6682366a4d8409676095fb3bc6006d44 /Source/QtDialog/CMakeSetupDialog.cxx
parent8d6a0b9364581fbb95746c93cac4ec3c213f534b (diff)
downloadCMake-ef03124237a1bbbb47b71faaecbaac174839d1e4.zip
CMake-ef03124237a1bbbb47b71faaecbaac174839d1e4.tar.gz
CMake-ef03124237a1bbbb47b71faaecbaac174839d1e4.tar.bz2
CMake GUI: Add --browse-manual argument
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index a15614d..05518a9 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -43,6 +43,21 @@
#include "RegexExplorer.h"
#include "WarningMessagesDialog.h"
+void OpenReferenceManual()
+{
+ QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
+ QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
+ QString::number(cmVersion::GetMinorVersion())));
+
+ if (!cmSystemTools::GetHTMLDoc().empty()) {
+ url = QUrl::fromLocalFile(
+ QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
+ .filePath("index.html"));
+ }
+
+ QDesktopServices::openUrl(url);
+}
+
namespace {
const QString PRESETS_DISABLED_TOOLTIP =
"This option is disabled because there are no available presets in "
@@ -194,19 +209,7 @@ CMakeSetupDialog::CMakeSetupDialog()
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doHelp);
a->setShortcut(QKeySequence::HelpContents);
a = HelpMenu->addAction(tr("CMake Reference Manual"));
- QObject::connect(a, &QAction::triggered, this, []() {
- QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
- QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
- QString::number(cmVersion::GetMinorVersion())));
-
- if (!cmSystemTools::GetHTMLDoc().empty()) {
- url = QUrl::fromLocalFile(
- QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
- .filePath("index.html"));
- }
-
- QDesktopServices::openUrl(url);
- });
+ QObject::connect(a, &QAction::triggered, this, OpenReferenceManual);
a = HelpMenu->addAction(tr("About"));
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);