Manager: Add Help menu

Move the About dialog into its own file and object
This commit is contained in:
Alexander Babikov
2025-07-27 04:31:13 +05:00
parent 7dcf25bf3a
commit 3e1c6d3dae
7 changed files with 151 additions and 42 deletions

View File

@@ -97,6 +97,7 @@ extern bool cpu_thread_running;
#include <unordered_map>
#include "qt_settings.hpp"
#include "qt_about.hpp"
#include "qt_machinestatus.hpp"
#include "qt_mediamenu.hpp"
#include "qt_util.hpp"
@@ -1908,42 +1909,8 @@ MainWindow::on_actionAbout_Qt_triggered()
void
MainWindow::on_actionAbout_86Box_triggered()
{
QMessageBox msgBox;
msgBox.setTextFormat(Qt::RichText);
QString versioninfo;
#ifdef EMU_GIT_HASH
versioninfo = QString(" [%1]").arg(EMU_GIT_HASH);
#endif
#ifdef USE_DYNAREC
# ifdef USE_NEW_DYNAREC
# define DYNAREC_STR "new dynarec"
# else
# define DYNAREC_STR "old dynarec"
# endif
#else
# define DYNAREC_STR "no dynarec"
#endif
versioninfo.append(QString(" [%1, %2]").arg(QSysInfo::buildCpuArchitecture(), tr(DYNAREC_STR)));
msgBox.setText(QString("<b>%3%1%2</b>").arg(EMU_VERSION_FULL, versioninfo, tr("86Box v")));
msgBox.setInformativeText(tr("An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information."));
msgBox.setWindowTitle(tr("About 86Box"));
const auto closeButton = msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole);
msgBox.setEscapeButton(closeButton);
const auto webSiteButton = msgBox.addButton(EMU_SITE, QMessageBox::ButtonRole::HelpRole);
webSiteButton->connect(webSiteButton, &QPushButton::released, []() {
QDesktopServices::openUrl(QUrl("https://" EMU_SITE));
});
#ifdef RELEASE_BUILD
msgBox.setIconPixmap(QIcon(":/settings/qt/icons/86Box-green.ico").pixmap(32, 32));
#elif defined ALPHA_BUILD
msgBox.setIconPixmap(QIcon(":/settings/qt/icons/86Box-red.ico").pixmap(32, 32));
#elif defined BETA_BUILD
msgBox.setIconPixmap(QIcon(":/settings/qt/icons/86Box-yellow.ico").pixmap(32, 32));
#else
msgBox.setIconPixmap(QIcon(":/settings/qt/icons/86Box-gray.ico").pixmap(32, 32));
#endif
msgBox.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
msgBox.exec();
const auto msgBox = new About(this);
msgBox->exec();
}
void