]> git.sesse.net Git - nageru/commitdiff
Give Futatabi an about/license dialog, and the same manual link as Nageru.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 6 Dec 2018 19:29:03 +0000 (20:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 6 Dec 2018 19:29:03 +0000 (20:29 +0100)
futatabi/mainwindow.cpp
futatabi/mainwindow.h
futatabi/mainwindow.ui
nageru/mainwindow.cpp
nageru/meson.build
shared/aboutdialog.cpp [moved from nageru/aboutdialog.cpp with 63% similarity]
shared/aboutdialog.h [moved from nageru/aboutdialog.h with 75% similarity]
shared/aboutdialog.ui [moved from nageru/aboutdialog.ui with 98% similarity]
shared/meson.build

index 2a05a24428a3774c76bfb04b67079e85e0c9f4d6..81ef10b3a4bb1e8ab1a4cd3e72502e3cfce65558 100644 (file)
@@ -1,5 +1,6 @@
 #include "mainwindow.h"
 
+#include "shared/aboutdialog.h"
 #include "clip_list.h"
 #include "shared/disk_space_estimator.h"
 #include "flags.h"
@@ -9,6 +10,8 @@
 #include "shared/timebase.h"
 #include "ui_mainwindow.h"
 
+#include <QDesktopServices>
+#include <QMessageBox>
 #include <QMouseEvent>
 #include <QShortcut>
 #include <QTimer>
@@ -36,6 +39,8 @@ MainWindow::MainWindow()
 
        // The menus.
        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);
 
        global_disk_space_estimator = new DiskSpaceEstimator(bind(&MainWindow::report_disk_space, this, _1, _2));
        disk_free_label = new QLabel(this);
