mirror of
https://github.com/ARMSX2/ARMSX3.git
synced 2026-08-24 16:58:52 -07:00
Qt: Remember last used path when adding games from folder or ISO
Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
This commit is contained in:
committed by
Megamouse
parent
3d587726a2
commit
75fea2216b
@@ -165,6 +165,8 @@ namespace gui
|
||||
const gui_save ib_restart_hint = gui_save(main_window, "confirmationRestart", true);
|
||||
|
||||
const gui_save fd_install_pkg = gui_save(main_window, "lastExplorePathPKG", "");
|
||||
const gui_save fd_add_games = gui_save(main_window, "lastExplorePathADDGAMES", "");
|
||||
const gui_save fd_add_iso = gui_save(main_window, "lastExplorePathADDISO", "");
|
||||
const gui_save fd_install_pup = gui_save(main_window, "lastExplorePathPUP", "");
|
||||
const gui_save fd_boot_elf = gui_save(main_window, "lastExplorePathELF", "");
|
||||
const gui_save fd_boot_game = gui_save(main_window, "lastExplorePathGAME", "");
|
||||
|
||||
@@ -2729,12 +2729,15 @@ void main_window::CreateConnects()
|
||||
}
|
||||
|
||||
// Only select one folder for now
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder containing one or more games"), QString::fromStdString(fs::get_config_dir()), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
const QString path_last_add_games = m_gui_settings->GetValue(gui::fd_add_games).toString();
|
||||
const QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder containing one or more games"), path_last_add_games, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
if (dir.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_gui_settings->SetValue(gui::fd_add_games, QFileInfo(dir).path());
|
||||
|
||||
QStringList paths;
|
||||
paths << dir;
|
||||
AddGamesFromDirs(std::move(paths));
|
||||
@@ -2747,12 +2750,15 @@ void main_window::CreateConnects()
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList paths = QFileDialog::getOpenFileNames(this, tr("Select ISO files to add"), QString::fromStdString(fs::get_config_dir()), tr("ISO files (*.iso);;All files (*.*)"));
|
||||
const QString path_last_add_iso = m_gui_settings->GetValue(gui::fd_add_iso).toString();
|
||||
QStringList paths = QFileDialog::getOpenFileNames(this, tr("Select ISO files to add"), path_last_add_iso, tr("ISO files (*.iso);;All files (*.*)"));
|
||||
if (paths.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_gui_settings->SetValue(gui::fd_add_iso, QFileInfo(paths.front()).path());
|
||||
|
||||
AddGamesFromDirs(std::move(paths));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user