diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-09-30 13:47:17 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-09-30 20:17:31 (GMT) |
commit | 0fe2ee3d4393177a4850a3da3e9b0df89239f294 (patch) | |
tree | 21c4d5255319c70c1572dd36a264564158f118b6 /Source/QtDialog/CMakeSetupDialog.cxx | |
parent | 391ff1ec518bea4bbaac95b6a3737b82c65656d3 (diff) | |
download | CMake-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.cxx | 18 |
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); |