From: Joel Holdsworth Date: Tue, 15 Jan 2013 19:25:43 +0000 (+0000) Subject: Added File>Quit menu item X-Git-Tag: pulseview-0.1.0~163 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2a032dcb6151bd8b019c88f6ef1db1a8c1e5b61e;p=pulseview.git Added File>Quit menu item --- diff --git a/icons/application-exit.png b/icons/application-exit.png new file mode 100644 index 00000000..28ac66f0 Binary files /dev/null and b/icons/application-exit.png differ diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 3a59bea1..35b0da57 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -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); diff --git a/pv/mainwindow.h b/pv/mainwindow.h index a68c37de..b53138ee 100644 --- a/pv/mainwindow.h +++ b/pv/mainwindow.h @@ -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();