From bda904b36412fdae5e869c21e76d71b52bba4c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Sat, 20 Apr 2013 12:43:55 +0200 Subject: [PATCH] Qt: fix pausing/resuming game --- Qt/mainwindow.cpp | 16 +++++++--------- Qt/mainwindow.h | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 214789e651..7c99210cf0 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -30,7 +30,8 @@ MainWindow::MainWindow(QWidget *parent) : memoryWindow(0), memoryTexWindow(0), timer(this), - displaylistWindow(0) + displaylistWindow(0), + lastUIState(UISTATE_MENU) { ui->setupUi(this); @@ -94,6 +95,11 @@ void MainWindow::Update() __CtrlButtonUp(controllist[i].psp_id); } __CtrlSetAnalog(input_state.pad_lstick_x, input_state.pad_lstick_y); + + if (lastUIState != globalUIState) { + lastUIState = globalUIState; + UpdateMenus(); + } } void MainWindow::UpdateMenus() @@ -318,19 +324,11 @@ void MainWindow::on_action_FileExit_triggered() void MainWindow::on_action_EmulationRun_triggered() { NativeMessageReceived("run", ""); - - if(dialogDisasm) - { - dialogDisasm->Stop(); - dialogDisasm->Go(); - } } void MainWindow::on_action_EmulationPause_triggered() { NativeMessageReceived("pause", ""); - if(dialogDisasm) - dialogDisasm->Stop(); } void MainWindow::on_action_EmulationReset_triggered() diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index b51e0177a7..6ad9e58ab1 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -155,6 +155,7 @@ private: QTimer timer; CoreState nextState; InputState input_state; + GlobalUIState lastUIState; Debugger_Disasm *dialogDisasm; Debugger_Memory *memoryWindow;