mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
patch manager: "Show Patch File" in context menu
This commit is contained in:
parent
fd2cd84555
commit
b212f29cf2
1 changed files with 23 additions and 0 deletions
|
@ -356,6 +356,29 @@ void patch_manager_dialog::on_custom_context_menu_requested(const QPoint &pos)
|
|||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find the patch for this item and add menu items accordingly
|
||||
const std::string hash = item->data(0, hash_role).toString().toStdString();
|
||||
const std::string description = item->data(0, description_role).toString().toStdString();
|
||||
|
||||
if (m_map.find(hash) != m_map.end())
|
||||
{
|
||||
const auto& container = m_map.at(hash);
|
||||
|
||||
if (!container.is_legacy && container.patch_info_map.find(description) != container.patch_info_map.end())
|
||||
{
|
||||
const auto info = container.patch_info_map.at(description);
|
||||
|
||||
QAction* open_filepath = new QAction("Show Patch File");
|
||||
menu->addAction(open_filepath);
|
||||
connect(open_filepath, &QAction::triggered, this, [info](bool)
|
||||
{
|
||||
gui::utils::open_dir(info.source_path);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu->exec(ui->patch_tree->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue