From 6ccd0f4d74b7a151e453df89633121e05a182e2d Mon Sep 17 00:00:00 2001 From: Xphalnos <164882787+Xphalnos@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:14:41 +0100 Subject: [PATCH] Qt: Disables the Pause and Stop button when no game is launched --- src/qt_gui/main_window.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 5cbce1884..4c2b5d8b2 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -86,6 +86,10 @@ bool MainWindow::Init() { CheckUpdateMain(true); #endif + // Makes the Pause and Stop buttons non-activatable (No game is launched). + ui->pauseButton->setEnabled(false); + ui->stopButton->setEnabled(false); + auto end = std::chrono::steady_clock::now(); auto duration = std::chrono::duration_cast(end - start); statusBar.reset(new QStatusBar); @@ -1229,6 +1233,11 @@ void MainWindow::StartEmulator(std::filesystem::path path) { QMessageBox::critical(nullptr, tr("Run Game"), QString(tr("Game is already running!"))); return; } + + // Makes the Pause and Stop buttons activatable (A game is launched). + ui->pauseButton->setEnabled(true); + ui->stopButton->setEnabled(true); + isGameRunning = true; #ifdef __APPLE__ // SDL on macOS requires main thread.