mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 04:45:31 -07:00
Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
@@ -94,11 +94,14 @@ extern bool cpu_thread_running;
|
||||
# include <QVulkanFunctions>
|
||||
#endif
|
||||
|
||||
void qt_set_sequence_auto_mnemonic(bool b);
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "qt_settings.hpp"
|
||||
#include "qt_about.hpp"
|
||||
#include "qt_machinestatus.hpp"
|
||||
#include "qt_mediamenu.hpp"
|
||||
#include "qt_util.hpp"
|
||||
@@ -293,8 +296,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ui->actionPause->setChecked(false);
|
||||
ui->actionPause->setCheckable(false);
|
||||
});
|
||||
connect(this, &MainWindow::getTitleForNonQtThread, this, &MainWindow::getTitle_, Qt::BlockingQueuedConnection);
|
||||
|
||||
@@ -325,6 +326,16 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
ui->stackedWidget->unsetCursor();
|
||||
}
|
||||
#ifndef Q_OS_MACOS
|
||||
if (kbd_req_capture) {
|
||||
qt_set_sequence_auto_mnemonic(!mouse_capture);
|
||||
/* Hack to get the menubar to update the internal Alt+shortcut table */
|
||||
if (!video_fullscreen) {
|
||||
ui->menubar->hide();
|
||||
ui->menubar->show();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
});
|
||||
|
||||
connect(qApp, &QGuiApplication::applicationStateChanged, [this](Qt::ApplicationState state) {
|
||||
@@ -792,8 +803,12 @@ void MainWindow::onHardResetCompleted()
|
||||
scroll_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||
caps_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||
/* TODO: Base this on keyboard type instead when that's done. */
|
||||
kana_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD) &&
|
||||
machine_has_flags(machine, MACHINE_AX));
|
||||
int ext_ax_kbd = machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD) &&
|
||||
(keyboard_type == KEYBOARD_TYPE_AX);
|
||||
int int_ax_kbd = machine_has_flags(machine, MACHINE_KEYBOARD_JIS) &&
|
||||
!machine_has_bus(machine, MACHINE_BUS_PS2_PORTS);
|
||||
kana_label->setVisible(ext_ax_kbd || int_ax_kbd);
|
||||
|
||||
while (QApplication::overrideCursor())
|
||||
QApplication::restoreOverrideCursor();
|
||||
#ifdef USE_WACOM
|
||||
@@ -1059,6 +1074,14 @@ void
|
||||
MainWindow::on_actionKeyboard_requires_capture_triggered()
|
||||
{
|
||||
kbd_req_capture ^= 1;
|
||||
#ifndef Q_OS_MACOS
|
||||
qt_set_sequence_auto_mnemonic(!!kbd_req_capture);
|
||||
/* Hack to get the menubar to update the internal Alt+shortcut table */
|
||||
if (!video_fullscreen) {
|
||||
ui->menubar->hide();
|
||||
ui->menubar->show();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1134,7 +1157,8 @@ MainWindow::on_actionSettings_triggered()
|
||||
case QDialog::Accepted:
|
||||
settings.save();
|
||||
config_changed = 2;
|
||||
updateShortcuts();
|
||||
updateShortcuts();
|
||||
emit vmmConfigurationChanged();
|
||||
pc_reset_hard();
|
||||
break;
|
||||
case QDialog::Rejected:
|
||||
@@ -1457,7 +1481,7 @@ MainWindow::eventFilter(QObject *receiver, QEvent *event)
|
||||
}
|
||||
|
||||
|
||||
if (!dopause) {
|
||||
if (!dopause && (!kbd_req_capture || mouse_capture)) {
|
||||
if (event->type() == QEvent::Shortcut) {
|
||||
auto shortcutEvent = (QShortcutEvent *) event;
|
||||
if (shortcutEvent->key() == ui->actionExit->shortcut()) {
|
||||
@@ -1510,8 +1534,11 @@ MainWindow::refreshMediaMenu()
|
||||
caps_label->setToolTip(QShortcut::tr("Caps Lock"));
|
||||
caps_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||
kana_label->setToolTip(QShortcut::tr("Kana Lock"));
|
||||
kana_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD) &&
|
||||
machine_has_flags(machine, MACHINE_AX));
|
||||
int ext_ax_kbd = machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD) &&
|
||||
(keyboard_type == KEYBOARD_TYPE_AX);
|
||||
int int_ax_kbd = machine_has_flags(machine, MACHINE_KEYBOARD_JIS) &&
|
||||
!machine_has_bus(machine, MACHINE_BUS_PS2_PORTS);
|
||||
kana_label->setVisible(ext_ax_kbd || int_ax_kbd);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1931,42 +1958,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
|
||||
@@ -2138,8 +2131,11 @@ MainWindow::updateUiPauseState()
|
||||
QIcon(":/menuicons/qt/icons/pause.ico");
|
||||
const auto tooltip_text = dopause ? QString(tr("Resume execution")) :
|
||||
QString(tr("Pause execution"));
|
||||
const auto menu_text = dopause ? QString(tr("Re&sume")) :
|
||||
QString(tr("&Pause"));
|
||||
ui->actionPause->setIcon(pause_icon);
|
||||
ui->actionPause->setToolTip(tooltip_text);
|
||||
ui->actionPause->setText(menu_text);
|
||||
emit vmmRunningStateChanged(static_cast<VMManagerProtocol::RunningState>(window_blocked ? (dopause ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting) : (VMManagerProtocol::RunningState)dopause));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user