From abb57a3f4cb63f59813b9b36edffa2da5d4abf1c Mon Sep 17 00:00:00 2001 From: flopcat Date: Tue, 30 Apr 2019 13:45:58 +1000 Subject: [PATCH] mainwindow: add about boxes --- desktop/qt/desktopclient/mainwindow.cpp | 34 +++++++++++++++++++++++++ desktop/qt/desktopclient/mainwindow.h | 4 +++ desktop/qt/desktopclient/mainwindow.ui | 24 ++++++++++++++--- 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/desktop/qt/desktopclient/mainwindow.cpp b/desktop/qt/desktopclient/mainwindow.cpp index 7953e3f..dca996c 100755 --- a/desktop/qt/desktopclient/mainwindow.cpp +++ b/desktop/qt/desktopclient/mainwindow.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -300,3 +301,36 @@ void MainWindow::on_systemTray_stateChanged(int arg1) if (trayIcon) trayIcon->setVisible(ui->systemTray->isChecked()); } + +void MainWindow::on_actionHelpAboutThisProgram_triggered() +{ + QString title = "About " + QCoreApplication::applicationName(); + QString text = R"EOF(

%1

+

A desktop client for a StreamLogin server. +
Version %2 +
Built with Qt %3 + +

LICENSE

+

Copyright (C) 2019 +

This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. +

This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA.")EOF"; + text = text.arg(QCoreApplication::applicationName(), + VERSION_STRING, + qVersion()); + QMessageBox::about(this, title, text); +} + +void MainWindow::on_actionHelpAboutQt_triggered() +{ + QMessageBox::aboutQt(this); +} diff --git a/desktop/qt/desktopclient/mainwindow.h b/desktop/qt/desktopclient/mainwindow.h index 30700d8..76bad07 100755 --- a/desktop/qt/desktopclient/mainwindow.h +++ b/desktop/qt/desktopclient/mainwindow.h @@ -73,6 +73,10 @@ private slots: void on_actionAppExit_triggered(); void on_systemTray_stateChanged(int arg1); + void on_actionHelpAboutThisProgram_triggered(); + + void on_actionHelpAboutQt_triggered(); + private: ProgramState progState = NoState; Ui::MainWindow *ui = nullptr; diff --git a/desktop/qt/desktopclient/mainwindow.ui b/desktop/qt/desktopclient/mainwindow.ui index c1b8072..9337c54 100755 --- a/desktop/qt/desktopclient/mainwindow.ui +++ b/desktop/qt/desktopclient/mainwindow.ui @@ -77,18 +77,26 @@ - App + &App - Accounts + A&ccounts + + + &Help + + + + + @@ -100,7 +108,7 @@ - Exit + E&xit @@ -108,6 +116,16 @@ Edit + + + &About This Program... + + + + + About &Qt... + +