summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-30 13:47:17 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-30 20:17:31 (GMT)
commit0fe2ee3d4393177a4850a3da3e9b0df89239f294 (patch)
tree21c4d5255319c70c1572dd36a264564158f118b6 /Source/QtDialog/CMakeSetupDialog.cxx
parent391ff1ec518bea4bbaac95b6a3737b82c65656d3 (diff)
downloadCMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.zip
CMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.tar.gz
CMake-0fe2ee3d4393177a4850a3da3e9b0df89239f294.tar.bz2
CMake GUI: Add "CMake Reference Manual" help item
And switch the ordering of "Help" and "About".
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index a904b94..df22028 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -181,11 +181,25 @@ CMakeSetupDialog::CMakeSetupDialog()
&QCMakeCacheView::collapseAll);
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
- a = HelpMenu->addAction(tr("About"));
- QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
a = HelpMenu->addAction(tr("Help"));
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);
+ });
+ a = HelpMenu->addAction(tr("About"));
+ QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
this->setAcceptDrops(true);