@@ -735,6 +740,20 @@ 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("Futatabi", "Multicamera slow motion video server").exec();
+}
+
 void MainWindow::highlight_camera_input(int stream_idx)
 {
        if (stream_idx == 0) {
index 7f8c57ac805a79928573a01e76e17e5916ab8d39..4e3800ef083ae6df812719735f9a219ddcac9fdb 100644 (file)
@@ -100,6 +100,8 @@ private:
 
        void report_disk_space(off_t free_bytes, double estimated_seconds_left);
        void exit_triggered();
+       void manual_triggered();
+       void about_triggered();
 
        void highlight_camera_input(int stream_idx);
 
index dbdb622d39723ff8dbee2b6f05e9b3fecfab2129..880a45147ee9109f7f60e09038e45223b5b9aa56 100644 (file)
     </property>
     <addaction name="exit_action"/>
    </widget>
+   <widget class="QMenu" name="menu_Help">
+    <property name="title">
+     <string>&amp;Help</string>
+    </property>
+    <addaction name="manual_action"/>
+    <addaction name="about_action"/>
+   </widget>
    <addaction name="menuFile"/>
+   <addaction name="menu_Help"/>
   </widget>
   <action name="exit_action">
    <property name="text">
     <string>E&amp;xit</string>
    </property>
   </action>
+  <action name="manual_action">
+   <property name="text">
+    <string>Online &amp;manualā€¦</string>
+   </property>
+  </action>
+  <action name="about_action">
+   <property name="text">
+    <string>&amp;About Futatabiā€¦</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
index d0d9b6c49e89ecbd3073d5fbaf41c1e0300e1b5c..61e775d51eb75cf329defd56d7c4b68fdabdc320 100644 (file)
@@ -44,7 +44,7 @@
 #include <string>
 #include <vector>
 
-#include "aboutdialog.h"
+#include "shared/aboutdialog.h"
 #include "alsa_pool.h"
 #include "analyzer.h"
 #include "clickable_label.h"
@@ -663,7 +663,7 @@ void MainWindow::manual_triggered()
 
 void MainWindow::about_triggered()
 {
-       AboutDialog().exec();
+       AboutDialog("Nageru", "Realtime video mixer").exec();
 }
 
 void MainWindow::open_analyzer_triggered()
index c66ea542ae16ce1f62e25c3822f05fbdde7188d3..6d31a4d556d4be2e9d3d4e4d1bfd6c05df2e590d 100644 (file)
@@ -136,16 +136,16 @@ nageru_link_with += protobuf_lib
 
 # Preprocess Qt as needed.
 qt_files = qt5.preprocess(
-       moc_headers: ['aboutdialog.h', 'analyzer.h', 'clickable_label.h', 'compression_reduction_meter.h', 'correlation_meter.h',
+       moc_headers: ['analyzer.h', 'clickable_label.h', 'compression_reduction_meter.h', 'correlation_meter.h',
                'ellipsis_label.h', 'glwidget.h', 'input_mapping_dialog.h', 'lrameter.h', 'mainwindow.h', 'midi_mapping_dialog.h',
                'nonlinear_fader.h', 'vumeter.h'],
-       ui_files: ['aboutdialog.ui', 'analyzer.ui', 'audio_expanded_view.ui', 'audio_miniview.ui', 'display.ui',
+       ui_files: ['analyzer.ui', 'audio_expanded_view.ui', 'audio_miniview.ui', 'display.ui',
                'input_mapping.ui', 'mainwindow.ui', 'midi_mapping.ui'],
        dependencies: qt5deps)
 
 # Qt objects.
 srcs += ['glwidget.cpp', 'mainwindow.cpp', 'vumeter.cpp', 'lrameter.cpp', 'compression_reduction_meter.cpp',
-       'correlation_meter.cpp', 'aboutdialog.cpp', 'analyzer.cpp', 'input_mapping_dialog.cpp', 'midi_mapping_dialog.cpp',
+       'correlation_meter.cpp', 'analyzer.cpp', 'input_mapping_dialog.cpp', 'midi_mapping_dialog.cpp',
        'nonlinear_fader.cpp', 'context_menus.cpp', 'vu_common.cpp', 'piecewise_interpolator.cpp', 'midi_mapper.cpp']
 
 # Auxiliary objects used for nearly everything.
similarity index 63%
rename from nageru/aboutdialog.cpp
rename to shared/aboutdialog.cpp
index def415111aa664cb530b1a5bd74e7dae1fe14926..35663b9cbbdf6390511d598b708b61d0828e7e66 100644 (file)
@@ -6,12 +6,14 @@
 
 using namespace std;
 
-AboutDialog::AboutDialog()
+AboutDialog::AboutDialog(const string &program, const string &subheading)
        : ui(new Ui::AboutDialog)
 {
        ui->setupUi(this);
        QString str = ui->header->text();
        str.replace("@NAGERU_VERSION@", NAGERU_VERSION);
+       str.replace("@PROGRAM@", QString::fromStdString(program));
+       str.replace("@SUBHEADING@", QString::fromStdString(subheading));
        ui->header->setText(str);
 
        connect(ui->button_box, &QDialogButtonBox::accepted, [this]{ this->close(); });
similarity index 75%
rename from nageru/aboutdialog.h
rename to shared/aboutdialog.h
index 5100c009014320dee93a5bb0c4124ad502108ba3..ddc9dec60b417c6321562d08675802af2270623c 100644 (file)
@@ -4,6 +4,8 @@
 #include <QDialog>
 #include <QString>
 
+#include <string>
+
 class QObject;
 
 namespace Ui {
@@ -15,7 +17,7 @@ class AboutDialog : public QDialog
        Q_OBJECT
 
 public:
-       AboutDialog();
+       AboutDialog(const std::string &program, const std::string &subheading);
 
 private:
        Ui::AboutDialog *ui;
similarity index 98%
rename from nageru/aboutdialog.ui
rename to shared/aboutdialog.ui
index 0ffbd441e2f5daf473c21cb7c7f3c49072f0ee01..59b083528dee89cf1f42efd4e5c68bb3cea77484 100644 (file)
@@ -17,9 +17,9 @@
    <item>
     <widget class="QLabel" name="header">
      <property name="text">
-      <string>&lt;p&gt;&lt;b&gt;Nageru @NAGERU_VERSION@&lt;/b&gt;&lt;/p&gt;
+      <string>&lt;p&gt;&lt;b&gt;@PROGRAM@ @NAGERU_VERSION@&lt;/b&gt;&lt;/p&gt;
 
-&lt;p&gt;Realtime video mixer&lt;/p&gt;</string>
+&lt;p&gt;@SUBHEADING@&lt;/p&gt;</string>
      </property>
     </widget>
    </item>
index acb2c9a251f46e7e77db3eb3455e85e7ca1d914b..49c52ee65bc6743d4b969ec299c3a3c5b3dbf826 100644 (file)
@@ -1,8 +1,19 @@
 qt5 = import('qt5')
-qt5deps = dependency('qt5', modules: ['OpenGL'])
+qt5deps = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGL'])
 libmicrohttpddep = dependency('libmicrohttpd')
 
+# Preprocess Qt as needed.
+qt_files = qt5.preprocess(
+       moc_headers: ['aboutdialog.h'],
+       ui_files: ['aboutdialog.ui'],
+       dependencies: qt5deps)
+
 srcs = ['memcpy_interleaved.cpp', 'metacube2.cpp', 'ffmpeg_raii.cpp', 'mux.cpp', 'metrics.cpp', 'context.cpp', 'httpd.cpp', 'disk_space_estimator.cpp', 'read_file.cpp']
+
+# Qt objects.
+srcs += qt_files
+srcs += ['aboutdialog.cpp']
+
 shared = static_library('shared', srcs, include_directories: top_include, dependencies: [qt5deps, libmicrohttpddep])
 shareddep = declare_dependency(
    include_directories: top_include,