Merge pull request #6029 from spycrab/qt_change_disc

Qt/GameList: Add "Change Disc" option
This commit is contained in:
Leo Lam 2017-09-07 19:24:26 +02:00 committed by GitHub
commit 14bd0fbf4b
2 changed files with 16 additions and 0 deletions

View File

@ -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;

View File

@ -46,6 +46,7 @@ private:
void UninstallWAD();
void ExportWiiSave();
void CompressISO();
void ChangeDisc();
void OnHeaderViewChanged();
void MakeListView();