diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index b86127997..148d59fdf 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -17,6 +17,10 @@ extern "C" { #include #include #include +#include +#include +#include +#include #include #include @@ -49,6 +53,8 @@ MainWindow::MainWindow(QWidget *parent) : ui->ogl->setRenderType(HardwareRenderer::RenderType::OpenGL); ui->gles->setRenderType(HardwareRenderer::RenderType::OpenGLES); + this->setWindowIcon(QIcon(":/settings/win/icons/86Box-yellow.ico")); + connect(this, &MainWindow::showMessageForNonQtThread, this, &MainWindow::showMessage_, Qt::BlockingQueuedConnection); connect(this, &MainWindow::setTitleForNonQtThread, this, &MainWindow::setTitle_, Qt::BlockingQueuedConnection); @@ -1082,6 +1088,39 @@ void MainWindow::on_actionAverage_triggered() { update_greyscale_type_checkboxes(ui, ui->actionAverage, 2); } +void MainWindow::on_actionAbout_Qt_triggered() +{ + QApplication::aboutQt(); +} + +void MainWindow::on_actionAbout_86Box_triggered() +{ + QMessageBox msgBox; + msgBox.setTextFormat(Qt::RichText); + msgBox.setText("About 86Box"); + msgBox.setInformativeText(R"( +An emulator of old computers + +Authors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, Tiseno100, reenigne, leilei, JohnElliott, greatpsycho, and others. + +Released under the GNU General Public License version 2 or later. See LICENSE for more information. +)"); + msgBox.setWindowTitle("About 86Box"); + msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole); + auto webSiteButton = msgBox.addButton("86box.net", QMessageBox::ButtonRole::HelpRole); + webSiteButton->connect(webSiteButton, &QPushButton::released, []() + { + QDesktopServices::openUrl(QUrl("https://86box.net/")); + }); + msgBox.setIconPixmap(QIcon(":/settings/win/icons/86Box-yellow.ico").pixmap(32, 32)); + msgBox.exec(); +} + +void MainWindow::on_actionDocumentation_triggered() +{ + QDesktopServices::openUrl(QUrl("https://86box.readthedocs.io")); +} + void MainWindow::on_actionCGA_PCjr_Tandy_EGA_S_VGA_overscan_triggered() { update_overscan = 1; video_toggle_option(ui->actionCGA_PCjr_Tandy_EGA_S_VGA_overscan, &enable_overscan); @@ -1097,4 +1136,3 @@ void MainWindow::on_actionForce_4_3_display_ratio_triggered() { video_toggle_option(ui->actionForce_4_3_display_ratio, &force_43); video_force_resize_set(1); } - diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 148de615b..e46fffd87 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -76,6 +76,9 @@ private slots: void on_actionAverage_triggered(); void on_actionBT709_HDTV_triggered(); void on_actionBT601_NTSC_PAL_triggered(); + void on_actionDocumentation_triggered(); + void on_actionAbout_86Box_triggered(); + void on_actionAbout_Qt_triggered(); void on_actionForce_4_3_display_ratio_triggered(); void on_actionChange_contrast_for_monochrome_display_triggered(); void on_actionCGA_PCjr_Tandy_EGA_S_VGA_overscan_triggered(); diff --git a/src/qt/qt_mainwindow.ui b/src/qt/qt_mainwindow.ui index af8a8a2bd..fafb6b3f2 100644 --- a/src/qt/qt_mainwindow.ui +++ b/src/qt/qt_mainwindow.ui @@ -166,10 +166,19 @@ Media + + + Help + + + + + + @@ -466,6 +475,27 @@ Average + + + About Qt... + + + QAction::AboutQtRole + + + + + About 86Box... + + + QAction::AboutRole + + + + + Documentation... + + diff --git a/src/qt_resources.qrc b/src/qt_resources.qrc index 8c66e5ca2..0db4552e9 100644 --- a/src/qt_resources.qrc +++ b/src/qt_resources.qrc @@ -43,5 +43,9 @@ win/icons/zip_disabled.ico win/icons/zip_empty.ico win/icons/zip_empty_active.ico + win/icons/86Box-gray.ico + win/icons/86Box-green.ico + win/icons/86Box-red.ico + win/icons/86Box-yellow.ico