From 3976f8f2739019237269b03e5fdc3c6ef9ae0f63 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 25 Aug 2019 19:29:18 -0700 Subject: [PATCH] Qt: Add recent game list clearing (closes #1380) --- CHANGES | 1 + src/platform/qt/Window.cpp | 8 ++++++++ src/platform/qt/Window.h | 1 + 3 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index d29c03f5f..b020c6aed 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,7 @@ Features: - GBA Cheats: Add support for loading EZ Flash-style cht files - Support for unlicensed Wisdom Tree Game Boy mapper - Qt: Add export button for tile view (closes mgba.io/i/1507) + - Qt: Add recent game list clearing (closes mgba.io/i/1380) Emulation fixes: - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208) - GBA: Reset now reloads multiboot ROMs diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index da1e79c30..4e4007a12 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1702,6 +1702,11 @@ void Window::appendMRU(const QString& fname) { updateMRU(); } +void Window::clearMRU() { + m_mruFiles.clear(); + updateMRU(); +} + void Window::updateMRU() { m_actions.clearMenu("mru"); int i = 0; @@ -1714,6 +1719,9 @@ void Window::updateMRU() { } m_config->setMRU(m_mruFiles); m_config->write(); + m_actions.addSeparator("mru"); + m_actions.addAction(tr("Clear"), "resetMru", this, &Window::clearMRU, "mru"); + m_actions.rebuildMenu(menuBar(), this, *m_shortcutController); } diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index 97fb744f1..251550c6d 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -154,6 +154,7 @@ private: void detachWidget(QWidget* widget); void appendMRU(const QString& fname); + void clearMRU(); void updateMRU(); void openView(QWidget* widget);