-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt: Add missing gamelist contextmenu options #5353
Conversation
|
||
if (deletion_successful) | ||
{ | ||
// TODO Reload the game list |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -65,6 +65,10 @@ class GameFile final | |||
QString GetLongName(DiscIO::Language lang) const { return m_long_names[lang]; } | |||
QString GetLongMaker(DiscIO::Language lang) const { return m_long_makers[lang]; } | |||
QString GetDescription(DiscIO::Language lang) const { return m_descriptions[lang]; } | |||
// Actions |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QMenu* menu = new QMenu(this); | ||
DiscIO::Platform platform = GameFile(GetSelectedGame()).GetPlatformID(); | ||
menu->addAction(tr("Properties"), this, SLOT(OpenProperties()), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
void GameList::OpenContainingFolder() | ||
{ | ||
std::cout << GameFile(GetSelectedGame()).GetInternalName().toStdString() << std::endl; | ||
QString url = QStringLiteral("file://").append(QFileInfo(GetSelectedGame()).dir().absolutePath()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
const std::string path = | ||
StringFromFormat("%s/title/%08x/%08x/data/", File::GetUserPath(D_WIIROOT_IDX).c_str(), | ||
(u32)(title_id >> 32), (u32)title_id); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -52,6 +52,7 @@ class GameFile final | |||
DiscIO::Country GetCountryID() const { return m_country; } | |||
QString GetCountry() const; | |||
DiscIO::BlobType GetBlobType() const { return m_blob_type; } | |||
QString GetWiiFSPath(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void GameList::OpenSaveFolder() | ||
{ | ||
QString url = QStringLiteral("file://").append(GameFile(GetSelectedGame()).GetWiiFSPath()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
if (deletion_successful) | ||
{ | ||
// TODO Reload the game list |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -105,18 +112,36 @@ void GameList::MakeListView() | |||
|
|||
void GameList::ShowContextMenu(const QPoint&) | |||
{ | |||
if (GetSelectedGame().isEmpty()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
1578ccc
to
4177a39
Compare
@@ -21,6 +23,8 @@ | |||
static const int CACHE_VERSION = 13; // Last changed in PR #3261 | |||
static const int DATASTREAM_VERSION = QDataStream::Qt_5_5; | |||
|
|||
u64 GetTitleID(QString); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QString file_types; | ||
QString default_file = QFileInfo(GetSelectedGame()).dir().absoluteFilePath(file.GetGameID()); | ||
|
||
std::cout << default_file.toStdString() << std::endl; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
16384, &CompressCB, &progress_dialog); | ||
|
||
if (good) | ||
QMessageBox(QMessageBox::Information, tr("Success!"), tr("Successfully compressed image."), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
const auto original_path = GetSelectedGame(); | ||
auto file = GameFile(original_path); | ||
|
||
bool compressed = file.GetBlobType() == DiscIO::BlobType::GCZ; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
if (ptr == nullptr) | ||
return false; | ||
auto* prg = reinterpret_cast<QProgressDialog*>(ptr); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
bool good; | ||
|
||
if (compressed) | ||
good = DiscIO::DecompressBlobToFile(original_path.toStdString(), dst_path.toStdString(), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
prg->setValue(percent * 100); | ||
return !prg->wasCanceled(); | ||
} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
740456e
to
f751b8f
Compare
c2581b2
to
730af06
Compare
@@ -21,6 +23,8 @@ | |||
static const int CACHE_VERSION = 13; // Last changed in PR #3261 | |||
static const int DATASTREAM_VERSION = QDataStream::Qt_5_5; | |||
|
|||
static inline u64 GetTitleID(const QString&); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -291,6 +295,79 @@ QString GameFile::GetLanguage(DiscIO::Language lang) const | |||
} | |||
} | |||
|
|||
bool GameFile::IsInstalled() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
const bool compressed = (file.GetBlobType() == DiscIO::BlobType::GCZ); | ||
|
||
QString label_text = tr("Select where you want to save the "); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
menu->addAction(tr("Default ISO"), this, SLOT(SetDefaultISO()), | ||
QKeySequence(tr("D", "Set as Default ISO"))); | ||
menu->addAction(GameFile(game).GetBlobType() == DiscIO::BlobType::GCZ ? tr("Decompress ISO") : | ||
tr("Compress ISO"), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
const auto volume = DiscIO::CreateVolumeFromFilename(path.toStdString()); | ||
|
||
u64 title_id; | ||
volume->GetTitleID(&title_id); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
wii_warning.setIcon(QMessageBox::Warning); | ||
wii_warning.setText(tr("Are you sure?")); | ||
wii_warning.setInformativeText(tr("Compressing Wii ISOs is an irreversible process. Your " | ||
"image will keep working as usual.")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MenuBar.cpp
Outdated
} | ||
|
||
result_dialog.exec(); | ||
} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -21,6 +23,16 @@ | |||
static const int CACHE_VERSION = 13; // Last changed in PR #3261 | |||
static const int DATASTREAM_VERSION = QDataStream::Qt_5_5; | |||
|
|||
u64 GetTitleID(const QString& path) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
2519ac5
to
3aefbe5
Compare
@@ -502,7 +502,7 @@ void CGameListCtrl::ReloadList() | |||
} | |||
else | |||
{ | |||
errorString = _("Dolphin could not find any GameCube/Wii ISOs or WADs. Double-click here to " | |||
errorString = _("Dolphin could not find any GameCube/WiiISOs or WADs. Double-click here to " |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
return false; | ||
|
||
const std::string content_dir = | ||
Common::GetTitleContentPath(m_title_id, Common::FromWhichRoot::FROM_CONFIGURED_ROOT); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
const auto entries = File::ScanDirectoryTree(content_dir, false); | ||
return std::any_of(entries.children.begin(), entries.children.end(), | ||
[](const auto& file) { return file.virtualName != "title.tmd"; }); | ||
} |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
bool GameFile::Install() | ||
{ | ||
if (m_platform != DiscIO::Platform::WII_WAD) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
bool GameFile::Uninstall() | ||
{ | ||
if (m_platform != DiscIO::Platform::WII_WAD) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Common::FROM_CONFIGURED_ROOT); | ||
} | ||
|
||
bool GameFile::ExportWiiSaves() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
const bool success = GameFile(GetSelectedGame()).Uninstall(); | ||
|
||
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); | ||
result_dialog.setText(success ? tr("Succesfully removed WAD from NAND") : |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical); | ||
result_dialog.setText(success ? tr("Succesfully removed WAD from NAND") : | ||
tr("Failed to remove WAD from NAND")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MenuBar.cpp
Outdated
if (GameFile(wad_file).Install()) | ||
{ | ||
result_dialog.setIcon(QMessageBox::Information); | ||
result_dialog.setText(tr("Successfully installed the WAD to NAND")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MenuBar.cpp
Outdated
else | ||
{ | ||
result_dialog.setIcon(QMessageBox::Critical); | ||
result_dialog.setText(tr("Failed to install the WAD to NAND!")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
result_dialog.exec(); | ||
} | ||
|
||
void GameList::UninstallWAD() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
4d84e92
to
41fcaea
Compare
|
||
bool GameFile::Uninstall() | ||
{ | ||
_assert_(m_platform == DiscIO::Platform::WII_WAD) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Adds a few missing gamelist menu options that are available in the Wx Version, but not in Qt.