diff options
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); |