diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 9afcdafa17..f91615f4f9 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -597,6 +597,8 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) globalPos = m_xgrid->mapToGlobal(pos); } + GameInfo currGame = m_game_data[row].info; + QMenu myMenu; // Make Actions @@ -616,7 +618,7 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) connect(boot, &QAction::triggered, [=]() {Boot(row); }); connect(configure, &QAction::triggered, [=]() { - settings_dialog (xgui_settings, m_Render_Creator, 0, this, &m_game_data[row].info).exec(); + settings_dialog (xgui_settings, m_Render_Creator, 0, this, &currGame).exec(); }); connect(removeGame, &QAction::triggered, [=]() { if (QMessageBox::question(this, tr("Confirm Delete"), tr("Permanently delete files?")) == QMessageBox::Yes) @@ -627,16 +629,15 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) } }); connect(removeConfig, &QAction::triggered, [=]() {RemoveCustomConfiguration(row); }); - connect(openGameFolder, &QAction::triggered, [=]() {open_dir(Emu.GetGameDir() + m_game_data[row].info.root); }); - connect(openConfig, &QAction::triggered, [=]() {open_dir(fs::get_config_dir() + "data/" + m_game_data[row].info.serial); }); + connect(openGameFolder, &QAction::triggered, [=]() {open_dir(Emu.GetGameDir() + currGame.root); }); + connect(openConfig, &QAction::triggered, [=]() {open_dir(fs::get_config_dir() + "data/" + currGame.serial); }); connect(checkCompat, &QAction::triggered, [=]() { - QString serial = qstr(m_game_data[row].info.serial); - QString link = "https://rpcs3.net/compatibility?g=" + serial; + QString link = "https://rpcs3.net/compatibility?g=" + qstr(currGame.serial); QDesktopServices::openUrl(QUrl(link)); }); //Disable options depending on software category - QString category = qstr(m_game_data[row].info.category); + QString category = qstr(currGame.category); if (category == category::disc_Game) { @@ -655,6 +656,12 @@ void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row) checkCompat->setEnabled(false); } + // Disable removeconfig if no config exists. + if (fs::is_file(fs::get_config_dir() + "data/" + currGame.serial + "/config.yml") == false) + { + removeConfig->setEnabled(false); + } + myMenu.exec(globalPos); } diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index a122fd40d8..61d2999db2 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -22,7 +22,7 @@ inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } -settings_dialog::settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex, QWidget *parent, GameInfo* game) +settings_dialog::settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex, QWidget *parent, const GameInfo* game) : QDialog(parent), xgui_settings(xSettings), ui(new Ui::settings_dialog) { ui->setupUi(this); diff --git a/rpcs3/rpcs3qt/settings_dialog.h b/rpcs3/rpcs3qt/settings_dialog.h index cb1b462262..ee870bac9a 100644 --- a/rpcs3/rpcs3qt/settings_dialog.h +++ b/rpcs3/rpcs3qt/settings_dialog.h @@ -19,7 +19,7 @@ class settings_dialog : public QDialog Q_OBJECT public: - explicit settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex = 0, QWidget *parent = 0, GameInfo *game = nullptr); + explicit settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex = 0, QWidget *parent = 0, const GameInfo *game = nullptr); Q_SIGNALS: void GuiSettingsSyncRequest(); void GuiStylesheetRequest(const QString& path);