diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-09-07 19:24:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-07 19:24:25 +0200 |
| commit | 14bd0fbf4bcfe626608b6dac2b2ca28d808090ff (patch) | |
| tree | def52750db99e7c581e0d6d3a909209e397f9e1e /Source/Core | |
| parent | c472462498c1c33aa54cab06b418e7f6d1f787c3 (diff) | |
| parent | 8f8e96f59f91bd51dd9c4f32a550ddb6bceb8c52 (diff) | |
Merge pull request #6029 from spycrab/qt_change_disc
Qt/GameList: Add "Change Disc" option
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt2/GameList/GameList.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/DolphinQt2/GameList/GameList.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp index d59bf0bfc7..95357eb304 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.cpp +++ b/Source/Core/DolphinQt2/GameList/GameList.cpp @@ -20,6 +20,7 @@ #include "Common/FileUtil.h" #include "Core/ConfigManager.h" #include "Core/Core.h" +#include "Core/HW/DVD/DVDInterface.h" #include "DiscIO/Blob.h" #include "DiscIO/Enums.h" @@ -170,6 +171,15 @@ void GameList::ShowContextMenu(const QPoint&) else if (blob_type == DiscIO::BlobType::PLAIN) AddAction(menu, tr("Compress ISO..."), this, &GameList::CompressISO); + QAction* change_disc = menu->addAction(tr("Change &Disc"), this, &GameList::ChangeDisc); + + connect(this, &GameList::EmulationStarted, change_disc, + [change_disc] { change_disc->setEnabled(true); }); + connect(this, &GameList::EmulationStopped, change_disc, + [change_disc] { change_disc->setEnabled(false); }); + + change_disc->setEnabled(Core::IsRunning()); + menu->addSeparator(); } @@ -410,6 +420,11 @@ void GameList::DeleteFile() } } +void GameList::ChangeDisc() +{ + DVDInterface::ChangeDiscAsHost(GetSelectedGame()->GetFilePath().toStdString()); +} + QSharedPointer<GameFile> GameList::GetSelectedGame() const { QAbstractItemView* view; diff --git a/Source/Core/DolphinQt2/GameList/GameList.h b/Source/Core/DolphinQt2/GameList/GameList.h index e01d32f0ad..3121ef9c98 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.h +++ b/Source/Core/DolphinQt2/GameList/GameList.h @@ -46,6 +46,7 @@ private: void UninstallWAD(); void ExportWiiSave(); void CompressISO(); + void ChangeDisc(); void OnHeaderViewChanged(); void MakeListView(); |
