Qt: some code cleanup in gui files

This commit is contained in:
Megamouse 2020-03-07 18:01:09 +01:00
parent 426643c44d
commit 934a2eb9fa
8 changed files with 511 additions and 509 deletions

View file

@ -49,11 +49,11 @@ LOG_CHANNEL(gui_log, "GUI");
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
main_window::main_window(std::shared_ptr<gui_settings> guiSettings, std::shared_ptr<emu_settings> emuSettings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent)
main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::main_window)
, guiSettings(guiSettings)
, emuSettings(emuSettings)
, m_gui_settings(gui_settings)
, m_emu_settings(emu_settings)
, m_persistent_settings(persistent_settings)
{
Q_INIT_RESOURCE(resources);
@ -87,7 +87,7 @@ void main_window::Init()
setMinimumSize(350, minimumSizeHint().height()); // seems fine on win 10
setWindowTitle(QString::fromStdString("RPCS3 " + rpcs3::get_version().to_string()));
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
Q_EMIT RequestGlobalStylesheetChange(m_gui_settings->GetCurrentStylesheetPath());
ConfigureGuiFromSettings(true);
#ifdef BRANCH
@ -126,9 +126,9 @@ void main_window::Init()
show(); // needs to be done before creating the thumbnail toolbar
// enable play options if a recent game exists
const bool enable_play_last = !m_recentGameActs.isEmpty() && m_recentGameActs.first();
const bool enable_play_last = !m_recent_game_acts.isEmpty() && m_recent_game_acts.first();
const QString start_toolip = enable_play_last ? tr("Play %0").arg(m_recentGameActs.first()->text()) : tr("Play");
const QString start_toolip = enable_play_last ? tr("Play %0").arg(m_recent_game_acts.first()->text()) : tr("Play");
if (enable_play_last)
{
@ -171,10 +171,10 @@ void main_window::Init()
#endif
// Fix possible hidden game list columns. The game list has to be visible already. Use this after show()
m_gameListFrame->FixNarrowColumns();
m_game_list_frame->FixNarrowColumns();
#if defined(_WIN32) || defined(__linux__)
if (guiSettings->GetValue(gui::m_check_upd_start).toBool())
if (m_gui_settings->GetValue(gui::m_check_upd_start).toBool())
{
m_updater.check_for_updates(true, this);
}
@ -194,7 +194,7 @@ QString main_window::GetCurrentTitle()
// returns appIcon
QIcon main_window::GetAppIcon()
{
return m_appIcon;
return m_app_icon;
}
void main_window::ResizeIcons(int index)
@ -208,13 +208,13 @@ void main_window::ResizeIcons(int index)
if (m_save_slider_pos)
{
m_save_slider_pos = false;
guiSettings->SetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid, index);
m_gui_settings->SetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid, index);
// this will also fire when we used the actions, but i didn't want to add another boolean member
SetIconSizeActions(index);
}
m_gameListFrame->ResizeIcons(index);
m_game_list_frame->ResizeIcons(index);
}
void main_window::OnPlayOrPause()
@ -245,9 +245,9 @@ void main_window::OnPlayOrPause()
show_boot_error(error);
}
}
else if (!m_recentGameActs.isEmpty())
else if (!m_recent_game_acts.isEmpty())
{
BootRecentAction(m_recentGameActs.first());
BootRecentAction(m_recent_game_acts.first());
}
}
}
@ -303,7 +303,7 @@ void main_window::Boot(const std::string& path, const std::string& title_id, boo
if (!Emu.IsStopped())
{
int result = QMessageBox::Yes;
guiSettings->ShowConfirmationBox(tr("Close Running Game?"),
m_gui_settings->ShowConfirmationBox(tr("Close Running Game?"),
tr("Booting another game will close the current game.\nDo you really want to boot another game?\n\nAny unsaved progress will be lost!\n"),
gui::ib_confirm_boot, &result, this);
@ -313,7 +313,7 @@ void main_window::Boot(const std::string& path, const std::string& title_id, boo
}
}
m_appIcon = gui::utils::get_app_icon_from_path(path, title_id);
m_app_icon = gui::utils::get_app_icon_from_path(path, title_id);
Emu.SetForceBoot(true);
Emu.Stop();
@ -332,7 +332,7 @@ void main_window::Boot(const std::string& path, const std::string& title_id, boo
}
}
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
}
void main_window::BootElf()
@ -345,7 +345,7 @@ void main_window::BootElf()
stopped = true;
}
QString path_last_ELF = guiSettings->GetValue(gui::fd_boot_elf).toString();
QString path_last_ELF = m_gui_settings->GetValue(gui::fd_boot_elf).toString();
QString filePath = QFileDialog::getOpenFileName(this, tr("Select (S)ELF To Boot"), path_last_ELF, tr(
"(S)ELF files (*BOOT.BIN *.elf *.self);;"
"ELF files (BOOT.BIN *.elf);;"
@ -364,7 +364,7 @@ void main_window::BootElf()
// If we resolved the filepath earlier we would end up setting the last opened dir to the unwanted
// game folder in case of having e.g. a Game Folder with collected links to elf files.
// Don't set last path earlier in case of cancelled dialog
guiSettings->SetValue(gui::fd_boot_elf, filePath);
m_gui_settings->SetValue(gui::fd_boot_elf, filePath);
const std::string path = sstr(QFileInfo(filePath).absoluteFilePath());
gui_log.notice("Booting from BootElf...");
@ -381,20 +381,19 @@ void main_window::BootGame()
stopped = true;
}
QString path_last_Game = guiSettings->GetValue(gui::fd_boot_game).toString();
QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select Game Folder"), path_last_Game, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
const QString path_last_Game = m_gui_settings->GetValue(gui::fd_boot_game).toString();
const QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Game Folder"), path_last_Game, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (dirPath == NULL)
if (dir_path.isEmpty())
{
if (stopped) Emu.Resume();
return;
}
guiSettings->SetValue(gui::fd_boot_game, QFileInfo(dirPath).path());
const std::string path = sstr(dirPath);
m_gui_settings->SetValue(gui::fd_boot_game, QFileInfo(dir_path).path());
gui_log.notice("Booting from BootGame...");
Boot(path);
Boot(sstr(dir_path));
}
void main_window::BootRsxCapture(std::string path)
@ -439,8 +438,8 @@ void main_window::InstallPackages(QStringList file_paths, bool show_confirm)
{
if (file_paths.isEmpty())
{
QString path_last_PKG = guiSettings->GetValue(gui::fd_install_pkg).toString();
const QString file_path = QFileDialog::getOpenFileName(this, tr("Select PKG To Install"), path_last_PKG, tr("PKG files (*.pkg);;All files (*.*)"));
const QString path_last_pkg = m_gui_settings->GetValue(gui::fd_install_pkg).toString();
const QString file_path = QFileDialog::getOpenFileName(this, tr("Select PKG To Install"), path_last_pkg, tr("PKG files (*.pkg);;All files (*.*)"));
if (!file_path.isEmpty())
{
@ -498,7 +497,7 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
const std::string path = sstr(file_path);
const std::string file_name = sstr(file_info.fileName());
guiSettings->SetValue(gui::fd_install_pkg, file_info.path());
m_gui_settings->SetValue(gui::fd_install_pkg, file_info.path());
// Run PKG unpacking asynchronously
named_thread worker("PKG Installer", [path, &progress]
@ -536,12 +535,12 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
if (worker())
{
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
gui_log.success("Successfully installed %s.", file_name);
if (i == (count - 1))
{
guiSettings->ShowInfoBox(tr("Success!"), tr("Successfully installed software from package(s)!"), gui::ib_pkg_success, this);
m_gui_settings->ShowInfoBox(tr("Success!"), tr("Successfully installed software from package(s)!"), gui::ib_pkg_success, this);
}
}
else
@ -566,8 +565,8 @@ void main_window::InstallPup(QString file_path)
{
if (file_path.isEmpty())
{
QString path_last_PUP = guiSettings->GetValue(gui::fd_install_pup).toString();
file_path = QFileDialog::getOpenFileName(this, tr("Select PS3UPDAT.PUP To Install"), path_last_PUP, tr("PS3 update file (PS3UPDAT.PUP);;All pup files (*.pup);;All files (*.*)"));
const QString path_last_pup = m_gui_settings->GetValue(gui::fd_install_pup).toString();
file_path = QFileDialog::getOpenFileName(this, tr("Select PS3UPDAT.PUP To Install"), path_last_pup, tr("PS3 update file (PS3UPDAT.PUP);;All pup files (*.pup);;All files (*.*)"));
}
else
{
@ -599,7 +598,7 @@ void main_window::HandlePupInstallation(QString file_path)
Emu.SetForceBoot(true);
Emu.Stop();
guiSettings->SetValue(gui::fd_install_pup, QFileInfo(file_path).path());
m_gui_settings->SetValue(gui::fd_install_pup, QFileInfo(file_path).path());
const std::string path = sstr(file_path);
fs::file pup_f(path);
@ -734,7 +733,7 @@ void main_window::HandlePupInstallation(QString file_path)
if (progress > 0)
{
gui_log.success("Successfully installed PS3 firmware version %s.", version_string);
guiSettings->ShowInfoBox(tr("Success!"), tr("Successfully installed PS3 firmware and LLE Modules!"), gui::ib_pup_success, this);
m_gui_settings->ShowInfoBox(tr("Success!"), tr("Successfully installed PS3 firmware and LLE Modules!"), gui::ib_pup_success, this);
Emu.SetForceBoot(true);
Emu.BootGame(g_cfg.vfs.get_dev_flash() + "sys/external/", "", true);
@ -746,8 +745,8 @@ extern void sysutil_send_system_cmd(u64 status, u64 param);
void main_window::DecryptSPRXLibraries()
{
QString path_last_SPRX = guiSettings->GetValue(gui::fd_decrypt_sprx).toString();
QStringList modules = QFileDialog::getOpenFileNames(this, tr("Select binary files"), path_last_SPRX, tr("All Binaries (*.BIN *.self *.sprx);;BIN files (*.BIN);;SELF files (*.self);;SPRX files (*.sprx);;All files (*.*)"));
const QString path_last_sprx = m_gui_settings->GetValue(gui::fd_decrypt_sprx).toString();
const QStringList modules = QFileDialog::getOpenFileNames(this, tr("Select binary files"), path_last_sprx, tr("All Binaries (*.BIN *.self *.sprx);;BIN files (*.BIN);;SELF files (*.self);;SPRX files (*.sprx);;All files (*.*)"));
if (modules.isEmpty())
{
@ -757,7 +756,7 @@ void main_window::DecryptSPRXLibraries()
Emu.SetForceBoot(true);
Emu.Stop();
guiSettings->SetValue(gui::fd_decrypt_sprx, QFileInfo(modules.first()).path());
m_gui_settings->SetValue(gui::fd_decrypt_sprx, QFileInfo(modules.first()).path());
gui_log.notice("Decrypting binaries...");
@ -802,14 +801,14 @@ void main_window::DecryptSPRXLibraries()
void main_window::SaveWindowState()
{
// Save gui settings
guiSettings->SetValue(gui::mw_geometry, saveGeometry());
guiSettings->SetValue(gui::mw_windowState, saveState());
guiSettings->SetValue(gui::mw_mwState, m_mw->saveState());
m_gui_settings->SetValue(gui::mw_geometry, saveGeometry());
m_gui_settings->SetValue(gui::mw_windowState, saveState());
m_gui_settings->SetValue(gui::mw_mwState, m_mw->saveState());
// Save column settings
m_gameListFrame->SaveSettings();
m_game_list_frame->SaveSettings();
// Save splitter state
m_debuggerFrame->SaveSettings();
m_debugger_frame->SaveSettings();
}
void main_window::RepaintThumbnailIcons()
@ -917,7 +916,7 @@ void main_window::OnEmuRun(bool /*start_playtime*/)
const QString pause_tooltip = tr("Pause %0").arg(title);
const QString stop_tooltip = tr("Stop %0").arg(title);
m_debuggerFrame->EnableButtons(true);
m_debugger_frame->EnableButtons(true);
#ifdef _WIN32
m_thumb_stop->setToolTip(stop_tooltip);
@ -972,9 +971,9 @@ void main_window::OnEmuPause()
ui->toolbar_start->setToolTip(resume_tooltip);
// Refresh game list in order to update time played
if (m_gameListFrame)
if (m_game_list_frame)
{
m_gameListFrame->Refresh();
m_game_list_frame->Refresh();
}
}
@ -984,8 +983,8 @@ void main_window::OnEmuStop()
const QString play_tooltip = Emu.IsReady() ? tr("Play %0").arg(title) : tr("Resume %0").arg(title);
const QString restart_tooltip = tr("Restart %0").arg(title);
m_debuggerFrame->EnableButtons(false);
m_debuggerFrame->ClearBreakpoints();
m_debugger_frame->EnableButtons(false);
m_debugger_frame->ClearBreakpoints();
ui->sysPauseAct->setText(Emu.IsReady() ? tr("&Play\tCtrl+E") : tr("&Resume\tCtrl+E"));
ui->sysPauseAct->setIcon(m_icon_play);
@ -1017,9 +1016,9 @@ void main_window::OnEmuStop()
ui->actionManage_Users->setEnabled(true);
// Refresh game list in order to update time played
if (m_gameListFrame)
if (m_game_list_frame)
{
m_gameListFrame->Refresh();
m_game_list_frame->Refresh();
}
}
@ -1028,7 +1027,7 @@ void main_window::OnEmuReady()
const QString title = GetCurrentTitle();
const QString play_tooltip = Emu.IsReady() ? tr("Play %0").arg(title) : tr("Resume %0").arg(title);
m_debuggerFrame->EnableButtons(true);
m_debugger_frame->EnableButtons(true);
#ifdef _WIN32
m_thumb_playPause->setToolTip(play_tooltip);
m_thumb_playPause->setIcon(m_icon_thumb_play);
@ -1103,25 +1102,25 @@ void main_window::BootRecentAction(const QAction* act)
if (containsPath)
{
// clear menu of actions
for (auto act : m_recentGameActs)
for (auto act : m_recent_game_acts)
{
ui->bootRecentMenu->removeAction(act);
}
// remove action from list
m_rg_entries.removeAt(idx);
m_recentGameActs.removeAt(idx);
m_recent_game_acts.removeAt(idx);
guiSettings->SetValue(gui::rg_entries, guiSettings->List2Var(m_rg_entries));
m_gui_settings->SetValue(gui::rg_entries, m_gui_settings->List2Var(m_rg_entries));
gui_log.error("Recent Game not valid, removed from Boot Recent list: %s", path);
// refill menu with actions
for (int i = 0; i < m_recentGameActs.count(); i++)
for (int i = 0; i < m_recent_game_acts.count(); i++)
{
m_recentGameActs[i]->setShortcut(tr("Ctrl+%1").arg(i + 1));
m_recentGameActs[i]->setToolTip(m_rg_entries.at(i).second);
ui->bootRecentMenu->addAction(m_recentGameActs[i]);
m_recent_game_acts[i]->setShortcut(tr("Ctrl+%1").arg(i + 1));
m_recent_game_acts[i]->setToolTip(m_rg_entries.at(i).second);
ui->bootRecentMenu->addAction(m_recent_game_acts[i]);
}
gui_log.warning("Boot Recent list refreshed");
@ -1148,7 +1147,7 @@ QAction* main_window::CreateRecentAction(const q_string_pair& entry, const uint&
int idx = m_rg_entries.indexOf(entry);
m_rg_entries.removeAt(idx);
guiSettings->SetValue(gui::rg_entries, guiSettings->List2Var(m_rg_entries));
m_gui_settings->SetValue(gui::rg_entries, m_gui_settings->List2Var(m_rg_entries));
}
return nullptr;
}
@ -1194,7 +1193,7 @@ void main_window::AddRecentAction(const q_string_pair& entry)
}
// clear menu of actions
for (auto act : m_recentGameActs)
for (auto act : m_recent_game_acts)
{
ui->bootRecentMenu->removeAction(act);
}
@ -1205,7 +1204,7 @@ void main_window::AddRecentAction(const q_string_pair& entry)
if (m_rg_entries[i].first == entry.first)
{
m_rg_entries.removeAt(i);
m_recentGameActs.removeAt(i);
m_recent_game_acts.removeAt(i);
}
}
@ -1213,7 +1212,7 @@ void main_window::AddRecentAction(const q_string_pair& entry)
if (m_rg_entries.count() == 9)
{
m_rg_entries.removeLast();
m_recentGameActs.removeLast();
m_recent_game_acts.removeLast();
}
else if (m_rg_entries.count() > 9)
{
@ -1224,18 +1223,18 @@ void main_window::AddRecentAction(const q_string_pair& entry)
{
// add new action at the beginning
m_rg_entries.prepend(entry);
m_recentGameActs.prepend(act);
m_recent_game_acts.prepend(act);
}
// refill menu with actions
for (int i = 0; i < m_recentGameActs.count(); i++)
for (int i = 0; i < m_recent_game_acts.count(); i++)
{
m_recentGameActs[i]->setShortcut(tr("Ctrl+%1").arg(i+1));
m_recentGameActs[i]->setToolTip(m_rg_entries.at(i).second);
ui->bootRecentMenu->addAction(m_recentGameActs[i]);
m_recent_game_acts[i]->setShortcut(tr("Ctrl+%1").arg(i+1));
m_recent_game_acts[i]->setToolTip(m_rg_entries.at(i).second);
ui->bootRecentMenu->addAction(m_recent_game_acts[i]);
}
guiSettings->SetValue(gui::rg_entries, guiSettings->List2Var(m_rg_entries));
m_gui_settings->SetValue(gui::rg_entries, m_gui_settings->List2Var(m_rg_entries));
}
void main_window::UpdateLanguageActions(const QStringList& language_codes, const QString& language_code)
@ -1266,19 +1265,19 @@ void main_window::UpdateLanguageActions(const QStringList& language_codes, const
void main_window::RepaintGui()
{
if (m_gameListFrame)
if (m_game_list_frame)
{
m_gameListFrame->RepaintIcons(true);
m_game_list_frame->RepaintIcons(true);
}
if (m_logFrame)
if (m_log_frame)
{
m_logFrame->RepaintTextColors();
m_log_frame->RepaintTextColors();
}
if (m_debuggerFrame)
if (m_debugger_frame)
{
m_debuggerFrame->ChangeColors();
m_debugger_frame->ChangeColors();
}
RepaintToolBarIcons();
@ -1293,17 +1292,17 @@ void main_window::RetranslateUI(const QStringList& language_codes, const QString
ui->retranslateUi(this);
if (m_gameListFrame)
if (m_game_list_frame)
{
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
}
}
void main_window::ShowTitleBars(bool show)
{
m_gameListFrame->SetTitleBarVisible(show);
m_debuggerFrame->SetTitleBarVisible(show);
m_logFrame->SetTitleBarVisible(show);
m_game_list_frame->SetTitleBarVisible(show);
m_debugger_frame->SetTitleBarVisible(show);
m_log_frame->SetTitleBarVisible(show);
}
void main_window::CreateActions()
@ -1313,28 +1312,28 @@ void main_window::CreateActions()
ui->toolbar_start->setEnabled(false);
ui->toolbar_stop->setEnabled(false);
m_categoryVisibleActGroup = new QActionGroup(this);
m_categoryVisibleActGroup->addAction(ui->showCatHDDGameAct);
m_categoryVisibleActGroup->addAction(ui->showCatDiscGameAct);
m_categoryVisibleActGroup->addAction(ui->showCatPS1GamesAct);
m_categoryVisibleActGroup->addAction(ui->showCatPS2GamesAct);
m_categoryVisibleActGroup->addAction(ui->showCatPSPGamesAct);
m_categoryVisibleActGroup->addAction(ui->showCatHomeAct);
m_categoryVisibleActGroup->addAction(ui->showCatAudioVideoAct);
m_categoryVisibleActGroup->addAction(ui->showCatGameDataAct);
m_categoryVisibleActGroup->addAction(ui->showCatUnknownAct);
m_categoryVisibleActGroup->addAction(ui->showCatOtherAct);
m_categoryVisibleActGroup->setExclusive(false);
m_category_visible_act_group = new QActionGroup(this);
m_category_visible_act_group->addAction(ui->showCatHDDGameAct);
m_category_visible_act_group->addAction(ui->showCatDiscGameAct);
m_category_visible_act_group->addAction(ui->showCatPS1GamesAct);
m_category_visible_act_group->addAction(ui->showCatPS2GamesAct);
m_category_visible_act_group->addAction(ui->showCatPSPGamesAct);
m_category_visible_act_group->addAction(ui->showCatHomeAct);
m_category_visible_act_group->addAction(ui->showCatAudioVideoAct);
m_category_visible_act_group->addAction(ui->showCatGameDataAct);
m_category_visible_act_group->addAction(ui->showCatUnknownAct);
m_category_visible_act_group->addAction(ui->showCatOtherAct);
m_category_visible_act_group->setExclusive(false);
m_iconSizeActGroup = new QActionGroup(this);
m_iconSizeActGroup->addAction(ui->setIconSizeTinyAct);
m_iconSizeActGroup->addAction(ui->setIconSizeSmallAct);
m_iconSizeActGroup->addAction(ui->setIconSizeMediumAct);
m_iconSizeActGroup->addAction(ui->setIconSizeLargeAct);
m_icon_size_act_group = new QActionGroup(this);
m_icon_size_act_group->addAction(ui->setIconSizeTinyAct);
m_icon_size_act_group->addAction(ui->setIconSizeSmallAct);
m_icon_size_act_group->addAction(ui->setIconSizeMediumAct);
m_icon_size_act_group->addAction(ui->setIconSizeLargeAct);
m_listModeActGroup = new QActionGroup(this);
m_listModeActGroup->addAction(ui->setlistModeListAct);
m_listModeActGroup->addAction(ui->setlistModeGridAct);
m_list_mode_act_group = new QActionGroup(this);
m_list_mode_act_group->addAction(ui->setlistModeListAct);
m_list_mode_act_group->addAction(ui->setlistModeGridAct);
}
void main_window::CreateConnects()
@ -1355,7 +1354,7 @@ void main_window::CreateConnects()
{
AddGamesFromDir(path);
}
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
}
});
@ -1376,29 +1375,29 @@ void main_window::CreateConnects()
{
if (ui->freezeRecentAct->isChecked()) { return; }
m_rg_entries.clear();
for (auto act : m_recentGameActs)
for (auto act : m_recent_game_acts)
{
ui->bootRecentMenu->removeAction(act);
}
m_recentGameActs.clear();
guiSettings->SetValue(gui::rg_entries, guiSettings->List2Var(q_pair_list()));
m_recent_game_acts.clear();
m_gui_settings->SetValue(gui::rg_entries, m_gui_settings->List2Var(q_pair_list()));
});
connect(ui->freezeRecentAct, &QAction::triggered, [this](bool checked)
{
guiSettings->SetValue(gui::rg_freeze, checked);
m_gui_settings->SetValue(gui::rg_freeze, checked);
});
connect(ui->bootInstallPkgAct, &QAction::triggered, [this] {InstallPackages(); });
connect(ui->bootInstallPupAct, &QAction::triggered, [this] {InstallPup(); });
connect(ui->exitAct, &QAction::triggered, this, &QWidget::close);
connect(ui->batchCreatePPUCachesAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchCreatePPUCaches);
connect(ui->batchRemovePPUCachesAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemovePPUCaches);
connect(ui->batchRemoveSPUCachesAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveSPUCaches);
connect(ui->batchRemoveShaderCachesAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveShaderCaches);
connect(ui->batchRemoveCustomConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomConfigurations);
connect(ui->batchRemoveCustomPadConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomPadConfigurations);
connect(ui->batchCreatePPUCachesAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchCreatePPUCaches);
connect(ui->batchRemovePPUCachesAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchRemovePPUCaches);
connect(ui->batchRemoveSPUCachesAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchRemoveSPUCaches);
connect(ui->batchRemoveShaderCachesAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchRemoveShaderCaches);
connect(ui->batchRemoveCustomConfigurationsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchRemoveCustomConfigurations);
connect(ui->batchRemoveCustomPadConfigurationsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::BatchRemoveCustomPadConfigurations);
connect(ui->removeDiskCacheAct, &QAction::triggered, this, &main_window::RemoveDiskCache);
@ -1420,13 +1419,13 @@ void main_window::CreateConnects()
auto openSettings = [this](int tabIndex)
{
settings_dialog dlg(guiSettings, emuSettings, tabIndex, this);
settings_dialog dlg(m_gui_settings, m_emu_settings, tabIndex, this);
connect(&dlg, &settings_dialog::GuiSettingsSaveRequest, this, &main_window::SaveWindowState);
connect(&dlg, &settings_dialog::GuiSettingsSyncRequest, this, &main_window::ConfigureGuiFromSettings);
connect(&dlg, &settings_dialog::GuiStylesheetRequest, this, &main_window::RequestGlobalStylesheetChange);
connect(&dlg, &settings_dialog::GuiRepaintRequest, this, &main_window::RepaintGui);
connect(&dlg, &settings_dialog::EmuSettingsApplied, this, &main_window::NotifyEmuSettingsChange);
connect(&dlg, &settings_dialog::EmuSettingsApplied, m_logFrame, &log_frame::LoadSettings);
connect(&dlg, &settings_dialog::EmuSettingsApplied, m_log_frame, &log_frame::LoadSettings);
dlg.exec();
};
@ -1468,21 +1467,21 @@ void main_window::CreateConnects()
connect(ui->confVFSDialogAct, &QAction::triggered, [this]()
{
vfs_dialog dlg(guiSettings, emuSettings, this);
vfs_dialog dlg(m_gui_settings, m_emu_settings, this);
dlg.exec();
m_gameListFrame->Refresh(true); // dev-hdd0 may have changed. Refresh just in case.
m_game_list_frame->Refresh(true); // dev-hdd0 may have changed. Refresh just in case.
});
connect(ui->confSavedataManagerAct, &QAction::triggered, [this]
{
save_manager_dialog* save_manager = new save_manager_dialog(guiSettings);
save_manager_dialog* save_manager = new save_manager_dialog(m_gui_settings);
connect(this, &main_window::RequestTrophyManagerRepaint, save_manager, &save_manager_dialog::HandleRepaintUiRequest);
save_manager->show();
});
connect(ui->actionManage_Trophy_Data, &QAction::triggered, [this]
{
trophy_manager_dialog* trop_manager = new trophy_manager_dialog(guiSettings);
trophy_manager_dialog* trop_manager = new trophy_manager_dialog(m_gui_settings);
connect(this, &main_window::RequestTrophyManagerRepaint, trop_manager, &trophy_manager_dialog::HandleRepaintUiRequest);
trop_manager->show();
});
@ -1501,14 +1500,14 @@ void main_window::CreateConnects()
connect(ui->actionManage_Users, &QAction::triggered, [this]
{
user_manager_dialog user_manager(guiSettings, this);
user_manager_dialog user_manager(m_gui_settings, this);
user_manager.exec();
m_gameListFrame->Refresh(true); // New user may have different games unlocked.
m_game_list_frame->Refresh(true); // New user may have different games unlocked.
});
connect(ui->toolsCgDisasmAct, &QAction::triggered, [this]
{
cg_disasm_window* cgdw = new cg_disasm_window(guiSettings);
cg_disasm_window* cgdw = new cg_disasm_window(m_gui_settings);
cgdw->show();
});
@ -1526,7 +1525,7 @@ void main_window::CreateConnects()
connect(ui->toolsRsxDebuggerAct, &QAction::triggered, [this]
{
rsx_debugger* rsx = new rsx_debugger(guiSettings);
rsx_debugger* rsx = new rsx_debugger(m_gui_settings);
rsx->show();
});
@ -1540,49 +1539,49 @@ void main_window::CreateConnects()
connect(ui->showDebuggerAct, &QAction::triggered, [this](bool checked)
{
checked ? m_debuggerFrame->show() : m_debuggerFrame->hide();
guiSettings->SetValue(gui::mw_debugger, checked);
checked ? m_debugger_frame->show() : m_debugger_frame->hide();
m_gui_settings->SetValue(gui::mw_debugger, checked);
});
connect(ui->showLogAct, &QAction::triggered, [this](bool checked)
{
checked ? m_logFrame->show() : m_logFrame->hide();
guiSettings->SetValue(gui::mw_logger, checked);
checked ? m_log_frame->show() : m_log_frame->hide();
m_gui_settings->SetValue(gui::mw_logger, checked);
});
connect(ui->showGameListAct, &QAction::triggered, [this](bool checked)
{
checked ? m_gameListFrame->show() : m_gameListFrame->hide();
guiSettings->SetValue(gui::mw_gamelist, checked);
checked ? m_game_list_frame->show() : m_game_list_frame->hide();
m_gui_settings->SetValue(gui::mw_gamelist, checked);
});
connect(ui->showTitleBarsAct, &QAction::triggered, [this](bool checked)
{
ShowTitleBars(checked);
guiSettings->SetValue(gui::mw_titleBarsVisible, checked);
m_gui_settings->SetValue(gui::mw_titleBarsVisible, checked);
});
connect(ui->showToolBarAct, &QAction::triggered, [this](bool checked)
{
ui->toolBar->setVisible(checked);
guiSettings->SetValue(gui::mw_toolBarVisible, checked);
m_gui_settings->SetValue(gui::mw_toolBarVisible, checked);
});
connect(ui->showHiddenEntriesAct, &QAction::triggered, [this](bool checked)
{
guiSettings->SetValue(gui::gl_show_hidden, checked);
m_gameListFrame->SetShowHidden(checked);
m_gameListFrame->Refresh();
m_gui_settings->SetValue(gui::gl_show_hidden, checked);
m_game_list_frame->SetShowHidden(checked);
m_game_list_frame->Refresh();
});
connect(ui->showCompatibilityInGridAct, &QAction::triggered, m_gameListFrame, &game_list_frame::SetShowCompatibilityInGrid);
connect(ui->showCompatibilityInGridAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetShowCompatibilityInGrid);
connect(ui->refreshGameListAct, &QAction::triggered, [this]
{
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
});
connect(m_categoryVisibleActGroup, &QActionGroup::triggered, [this](QAction* act)
connect(m_category_visible_act_group, &QActionGroup::triggered, [this](QAction* act)
{
QStringList categories;
int id = 0;
@ -1602,8 +1601,8 @@ void main_window::CreateConnects()
if (!categories.isEmpty())
{
m_gameListFrame->ToggleCategoryFilter(categories, checked);
guiSettings->SetCategoryVisibility(id, checked);
m_game_list_frame->ToggleCategoryFilter(categories, checked);
m_gui_settings->SetCategoryVisibility(id, checked);
}
});
@ -1629,7 +1628,7 @@ void main_window::CreateConnects()
connect(ui->aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
connect(m_iconSizeActGroup, &QActionGroup::triggered, [this](QAction* act)
connect(m_icon_size_act_group, &QActionGroup::triggered, [this](QAction* act)
{
static const int index_small = gui::get_Index(gui::gl_icon_size_small);
static const int index_medium = gui::get_Index(gui::gl_icon_size_medium);
@ -1649,14 +1648,14 @@ void main_window::CreateConnects()
ResizeIcons(index);
});
connect (m_gameListFrame, &game_list_frame::RequestIconSizeChange, [this](const int& val)
connect(m_game_list_frame, &game_list_frame::RequestIconSizeChange, [this](const int& val)
{
const int idx = ui->sizeSlider->value() + val;
m_save_slider_pos = true;
ResizeIcons(idx);
});
connect(m_listModeActGroup, &QActionGroup::triggered, [this](QAction* act)
connect(m_list_mode_act_group, &QActionGroup::triggered, [this](QAction* act)
{
bool is_list_act = act == ui->setlistModeListAct;
if (is_list_act == m_is_list_mode)
@ -1668,12 +1667,12 @@ void main_window::CreateConnects()
m_other_slider_pos = slider_pos;
m_is_list_mode = is_list_act;
m_gameListFrame->SetListMode(m_is_list_mode);
m_categoryVisibleActGroup->setEnabled(m_is_list_mode);
m_game_list_frame->SetListMode(m_is_list_mode);
m_category_visible_act_group->setEnabled(m_is_list_mode);
});
connect(ui->toolbar_open, &QAction::triggered, this, &main_window::BootGame);
connect(ui->toolbar_refresh, &QAction::triggered, [this]() { m_gameListFrame->Refresh(true); });
connect(ui->toolbar_refresh, &QAction::triggered, [this]() { m_game_list_frame->Refresh(true); });
connect(ui->toolbar_stop, &QAction::triggered, [this]() { Emu.Stop(); });
connect(ui->toolbar_start, &QAction::triggered, this, &main_window::OnPlayOrPause);
@ -1700,7 +1699,7 @@ void main_window::CreateConnects()
connect(ui->sizeSlider, &QSlider::sliderReleased, this, [&]
{
const int index = ui->sizeSlider->value();
guiSettings->SetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid, index);
m_gui_settings->SetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid, index);
SetIconSizeActions(index);
});
connect(ui->sizeSlider, &QSlider::actionTriggered, [&](int action)
@ -1711,7 +1710,7 @@ void main_window::CreateConnects()
}
});
connect(ui->mw_searchbar, &QLineEdit::textChanged, m_gameListFrame, &game_list_frame::SetSearchText);
connect(ui->mw_searchbar, &QLineEdit::textChanged, m_game_list_frame, &game_list_frame::SetSearchText);
}
void main_window::CreateDockWindows()
@ -1720,48 +1719,48 @@ void main_window::CreateDockWindows()
m_mw = new QMainWindow();
m_mw->setContextMenuPolicy(Qt::PreventContextMenu);
m_gameListFrame = new game_list_frame(guiSettings, emuSettings, m_persistent_settings, m_mw);
m_gameListFrame->setObjectName("gamelist");
m_debuggerFrame = new debugger_frame(guiSettings, m_mw);
m_debuggerFrame->setObjectName("debugger");
m_logFrame = new log_frame(guiSettings, m_mw);
m_logFrame->setObjectName("logger");
m_game_list_frame = new game_list_frame(m_gui_settings, m_emu_settings, m_persistent_settings, m_mw);
m_game_list_frame->setObjectName("gamelist");
m_debugger_frame = new debugger_frame(m_gui_settings, m_mw);
m_debugger_frame->setObjectName("debugger");
m_log_frame = new log_frame(m_gui_settings, m_mw);
m_log_frame->setObjectName("logger");
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_gameListFrame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_logFrame);
m_mw->addDockWidget(Qt::RightDockWidgetArea, m_debuggerFrame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_game_list_frame);
m_mw->addDockWidget(Qt::LeftDockWidgetArea, m_log_frame);
m_mw->addDockWidget(Qt::RightDockWidgetArea, m_debugger_frame);
m_mw->setDockNestingEnabled(true);
m_mw->resizeDocks({ m_logFrame }, { m_mw->sizeHint().height() / 10 }, Qt::Orientation::Vertical);
m_mw->resizeDocks({ m_log_frame }, { m_mw->sizeHint().height() / 10 }, Qt::Orientation::Vertical);
setCentralWidget(m_mw);
connect(m_logFrame, &log_frame::LogFrameClosed, [this]()
connect(m_log_frame, &log_frame::LogFrameClosed, [this]()
{
if (ui->showLogAct->isChecked())
{
ui->showLogAct->setChecked(false);
guiSettings->SetValue(gui::mw_logger, false);
m_gui_settings->SetValue(gui::mw_logger, false);
}
});
connect(m_debuggerFrame, &debugger_frame::DebugFrameClosed, [this]()
connect(m_debugger_frame, &debugger_frame::DebugFrameClosed, [this]()
{
if (ui->showDebuggerAct->isChecked())
{
ui->showDebuggerAct->setChecked(false);
guiSettings->SetValue(gui::mw_debugger, false);
m_gui_settings->SetValue(gui::mw_debugger, false);
}
});
connect(m_gameListFrame, &game_list_frame::GameListFrameClosed, [this]()
connect(m_game_list_frame, &game_list_frame::GameListFrameClosed, [this]()
{
if (ui->showGameListAct->isChecked())
{
ui->showGameListAct->setChecked(false);
guiSettings->SetValue(gui::mw_gamelist, false);
m_gui_settings->SetValue(gui::mw_gamelist, false);
}
});
connect(m_gameListFrame, &game_list_frame::NotifyGameSelection, [this](const game_info& game)
connect(m_game_list_frame, &game_list_frame::NotifyGameSelection, [this](const game_info& game)
{
// Only change the button logic while the emulator is stopped.
if (Emu.IsStopped())
@ -1802,9 +1801,9 @@ void main_window::CreateDockWindows()
ui->toolbar_start->setIcon(m_icon_restart);
ui->toolbar_start->setText(tr("Restart"));
}
else if (!m_recentGameActs.isEmpty()) // Get last played game
else if (!m_recent_game_acts.isEmpty()) // Get last played game
{
tooltip = tr("Play %0").arg(m_recentGameActs.first()->text());
tooltip = tr("Play %0").arg(m_recent_game_acts.first()->text());
}
else
{
@ -1824,36 +1823,36 @@ void main_window::CreateDockWindows()
m_selected_game = game;
});
connect(m_gameListFrame, &game_list_frame::RequestBoot, [this](const game_info& game, bool force_global_config)
connect(m_game_list_frame, &game_list_frame::RequestBoot, [this](const game_info& game, bool force_global_config)
{
Boot(game->info.path, game->info.serial, false, false, force_global_config);
});
connect(m_gameListFrame, &game_list_frame::NotifyEmuSettingsChange, this, &main_window::NotifyEmuSettingsChange);
connect(m_game_list_frame, &game_list_frame::NotifyEmuSettingsChange, this, &main_window::NotifyEmuSettingsChange);
}
void main_window::ConfigureGuiFromSettings(bool configure_all)
{
// Restore GUI state if needed. We need to if they exist.
if (!restoreGeometry(guiSettings->GetValue(gui::mw_geometry).toByteArray()))
if (!restoreGeometry(m_gui_settings->GetValue(gui::mw_geometry).toByteArray()))
{
// By default, set the window to 70% of the screen and the debugger frame is hidden.
m_debuggerFrame->hide();
m_debugger_frame->hide();
resize(QGuiApplication::primaryScreen()->availableSize() * 0.7);
}
restoreState(guiSettings->GetValue(gui::mw_windowState).toByteArray());
m_mw->restoreState(guiSettings->GetValue(gui::mw_mwState).toByteArray());
restoreState(m_gui_settings->GetValue(gui::mw_windowState).toByteArray());
m_mw->restoreState(m_gui_settings->GetValue(gui::mw_mwState).toByteArray());
ui->freezeRecentAct->setChecked(guiSettings->GetValue(gui::rg_freeze).toBool());
m_rg_entries = guiSettings->Var2List(guiSettings->GetValue(gui::rg_entries));
ui->freezeRecentAct->setChecked(m_gui_settings->GetValue(gui::rg_freeze).toBool());
m_rg_entries = m_gui_settings->Var2List(m_gui_settings->GetValue(gui::rg_entries));
// clear recent games menu of actions
for (auto act : m_recentGameActs)
for (auto act : m_recent_game_acts)
{
ui->bootRecentMenu->removeAction(act);
}
m_recentGameActs.clear();
m_recent_game_acts.clear();
// Fill the recent games menu
for (int i = 0; i < m_rg_entries.count(); i++)
@ -1867,7 +1866,7 @@ void main_window::ConfigureGuiFromSettings(bool configure_all)
// add action to menu
if (act)
{
m_recentGameActs.append(act);
m_recent_game_acts.append(act);
ui->bootRecentMenu->addAction(act);
}
else
@ -1877,57 +1876,57 @@ void main_window::ConfigureGuiFromSettings(bool configure_all)
}
// hide utilities from the average user
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(gui::m_showDebugTab).toBool());
ui->menuUtilities->menuAction()->setVisible(m_gui_settings->GetValue(gui::m_showDebugTab).toBool());
ui->showLogAct->setChecked(guiSettings->GetValue(gui::mw_logger).toBool());
ui->showGameListAct->setChecked(guiSettings->GetValue(gui::mw_gamelist).toBool());
ui->showDebuggerAct->setChecked(guiSettings->GetValue(gui::mw_debugger).toBool());
ui->showToolBarAct->setChecked(guiSettings->GetValue(gui::mw_toolBarVisible).toBool());
ui->showTitleBarsAct->setChecked(guiSettings->GetValue(gui::mw_titleBarsVisible).toBool());
ui->showLogAct->setChecked(m_gui_settings->GetValue(gui::mw_logger).toBool());
ui->showGameListAct->setChecked(m_gui_settings->GetValue(gui::mw_gamelist).toBool());
ui->showDebuggerAct->setChecked(m_gui_settings->GetValue(gui::mw_debugger).toBool());
ui->showToolBarAct->setChecked(m_gui_settings->GetValue(gui::mw_toolBarVisible).toBool());
ui->showTitleBarsAct->setChecked(m_gui_settings->GetValue(gui::mw_titleBarsVisible).toBool());
m_debuggerFrame->setVisible(ui->showDebuggerAct->isChecked());
m_logFrame->setVisible(ui->showLogAct->isChecked());
m_gameListFrame->setVisible(ui->showGameListAct->isChecked());
m_debugger_frame->setVisible(ui->showDebuggerAct->isChecked());
m_log_frame->setVisible(ui->showLogAct->isChecked());
m_game_list_frame->setVisible(ui->showGameListAct->isChecked());
ui->toolBar->setVisible(ui->showToolBarAct->isChecked());
ShowTitleBars(ui->showTitleBarsAct->isChecked());
ui->showHiddenEntriesAct->setChecked(guiSettings->GetValue(gui::gl_show_hidden).toBool());
m_gameListFrame->SetShowHidden(ui->showHiddenEntriesAct->isChecked()); // prevent GetValue in m_gameListFrame->LoadSettings
ui->showHiddenEntriesAct->setChecked(m_gui_settings->GetValue(gui::gl_show_hidden).toBool());
m_game_list_frame->SetShowHidden(ui->showHiddenEntriesAct->isChecked()); // prevent GetValue in m_game_list_frame->LoadSettings
ui->showCompatibilityInGridAct->setChecked(guiSettings->GetValue(gui::gl_draw_compat).toBool());
ui->showCompatibilityInGridAct->setChecked(m_gui_settings->GetValue(gui::gl_draw_compat).toBool());
ui->showCatHDDGameAct->setChecked(guiSettings->GetCategoryVisibility(Category::HDD_Game));
ui->showCatDiscGameAct->setChecked(guiSettings->GetCategoryVisibility(Category::Disc_Game));
ui->showCatPS1GamesAct->setChecked(guiSettings->GetCategoryVisibility(Category::PS1_Game));
ui->showCatPS2GamesAct->setChecked(guiSettings->GetCategoryVisibility(Category::PS2_Game));
ui->showCatPSPGamesAct->setChecked(guiSettings->GetCategoryVisibility(Category::PSP_Game));
ui->showCatHomeAct->setChecked(guiSettings->GetCategoryVisibility(Category::Home));
ui->showCatAudioVideoAct->setChecked(guiSettings->GetCategoryVisibility(Category::Media));
ui->showCatGameDataAct->setChecked(guiSettings->GetCategoryVisibility(Category::Data));
ui->showCatUnknownAct->setChecked(guiSettings->GetCategoryVisibility(Category::Unknown_Cat));
ui->showCatOtherAct->setChecked(guiSettings->GetCategoryVisibility(Category::Others));
ui->showCatHDDGameAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::HDD_Game));
ui->showCatDiscGameAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Disc_Game));
ui->showCatPS1GamesAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::PS1_Game));
ui->showCatPS2GamesAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::PS2_Game));
ui->showCatPSPGamesAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::PSP_Game));
ui->showCatHomeAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Home));
ui->showCatAudioVideoAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Media));
ui->showCatGameDataAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Data));
ui->showCatUnknownAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Unknown_Cat));
ui->showCatOtherAct->setChecked(m_gui_settings->GetCategoryVisibility(Category::Others));
// handle icon size options
m_is_list_mode = guiSettings->GetValue(gui::gl_listMode).toBool();
m_is_list_mode = m_gui_settings->GetValue(gui::gl_listMode).toBool();
if (m_is_list_mode)
ui->setlistModeListAct->setChecked(true);
else
ui->setlistModeGridAct->setChecked(true);
m_categoryVisibleActGroup->setEnabled(m_is_list_mode);
m_category_visible_act_group->setEnabled(m_is_list_mode);
int icon_size_index = guiSettings->GetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid).toInt();
m_other_slider_pos = guiSettings->GetValue(!m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid).toInt();
int icon_size_index = m_gui_settings->GetValue(m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid).toInt();
m_other_slider_pos = m_gui_settings->GetValue(!m_is_list_mode ? gui::gl_iconSize : gui::gl_iconSizeGrid).toInt();
ui->sizeSlider->setSliderPosition(icon_size_index);
SetIconSizeActions(icon_size_index);
if (configure_all)
{
// Handle log settings
m_logFrame->LoadSettings();
m_log_frame->LoadSettings();
// Gamelist
m_gameListFrame->LoadSettings();
m_game_list_frame->LoadSettings();
}
}
@ -1996,11 +1995,11 @@ void main_window::mouseDoubleClickEvent(QMouseEvent *event)
*/
void main_window::closeEvent(QCloseEvent* closeEvent)
{
if (!Emu.IsStopped() && guiSettings->GetValue(gui::ib_confirm_exit).toBool())
if (!Emu.IsStopped() && m_gui_settings->GetValue(gui::ib_confirm_exit).toBool())
{
int result = QMessageBox::Yes;
guiSettings->ShowConfirmationBox(tr("Exit RPCS3?"),
m_gui_settings->ShowConfirmationBox(tr("Exit RPCS3?"),
tr("A game is currently running. Do you really want to close RPCS3?\n\nAny unsaved progress will be lost!\n"),
gui::ib_confirm_exit, &result, nullptr);
@ -2180,14 +2179,14 @@ void main_window::dropEvent(QDropEvent* event)
}
// Refresh game list since we probably unlocked some games now.
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
break;
case drop_type::drop_dir: // import valid games to gamelist (games.yaml)
for (const auto& path : dropPaths)
{
AddGamesFromDir(path);
}
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
break;
case drop_type::drop_game: // import valid games to gamelist (games.yaml)
if (const auto error = Emu.BootGame(sstr(dropPaths.first()), "", true); error != game_boot_result::no_errors)
@ -2198,7 +2197,7 @@ void main_window::dropEvent(QDropEvent* event)
else
{
gui_log.success("Elf Boot from drag and drop done: %s", sstr(dropPaths.first()));
m_gameListFrame->Refresh(true);
m_game_list_frame->Refresh(true);
}
break;
case drop_type::drop_rrc: // replay a rsx capture file