Add Context Menu Options to Open Application and Update Location (#3411)
* Add Context Menu Options to Open Application and Update Location * address jroweboy's feedback move enum definition to game list header declare sdmc_dir in SAVE_DATA case fix log formatting * Address Merry's feedback remove redundant line format program ID as 16 digit hex in log| change case of open_target to look better in title bar add whitespace for readability
This commit is contained in:
parent
40b9e55e60
commit
d3a0375f47
4 changed files with 55 additions and 10 deletions
|
@ -316,10 +316,24 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
|
|||
u64 program_id = child_file->data(GameListItemPath::ProgramIdRole).toULongLong();
|
||||
|
||||
QMenu context_menu;
|
||||
|
||||
QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location"));
|
||||
QAction* open_application_location = context_menu.addAction(tr("Open Application Location"));
|
||||
QAction* open_update_location = context_menu.addAction(tr("Open Update Data Location"));
|
||||
|
||||
open_save_location->setEnabled(program_id != 0);
|
||||
open_application_location->setVisible(FileUtil::Exists(
|
||||
Service::AM::GetTitleContentPath(Service::FS::MediaType::SDMC, program_id)));
|
||||
open_update_location->setEnabled(0x00040000'00000000 <= program_id &&
|
||||
program_id <= 0x00040000'FFFFFFFF);
|
||||
|
||||
connect(open_save_location, &QAction::triggered,
|
||||
[&]() { emit OpenSaveFolderRequested(program_id); });
|
||||
[&]() { emit OpenFolderRequested(program_id, GameListOpenTarget::SAVE_DATA); });
|
||||
connect(open_application_location, &QAction::triggered,
|
||||
[&]() { emit OpenFolderRequested(program_id, GameListOpenTarget::APPLICATION); });
|
||||
connect(open_update_location, &QAction::triggered,
|
||||
[&]() { emit OpenFolderRequested(program_id, GameListOpenTarget::UPDATE_DATA); });
|
||||
|
||||
context_menu.exec(tree_view->viewport()->mapToGlobal(menu_location));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue