]> git.sesse.net Git - nageru/commitdiff
Add a menu entry to go to the online manual.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 25 Jan 2017 23:49:54 +0000 (00:49 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 25 Jan 2017 23:49:54 +0000 (00:49 +0100)
mainwindow.cpp
mainwindow.h
ui_mainwindow.ui

index a99d2ae04fbb0d809f989e9fc598236d687d1b84..fc7b6eaa196fab68e4f226072620a70e2c85a688 100644 (file)
@@ -12,6 +12,7 @@
 #include <QApplication>
 #include <QBoxLayout>
 #include <QCheckBox>
+#include <QDesktopServices>
 #include <QDial>
 #include <QDialog>
 #include <QEvent>
@@ -196,6 +197,7 @@ MainWindow::MainWindow()
        // The menus.
        connect(ui->cut_action, &QAction::triggered, this, &MainWindow::cut_triggered);
        connect(ui->exit_action, &QAction::triggered, this, &MainWindow::exit_triggered);
+       connect(ui->manual_action, &QAction::triggered, this, &MainWindow::manual_triggered);
        connect(ui->about_action, &QAction::triggered, this, &MainWindow::about_triggered);
        connect(ui->simple_audio_mode, &QAction::triggered, this, &MainWindow::simple_audio_mode_triggered);
        connect(ui->multichannel_audio_mode, &QAction::triggered, this, &MainWindow::multichannel_audio_mode_triggered);
@@ -563,6 +565,15 @@ void MainWindow::exit_triggered()
        close();
 }
 
+void MainWindow::manual_triggered()
+{
+       if (!QDesktopServices::openUrl(QUrl("https://nageru.sesse.net/doc/"))) {
+               QMessageBox msgbox;
+               msgbox.setText("Could not launch manual in web browser.\nPlease see https://nageru.sesse.net/doc/ manually.");
+               msgbox.exec();
+       }
+}
+
 void MainWindow::about_triggered()
 {
        AboutDialog().exec();
index a9dca41a9015ac5a08a49234f1c7d5edb1f896d8..1c7f0e36943b0720736077deb860e7a0e32fd02d 100644 (file)
@@ -45,6 +45,7 @@ public slots:
        void cut_triggered();
        void x264_bitrate_triggered();
        void exit_triggered();
+       void manual_triggered();
        void about_triggered();
        void simple_audio_mode_triggered();
        void multichannel_audio_mode_triggered();
index e13b507f111c2f95264d2708170ffd5d56236896..15e436135ad4c555b55ecc700f40d2ad47d48ea5 100644 (file)
                 <rect>
                  <x>0</x>
                  <y>0</y>
-                 <width>505</width>
-                 <height>236</height>
+                 <width>514</width>
+                 <height>238</height>
                 </rect>
                </property>
                <layout class="QHBoxLayout" name="horizontalLayout_4">
                 <rect>
                  <x>0</x>
                  <y>0</y>
-                 <width>728</width>
-                 <height>282</height>
+                 <width>100</width>
+                 <height>30</height>
                 </rect>
                </property>
                <layout class="QHBoxLayout" name="horizontalLayout_5">
      <x>0</x>
      <y>0</y>
      <width>1089</width>
-     <height>23</height>
+     <height>19</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuWhat">
     <property name="title">
      <string>&amp;Help</string>
     </property>
+    <addaction name="manual_action"/>
     <addaction name="about_action"/>
    </widget>
    <widget class="QMenu" name="menu_Audio">
     <string>Setup MIDI controller…</string>
    </property>
   </action>
+  <action name="manual_action">
+   <property name="text">
+    <string>Online &amp;manual…</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>