diff --git a/CHANGES b/CHANGES index e0e7d8fca..6dd08ef31 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ Features: - Rewinding of emulation - Implemented BIOS routines SoftReset, RegisterRamReset, Diff8bitUnFilterWram, Diff8bitUnFilterVram, and Diff16bitUnFilter - Support IPv6 + - Save directory of last loaded file Bugfixes: - Qt: Fix issue with set frame sizes being the wrong height - Qt: Fix emulator crashing when full screen if a game is not running diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 60b7ab120..08a0d7d3b 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -6,6 +6,7 @@ #include "Window.h" #include +#include #include #include #include @@ -175,15 +176,17 @@ void Window::saveConfig() { } void Window::selectROM() { - QString filename = QFileDialog::getOpenFileName(this, tr("Select ROM")); + QString filename = QFileDialog::getOpenFileName(this, tr("Select ROM"), m_config->getQtOption("lastDirectory").toString()); if (!filename.isEmpty()) { + m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_controller->loadGame(filename); } } void Window::selectBIOS() { - QString filename = QFileDialog::getOpenFileName(this, tr("Select BIOS")); + QString filename = QFileDialog::getOpenFileName(this, tr("Select BIOS"), m_config->getQtOption("lastDirectory").toString()); if (!filename.isEmpty()) { + m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_config->setOption("bios", filename); m_config->updateOption("bios"); m_controller->loadBIOS(filename); @@ -191,8 +194,9 @@ void Window::selectBIOS() { } void Window::selectPatch() { - QString filename = QFileDialog::getOpenFileName(this, tr("Select patch"), QString(), tr("Patches (*.ips *.ups)")); + QString filename = QFileDialog::getOpenFileName(this, tr("Select patch"), m_config->getQtOption("lastDirectory").toString(), tr("Patches (*.ips *.ups)")); if (!filename.isEmpty()) { + m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_controller->loadPatch(filename); } }