|
|
@ -894,6 +894,8 @@ void GMainWindow::ConnectMenuEvents() {
|
|
|
|
connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ);
|
|
|
|
connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ);
|
|
|
|
connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
|
|
|
|
connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
|
|
|
|
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
|
|
|
|
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
|
|
|
|
|
|
|
|
connect(ui.action_Configure_Current_Game, &QAction::triggered, this,
|
|
|
|
|
|
|
|
&GMainWindow::OnConfigurePerGame);
|
|
|
|
|
|
|
|
|
|
|
|
// View
|
|
|
|
// View
|
|
|
|
connect(ui.action_Single_Window_Mode, &QAction::triggered, this,
|
|
|
|
connect(ui.action_Single_Window_Mode, &QAction::triggered, this,
|
|
|
@ -1167,6 +1169,7 @@ void GMainWindow::ShutdownGame() {
|
|
|
|
ui.action_Pause->setEnabled(false);
|
|
|
|
ui.action_Pause->setEnabled(false);
|
|
|
|
ui.action_Stop->setEnabled(false);
|
|
|
|
ui.action_Stop->setEnabled(false);
|
|
|
|
ui.action_Restart->setEnabled(false);
|
|
|
|
ui.action_Restart->setEnabled(false);
|
|
|
|
|
|
|
|
ui.action_Configure_Current_Game->setEnabled(false);
|
|
|
|
ui.action_Report_Compatibility->setEnabled(false);
|
|
|
|
ui.action_Report_Compatibility->setEnabled(false);
|
|
|
|
ui.action_Load_Amiibo->setEnabled(false);
|
|
|
|
ui.action_Load_Amiibo->setEnabled(false);
|
|
|
|
ui.action_Capture_Screenshot->setEnabled(false);
|
|
|
|
ui.action_Capture_Screenshot->setEnabled(false);
|
|
|
@ -1718,26 +1721,7 @@ void GMainWindow::OnGameListOpenPerGameProperties(const std::string& file) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ConfigurePerGame dialog(this, title_id);
|
|
|
|
OpenPerGameConfiguration(title_id, file);
|
|
|
|
dialog.LoadFromFile(v_file);
|
|
|
|
|
|
|
|
auto result = dialog.exec();
|
|
|
|
|
|
|
|
if (result == QDialog::Accepted) {
|
|
|
|
|
|
|
|
dialog.ApplyConfiguration();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false);
|
|
|
|
|
|
|
|
if (reload) {
|
|
|
|
|
|
|
|
game_list->PopulateAsync(UISettings::values.game_dirs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do not cause the global config to write local settings into the config file
|
|
|
|
|
|
|
|
Settings::RestoreGlobalState();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Core::System::GetInstance().IsPoweredOn()) {
|
|
|
|
|
|
|
|
config->Save();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Settings::RestoreGlobalState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnMenuLoadFile() {
|
|
|
|
void GMainWindow::OnMenuLoadFile() {
|
|
|
@ -2066,6 +2050,7 @@ void GMainWindow::OnStartGame() {
|
|
|
|
ui.action_Pause->setEnabled(true);
|
|
|
|
ui.action_Pause->setEnabled(true);
|
|
|
|
ui.action_Stop->setEnabled(true);
|
|
|
|
ui.action_Stop->setEnabled(true);
|
|
|
|
ui.action_Restart->setEnabled(true);
|
|
|
|
ui.action_Restart->setEnabled(true);
|
|
|
|
|
|
|
|
ui.action_Configure_Current_Game->setEnabled(true);
|
|
|
|
ui.action_Report_Compatibility->setEnabled(true);
|
|
|
|
ui.action_Report_Compatibility->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
|
|
discord_rpc->Update();
|
|
|
|
discord_rpc->Update();
|
|
|
@ -2255,6 +2240,36 @@ void GMainWindow::OnConfigure() {
|
|
|
|
UpdateStatusButtons();
|
|
|
|
UpdateStatusButtons();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnConfigurePerGame() {
|
|
|
|
|
|
|
|
const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
|
|
|
|
|
|
|
|
OpenPerGameConfiguration(title_id, game_path.toStdString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file_name) {
|
|
|
|
|
|
|
|
const auto v_file = Core::GetGameFileFromPath(vfs, file_name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConfigurePerGame dialog(this, title_id);
|
|
|
|
|
|
|
|
dialog.LoadFromFile(v_file);
|
|
|
|
|
|
|
|
auto result = dialog.exec();
|
|
|
|
|
|
|
|
if (result == QDialog::Accepted) {
|
|
|
|
|
|
|
|
dialog.ApplyConfiguration();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false);
|
|
|
|
|
|
|
|
if (reload) {
|
|
|
|
|
|
|
|
game_list->PopulateAsync(UISettings::values.game_dirs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do not cause the global config to write local settings into the config file
|
|
|
|
|
|
|
|
Settings::RestoreGlobalState();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Core::System::GetInstance().IsPoweredOn()) {
|
|
|
|
|
|
|
|
config->Save();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Settings::RestoreGlobalState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnLoadAmiibo() {
|
|
|
|
void GMainWindow::OnLoadAmiibo() {
|
|
|
|
const QString extensions{QStringLiteral("*.bin")};
|
|
|
|
const QString extensions{QStringLiteral("*.bin")};
|
|
|
|
const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
|
|
|
|
const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
|
|
|
|