all repos — mgba @ 4cf401c3910f8a9cce6de621f555d29f5b20cb57

mGBA Game Boy Advance Emulator

Qt: Only show emulator restart warning once per settings saving
Vicki Pfau vi@endrift.com
Sun, 25 Aug 2019 19:22:03 -0700
commit

4cf401c3910f8a9cce6de621f555d29f5b20cb57

parent

e8fe5684f7c751b0963a55a9382eb9710da838fb

3 files changed, 9 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -52,6 +52,7 @@ - Libretro: Fix crash changing allowing opposing directions (hhromic)

- Qt: Fix race conditions initializing GDB stub - GBA: Set up GPIO mapping on null and ELF ROM regions (fixes mgba.io/i/1481) - GBA Cheats: Fix value incrementing in CB slide codes (fixes mgba.io/i/1501) + - Qt: Only show emulator restart warning once per settings saving Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -152,6 +152,8 @@ m_log.setLevels(mLOG_WARN | mLOG_ERROR | mLOG_FATAL);

m_log.load(m_config); m_fpsTimer.setInterval(FPS_TIMER_INTERVAL); m_focusCheck.setInterval(200); + m_mustRestart.setInterval(MUST_RESTART_TIMEOUT); + m_mustRestart.setSingleShot(true); m_shortcutController->setConfigController(m_config); m_shortcutController->setActionMapper(&m_actions);

@@ -970,6 +972,10 @@ confirm->show();

} void Window::mustRestart() { + if (m_mustRestart.isActive()) { + return; + } + m_mustRestart.start(); QMessageBox* dialog = new QMessageBox(QMessageBox::Warning, tr("Restart needed"), tr("Some changes will not take effect until the emulator is restarted."), QMessageBox::Ok, this, Qt::Sheet);
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -145,6 +145,7 @@ void updateFrame();

private: static const int FPS_TIMER_INTERVAL = 2000; + static const int MUST_RESTART_TIMEOUT = 10000; void setupMenu(QMenuBar*); void openStateWindow(LoadSave);

@@ -199,6 +200,7 @@ InputController m_inputController;

QList<qint64> m_frameList; QElapsedTimer m_frameTimer; QTimer m_fpsTimer; + QTimer m_mustRestart; QList<QString> m_mruFiles; ShortcutController* m_shortcutController; #if defined(BUILD_GL) || defined(BUILD_GLES2)