From 76205b0de61f75e03a5a2dd7da581cda872da6d9 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Thu, 15 Sep 2016 03:02:56 +0000 Subject: [PATCH] Add new action in help menu for launch the Manual online with browser by default git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4707 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetmainwindow.cpp | 10 ++++++++++ sources/qetmainwindow.h | 1 + 2 files changed, 11 insertions(+) diff --git a/sources/qetmainwindow.cpp b/sources/qetmainwindow.cpp index 1e470f8e8..ada9fc46d 100644 --- a/sources/qetmainwindow.cpp +++ b/sources/qetmainwindow.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "qetmainwindow.h" #include "qeticons.h" @@ -72,6 +73,14 @@ void QETMainWindow::initCommonActions() { about_qet_ -> setStatusTip(tr("Affiche des informations sur QElectroTech", "status bar tip")); connect(about_qet_, SIGNAL(triggered()), qet_app, SLOT(aboutQET())); + manual_online_ = new QAction(QET::Icons::QETLogo, tr("Manuel QElectroTech en ligne"), this); + manual_online_ -> setStatusTip(tr("Lance le navigateur par defaut vers le manuel en ligne de QElectroTech", "status bar tip")); + + connect(manual_online_, &QAction::triggered, [this](bool) { + QString link = "http://download.tuxfamily.org/qet/joshua/html/QET.html"; + QDesktopServices::openUrl(QUrl(link)); + }); + about_qt_ = new QAction(QET::Icons::QtLogo, tr("À propos de &Qt"), this); about_qt_ -> setStatusTip(tr("Affiche des informations sur la bibliothèque Qt", "status bar tip")); connect(about_qt_, SIGNAL(triggered()), qet_app, SLOT(aboutQt())); @@ -91,6 +100,7 @@ void QETMainWindow::initCommonMenus() { help_menu_ -> addAction(whatsthis_action_); help_menu_ -> addSeparator(); help_menu_ -> addAction(about_qet_); + help_menu_ -> addAction(manual_online_); help_menu_ -> addAction(about_qt_); insertMenu(0, settings_menu_); diff --git a/sources/qetmainwindow.h b/sources/qetmainwindow.h index f8909624a..0a0eab642 100644 --- a/sources/qetmainwindow.h +++ b/sources/qetmainwindow.h @@ -56,6 +56,7 @@ class QETMainWindow : public QMainWindow { QAction *fullscreen_action_; ///< Toggle full screen QAction *whatsthis_action_; ///< Toggle "What's this" mode QAction *about_qet_; ///< Launch the "About QElectroTech" dialog + QAction *manual_online_; ///< Launch browser on QElectroTech manual on line QAction *about_qt_; ///< launch the "About Qt" dialog QMenu *settings_menu_; ///< Settings menu QMenu *help_menu_; ///< Help menu