]> sigrok.org Git - pulseview.git/commitdiff
Added File>Quit menu item
authorJoel Holdsworth <redacted>
Tue, 15 Jan 2013 19:25:43 +0000 (19:25 +0000)
committerJoel Holdsworth <redacted>
Tue, 15 Jan 2013 19:27:46 +0000 (19:27 +0000)
icons/application-exit.png [new file with mode: 0644]
pv/mainwindow.cpp
pv/mainwindow.h

diff --git a/icons/application-exit.png b/icons/application-exit.png
new file mode 100644 (file)
index 0000000..28ac66f
Binary files /dev/null and b/icons/application-exit.png differ
index 3a59bea10bfa0fc6103a929d969e65060ad26b4f..35b0da57b3c9d87c14396d50bff73c495976162f 100644 (file)
@@ -92,9 +92,18 @@ void MainWindow::setup_ui()
        _action_open->setIcon(QIcon::fromTheme("document-open",
                QIcon(":/icons/document-open.png")));
        _action_open->setObjectName(QString::fromUtf8("actionOpen"));
-
        _menu_file->addAction(_action_open);
 
+       _menu_file->addSeparator();
+
+       _action_quit = new QAction(this);
+       _action_quit->setText(QApplication::translate(
+               "MainWindow", "&Quit", 0, QApplication::UnicodeUTF8));
+       _action_quit->setIcon(QIcon::fromTheme("application-exit",
+               QIcon(":/icons/application-exit.png")));
+       _action_quit->setObjectName(QString::fromUtf8("actionQuit"));
+       _menu_file->addAction(_action_quit);
+
        // View Menu
        _menu_view = new QMenu(_menu_bar);
        _menu_view->setTitle(QApplication::translate(
@@ -177,6 +186,11 @@ void MainWindow::on_actionOpen_triggered()
        _session.load_file(file_name.toStdString());
 }
 
+void MainWindow::on_actionQuit_triggered()
+{
+       close();
+}
+
 void MainWindow::on_actionViewZoomIn_triggered()
 {
        _view->zoom(1);
index a68c37de04df8b914d2bdcd159a35038171ac547..b53138ee5f84c83bef3a06a1281a7bec0317ada1 100644 (file)
@@ -59,6 +59,7 @@ private:
        QMenuBar *_menu_bar;
        QMenu *_menu_file;
        QAction *_action_open;
+       QAction *_action_quit;
 
        QMenu *_menu_view;
        QAction *_action_view_zoom_in;
@@ -77,6 +78,7 @@ private:
 private slots:
 
        void on_actionOpen_triggered();
+       void on_actionQuit_triggered();
 
        void on_actionViewZoomIn_triggered();