]> git.sesse.net Git - nageru/commitdiff
Hook up the exit menu.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2018 22:53:28 +0000 (00:53 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2018 22:53:28 +0000 (00:53 +0200)
mainwindow.cpp
mainwindow.h
ui_mainwindow.ui

index 9d0958208d2c742bc123d7f76ccf839b2244bda1..b6ac8bf1c45fba2ee652178178ebe8a93e4b526b 100644 (file)
@@ -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();
+}
+
index 679feb9bdf1873378650e49beee5e055e9acf5eb..35898a78b8deec1f1273b6d5dc0ba8f7fa20f55b 100644 (file)
@@ -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();
index 5b0021aa6f14b4e7220d3a8b1f75d49677907595..a0aa47b50732a84804e437300b25005b981cf00f 100644 (file)
     <property name="title">
      <string>&amp;File</string>
     </property>
-    <addaction name="actionQuit"/>
+    <addaction name="exit_action"/>
    </widget>
    <addaction name="menuFile"/>
   </widget>
-  <action name="actionQuit">
+  <action name="exit_action">
    <property name="text">
-    <string>Quit</string>
+    <string>E&amp;xit</string>
    </property>
   </action>
  </widget>