From: Steinar H. Gunderson Date: Mon, 1 Oct 2018 22:53:28 +0000 (+0200) Subject: Hook up the exit menu. X-Git-Tag: 1.8.0~76^2~78 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=56ad3ab910de5679cba6f110d287e8bad9ecc5cf;p=nageru Hook up the exit menu. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 9d09582..b6ac8bf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -35,6 +35,9 @@ MainWindow::MainWindow() global_mainwindow = this; ui->setupUi(this); + // The menus. + connect(ui->exit_action, &QAction::triggered, this, &MainWindow::exit_triggered); + global_disk_space_estimator = new DiskSpaceEstimator(bind(&MainWindow::report_disk_space, this, _1, _2)); disk_free_label = new QLabel(this); disk_free_label->setStyleSheet("QLabel {padding-right: 5px;}"); @@ -631,3 +634,8 @@ void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_le }); } +void MainWindow::exit_triggered() +{ + close(); +} + diff --git a/mainwindow.h b/mainwindow.h index 679feb9..35898a7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -87,6 +87,7 @@ private: bool eventFilter(QObject *watched, QEvent *event) override; void report_disk_space(off_t free_bytes, double estimated_seconds_left); + void exit_triggered(); private slots: void relayout(); diff --git a/ui_mainwindow.ui b/ui_mainwindow.ui index 5b0021a..a0aa47b 100644 --- a/ui_mainwindow.ui +++ b/ui_mainwindow.ui @@ -328,13 +328,13 @@ &File - + - + - Quit + E&xit