mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Qt: Remove ActionHelper
This commit is contained in:
parent
4266d1f237
commit
a22ffb6387
@ -33,7 +33,6 @@
|
|||||||
#include "DolphinQt/Config/ARCodeWidget.h"
|
#include "DolphinQt/Config/ARCodeWidget.h"
|
||||||
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
||||||
#include "DolphinQt/GameList/GameListModel.h"
|
#include "DolphinQt/GameList/GameListModel.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
constexpr u32 MAX_RESULTS = 50;
|
constexpr u32 MAX_RESULTS = 50;
|
||||||
@ -132,7 +131,7 @@ void CheatsManager::OnWatchContextMenu()
|
|||||||
|
|
||||||
QMenu* menu = new QMenu(this);
|
QMenu* menu = new QMenu(this);
|
||||||
|
|
||||||
AddAction(menu, tr("Remove from Watch"), this, [this] {
|
menu->addAction(tr("Remove from Watch"), this, [this] {
|
||||||
auto* item = m_match_table->selectedItems()[0];
|
auto* item = m_match_table->selectedItems()[0];
|
||||||
|
|
||||||
int index = item->data(INDEX_ROLE).toInt();
|
int index = item->data(INDEX_ROLE).toInt();
|
||||||
@ -144,7 +143,7 @@ void CheatsManager::OnWatchContextMenu()
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
AddAction(menu, tr("Generate Action Replay Code"), this, &CheatsManager::GenerateARCode);
|
menu->addAction(tr("Generate Action Replay Code"), this, &CheatsManager::GenerateARCode);
|
||||||
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
@ -156,7 +155,7 @@ void CheatsManager::OnMatchContextMenu()
|
|||||||
|
|
||||||
QMenu* menu = new QMenu(this);
|
QMenu* menu = new QMenu(this);
|
||||||
|
|
||||||
AddAction(menu, tr("Add to Watch"), this, [this] {
|
menu->addAction(tr("Add to Watch"), this, [this] {
|
||||||
auto* item = m_match_table->selectedItems()[0];
|
auto* item = m_match_table->selectedItems()[0];
|
||||||
|
|
||||||
int index = item->data(INDEX_ROLE).toInt();
|
int index = item->data(INDEX_ROLE).toInt();
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "DiscIO/Filesystem.h"
|
#include "DiscIO/Filesystem.h"
|
||||||
#include "DiscIO/Volume.h"
|
#include "DiscIO/Volume.h"
|
||||||
|
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
|
|
||||||
#include "UICommon/UICommon.h"
|
#include "UICommon/UICommon.h"
|
||||||
@ -180,7 +179,7 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
if (type == EntryType::Dir || is_filesystem_root)
|
if (type == EntryType::Dir || is_filesystem_root)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("Extract Files..."), this, [this, partition, path] {
|
menu->addAction(tr("Extract Files..."), this, [this, partition, path] {
|
||||||
auto folder = SelectFolder();
|
auto folder = SelectFolder();
|
||||||
|
|
||||||
if (!folder.isEmpty())
|
if (!folder.isEmpty())
|
||||||
@ -190,7 +189,7 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
if (is_filesystem_root)
|
if (is_filesystem_root)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("Extract System Data..."), this, [this, partition] {
|
menu->addAction(tr("Extract System Data..."), this, [this, partition] {
|
||||||
auto folder = SelectFolder();
|
auto folder = SelectFolder();
|
||||||
|
|
||||||
if (folder.isEmpty())
|
if (folder.isEmpty())
|
||||||
@ -206,7 +205,7 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case EntryType::Disc:
|
case EntryType::Disc:
|
||||||
AddAction(menu, tr("Extract Entire Disc..."), this, [this, path] {
|
menu->addAction(tr("Extract Entire Disc..."), this, [this, path] {
|
||||||
auto folder = SelectFolder();
|
auto folder = SelectFolder();
|
||||||
|
|
||||||
if (folder.isEmpty())
|
if (folder.isEmpty())
|
||||||
@ -231,7 +230,7 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case EntryType::Partition:
|
case EntryType::Partition:
|
||||||
AddAction(menu, tr("Extract Entire Partition..."), this, [this, partition] {
|
menu->addAction(tr("Extract Entire Partition..."), this, [this, partition] {
|
||||||
auto folder = SelectFolder();
|
auto folder = SelectFolder();
|
||||||
if (!folder.isEmpty())
|
if (!folder.isEmpty())
|
||||||
ExtractPartition(partition, folder);
|
ExtractPartition(partition, folder);
|
||||||
@ -239,12 +238,12 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
|||||||
if (m_volume->IsEncryptedAndHashed())
|
if (m_volume->IsEncryptedAndHashed())
|
||||||
{
|
{
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
AddAction(menu, tr("Check Partition Integrity"), this,
|
menu->addAction(tr("Check Partition Integrity"), this,
|
||||||
[this, partition] { CheckIntegrity(partition); });
|
[this, partition] { CheckIntegrity(partition); });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntryType::File:
|
case EntryType::File:
|
||||||
AddAction(menu, tr("Extract File..."), this, [this, partition, path] {
|
menu->addAction(tr("Extract File..."), this, [this, partition, path] {
|
||||||
auto dest =
|
auto dest =
|
||||||
QFileDialog::getSaveFileName(this, tr("Save File to"), QFileInfo(path).fileName());
|
QFileDialog::getSaveFileName(this, tr("Save File to"), QFileInfo(path).fileName());
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
|
|
||||||
#include "DolphinQt/Debugger/NewBreakpointDialog.h"
|
#include "DolphinQt/Debugger/NewBreakpointDialog.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
@ -102,12 +101,12 @@ void BreakpointWidget::CreateWidgets()
|
|||||||
layout->addWidget(m_toolbar);
|
layout->addWidget(m_toolbar);
|
||||||
layout->addWidget(m_table);
|
layout->addWidget(m_table);
|
||||||
|
|
||||||
m_new = AddAction(m_toolbar, tr("New"), this, &BreakpointWidget::OnNewBreakpoint);
|
m_new = m_toolbar->addAction(tr("New"), this, &BreakpointWidget::OnNewBreakpoint);
|
||||||
m_delete = AddAction(m_toolbar, tr("Delete"), this, &BreakpointWidget::OnDelete);
|
m_delete = m_toolbar->addAction(tr("Delete"), this, &BreakpointWidget::OnDelete);
|
||||||
m_clear = AddAction(m_toolbar, tr("Clear"), this, &BreakpointWidget::OnClear);
|
m_clear = m_toolbar->addAction(tr("Clear"), this, &BreakpointWidget::OnClear);
|
||||||
|
|
||||||
m_load = AddAction(m_toolbar, tr("Load"), this, &BreakpointWidget::OnLoad);
|
m_load = m_toolbar->addAction(tr("Load"), this, &BreakpointWidget::OnLoad);
|
||||||
m_save = AddAction(m_toolbar, tr("Save"), this, &BreakpointWidget::OnSave);
|
m_save = m_toolbar->addAction(tr("Save"), this, &BreakpointWidget::OnSave);
|
||||||
|
|
||||||
m_new->setEnabled(false);
|
m_new->setEnabled(false);
|
||||||
m_load->setEnabled(false);
|
m_load->setEnabled(false);
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "Core/PowerPC/PPCAnalyst.h"
|
#include "Core/PowerPC/PPCAnalyst.h"
|
||||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
@ -215,36 +214,36 @@ void CodeViewWidget::OnContextMenu()
|
|||||||
bool has_symbol = g_symbolDB.GetSymbolFromAddr(addr);
|
bool has_symbol = g_symbolDB.GetSymbolFromAddr(addr);
|
||||||
|
|
||||||
auto* follow_branch_action =
|
auto* follow_branch_action =
|
||||||
AddAction(menu, tr("Follow &branch"), this, &CodeViewWidget::OnFollowBranch);
|
menu->addAction(tr("Follow &branch"), this, &CodeViewWidget::OnFollowBranch);
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
AddAction(menu, tr("&Copy address"), this, &CodeViewWidget::OnCopyAddress);
|
menu->addAction(tr("&Copy address"), this, &CodeViewWidget::OnCopyAddress);
|
||||||
auto* copy_address_action =
|
auto* copy_address_action =
|
||||||
AddAction(menu, tr("Copy &function"), this, &CodeViewWidget::OnCopyFunction);
|
menu->addAction(tr("Copy &function"), this, &CodeViewWidget::OnCopyFunction);
|
||||||
auto* copy_line_action =
|
auto* copy_line_action =
|
||||||
AddAction(menu, tr("Copy code &line"), this, &CodeViewWidget::OnCopyCode);
|
menu->addAction(tr("Copy code &line"), this, &CodeViewWidget::OnCopyCode);
|
||||||
auto* copy_hex_action = AddAction(menu, tr("Copy &hex"), this, &CodeViewWidget::OnCopyHex);
|
auto* copy_hex_action = menu->addAction(tr("Copy &hex"), this, &CodeViewWidget::OnCopyHex);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
auto* symbol_rename_action =
|
auto* symbol_rename_action =
|
||||||
AddAction(menu, tr("&Rename symbol"), this, &CodeViewWidget::OnRenameSymbol);
|
menu->addAction(tr("&Rename symbol"), this, &CodeViewWidget::OnRenameSymbol);
|
||||||
auto* symbol_size_action =
|
auto* symbol_size_action =
|
||||||
AddAction(menu, tr("Set symbol &size"), this, &CodeViewWidget::OnSetSymbolSize);
|
menu->addAction(tr("Set symbol &size"), this, &CodeViewWidget::OnSetSymbolSize);
|
||||||
auto* symbol_end_action =
|
auto* symbol_end_action =
|
||||||
AddAction(menu, tr("Set symbol &end address"), this, &CodeViewWidget::OnSetSymbolEndAddress);
|
menu->addAction(tr("Set symbol &end address"), this, &CodeViewWidget::OnSetSymbolEndAddress);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
AddAction(menu, tr("Run &To Here"), this, &CodeViewWidget::OnRunToHere);
|
menu->addAction(tr("Run &To Here"), this, &CodeViewWidget::OnRunToHere);
|
||||||
auto* function_action =
|
auto* function_action =
|
||||||
AddAction(menu, tr("&Add function"), this, &CodeViewWidget::OnAddFunction);
|
menu->addAction(tr("&Add function"), this, &CodeViewWidget::OnAddFunction);
|
||||||
auto* ppc_action = AddAction(menu, tr("PPC vs Host"), this, &CodeViewWidget::OnPPCComparison);
|
auto* ppc_action = menu->addAction(tr("PPC vs Host"), this, &CodeViewWidget::OnPPCComparison);
|
||||||
auto* insert_blr_action = AddAction(menu, tr("&Insert blr"), this, &CodeViewWidget::OnInsertBLR);
|
auto* insert_blr_action = menu->addAction(tr("&Insert blr"), this, &CodeViewWidget::OnInsertBLR);
|
||||||
auto* insert_nop_action = AddAction(menu, tr("Insert &nop"), this, &CodeViewWidget::OnInsertNOP);
|
auto* insert_nop_action = menu->addAction(tr("Insert &nop"), this, &CodeViewWidget::OnInsertNOP);
|
||||||
auto* replace_action =
|
auto* replace_action =
|
||||||
AddAction(menu, tr("Re&place instruction"), this, &CodeViewWidget::OnReplaceInstruction);
|
menu->addAction(tr("Re&place instruction"), this, &CodeViewWidget::OnReplaceInstruction);
|
||||||
auto* restore_action =
|
auto* restore_action =
|
||||||
AddAction(menu, tr("Restore instruction"), this, &CodeViewWidget::OnRestoreInstruction);
|
menu->addAction(tr("Restore instruction"), this, &CodeViewWidget::OnRestoreInstruction);
|
||||||
|
|
||||||
follow_branch_action->setEnabled(running && GetBranchFromAddress(addr));
|
follow_branch_action->setEnabled(running && GetBranchFromAddress(addr));
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "Core/PowerPC/MMU.h"
|
#include "Core/PowerPC/MMU.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
|
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
@ -351,16 +350,16 @@ void MemoryViewWidget::OnContextMenu()
|
|||||||
{
|
{
|
||||||
auto* menu = new QMenu(this);
|
auto* menu = new QMenu(this);
|
||||||
|
|
||||||
AddAction(menu, tr("Copy Address"), this, &MemoryViewWidget::OnCopyAddress);
|
menu->addAction(tr("Copy Address"), this, &MemoryViewWidget::OnCopyAddress);
|
||||||
|
|
||||||
auto* copy_hex = AddAction(menu, tr("Copy Hex"), this, &MemoryViewWidget::OnCopyHex);
|
auto* copy_hex = menu->addAction(tr("Copy Hex"), this, &MemoryViewWidget::OnCopyHex);
|
||||||
|
|
||||||
copy_hex->setEnabled(Core::GetState() != Core::State::Uninitialized &&
|
copy_hex->setEnabled(Core::GetState() != Core::State::Uninitialized &&
|
||||||
PowerPC::HostIsRAMAddress(GetContextAddress()));
|
PowerPC::HostIsRAMAddress(GetContextAddress()));
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
AddAction(menu, tr("Toggle Breakpoint"), this, &MemoryViewWidget::ToggleBreakpoint);
|
menu->addAction(tr("Toggle Breakpoint"), this, &MemoryViewWidget::ToggleBreakpoint);
|
||||||
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "Core/HW/ProcessorInterface.h"
|
#include "Core/HW/ProcessorInterface.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
#include "DolphinQt/Host.h"
|
#include "DolphinQt/Host.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
|
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
@ -118,8 +117,8 @@ void RegisterWidget::ShowContextMenu()
|
|||||||
auto type = static_cast<RegisterType>(item->data(DATA_TYPE).toInt());
|
auto type = static_cast<RegisterType>(item->data(DATA_TYPE).toInt());
|
||||||
auto display = item->GetDisplay();
|
auto display = item->GetDisplay();
|
||||||
|
|
||||||
AddAction(menu, tr("Add to &watch"), this,
|
menu->addAction(tr("Add to &watch"), this,
|
||||||
[this, item] { emit RequestMemoryBreakpoint(item->GetValue()); });
|
[this, item] { emit RequestMemoryBreakpoint(item->GetValue()); });
|
||||||
menu->addAction(tr("View &memory"));
|
menu->addAction(tr("View &memory"));
|
||||||
menu->addAction(tr("View &code"));
|
menu->addAction(tr("View &code"));
|
||||||
|
|
||||||
@ -211,7 +210,7 @@ void RegisterWidget::ShowContextMenu()
|
|||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
AddAction(menu, tr("Update"), this, [this] { emit RequestTableUpdate(); });
|
menu->addAction(tr("Update"), this, [this] { emit RequestTableUpdate(); });
|
||||||
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include "Core/PowerPC/MMU.h"
|
#include "Core/PowerPC/MMU.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
|
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
@ -84,8 +83,8 @@ void WatchWidget::CreateWidgets()
|
|||||||
m_table->setContextMenuPolicy(Qt::CustomContextMenu);
|
m_table->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
|
||||||
m_load = AddAction(m_toolbar, tr("Load"), this, &WatchWidget::OnLoad);
|
m_load = m_toolbar->addAction(tr("Load"), this, &WatchWidget::OnLoad);
|
||||||
m_save = AddAction(m_toolbar, tr("Save"), this, &WatchWidget::OnSave);
|
m_save = m_toolbar->addAction(tr("Save"), this, &WatchWidget::OnSave);
|
||||||
|
|
||||||
m_load->setEnabled(false);
|
m_load->setEnabled(false);
|
||||||
m_save->setEnabled(false);
|
m_save->setEnabled(false);
|
||||||
@ -238,16 +237,16 @@ void WatchWidget::ShowContextMenu()
|
|||||||
{
|
{
|
||||||
// i18n: This kind of "watch" is used for watching emulated memory.
|
// i18n: This kind of "watch" is used for watching emulated memory.
|
||||||
// It's not related to timekeeping devices.
|
// It's not related to timekeeping devices.
|
||||||
AddAction(menu, tr("&Delete Watch"), this, [this, row] { DeleteWatch(row); });
|
menu->addAction(tr("&Delete Watch"), this, [this, row] { DeleteWatch(row); });
|
||||||
AddAction(menu, tr("&Add Memory Breakpoint"), this,
|
menu->addAction(tr("&Add Memory Breakpoint"), this,
|
||||||
[this, row] { AddWatchBreakpoint(row); });
|
[this, row] { AddWatchBreakpoint(row); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
AddAction(menu, tr("Update"), this, &WatchWidget::Update);
|
menu->addAction(tr("Update"), this, &WatchWidget::Update);
|
||||||
|
|
||||||
menu->exec(QCursor::pos());
|
menu->exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include "DolphinQt/Config/PropertiesDialog.h"
|
#include "DolphinQt/Config/PropertiesDialog.h"
|
||||||
#include "DolphinQt/GameList/GridProxyModel.h"
|
#include "DolphinQt/GameList/GridProxyModel.h"
|
||||||
#include "DolphinQt/GameList/ListProxyModel.h"
|
#include "DolphinQt/GameList/ListProxyModel.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/QtUtils/DoubleClickEventFilter.h"
|
#include "DolphinQt/QtUtils/DoubleClickEventFilter.h"
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
@ -227,19 +226,19 @@ void GameList::ShowContextMenu(const QPoint&)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (compress)
|
if (compress)
|
||||||
AddAction(menu, tr("Compress selected ISOs..."), this, [this] { CompressISO(false); });
|
menu->addAction(tr("Compress selected ISOs..."), this, [this] { CompressISO(false); });
|
||||||
if (decompress)
|
if (decompress)
|
||||||
AddAction(menu, tr("Decompress selected ISOs..."), this, [this] { CompressISO(true); });
|
menu->addAction(tr("Decompress selected ISOs..."), this, [this] { CompressISO(true); });
|
||||||
if (compress || decompress)
|
if (compress || decompress)
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
if (wii_saves)
|
if (wii_saves)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("Export Wii saves (Experimental)"), this, &GameList::ExportWiiSave);
|
menu->addAction(tr("Export Wii saves (Experimental)"), this, &GameList::ExportWiiSave);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
AddAction(menu, tr("Delete selected files..."), this, &GameList::DeleteFile);
|
menu->addAction(tr("Delete selected files..."), this, &GameList::DeleteFile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,23 +247,23 @@ void GameList::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
if (platform != DiscIO::Platform::ELFOrDOL)
|
if (platform != DiscIO::Platform::ELFOrDOL)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("&Properties"), this, &GameList::OpenProperties);
|
menu->addAction(tr("&Properties"), this, &GameList::OpenProperties);
|
||||||
AddAction(menu, tr("&Wiki"), this, &GameList::OpenWiki);
|
menu->addAction(tr("&Wiki"), this, &GameList::OpenWiki);
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform == DiscIO::Platform::GameCubeDisc || platform == DiscIO::Platform::WiiDisc)
|
if (platform == DiscIO::Platform::GameCubeDisc || platform == DiscIO::Platform::WiiDisc)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("Set as &default ISO"), this, &GameList::SetDefaultISO);
|
menu->addAction(tr("Set as &default ISO"), this, &GameList::SetDefaultISO);
|
||||||
const auto blob_type = game->GetBlobType();
|
const auto blob_type = game->GetBlobType();
|
||||||
|
|
||||||
if (blob_type == DiscIO::BlobType::GCZ)
|
if (blob_type == DiscIO::BlobType::GCZ)
|
||||||
AddAction(menu, tr("Decompress ISO..."), this, [this] { CompressISO(true); });
|
menu->addAction(tr("Decompress ISO..."), this, [this] { CompressISO(true); });
|
||||||
else if (blob_type == DiscIO::BlobType::PLAIN)
|
else if (blob_type == DiscIO::BlobType::PLAIN)
|
||||||
AddAction(menu, tr("Compress ISO..."), this, [this] { CompressISO(false); });
|
menu->addAction(tr("Compress ISO..."), this, [this] { CompressISO(false); });
|
||||||
|
|
||||||
QAction* change_disc = AddAction(menu, tr("Change &Disc"), this, &GameList::ChangeDisc);
|
QAction* change_disc = menu->addAction(tr("Change &Disc"), this, &GameList::ChangeDisc);
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, change_disc,
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, change_disc,
|
||||||
[change_disc] { change_disc->setEnabled(Core::IsRunning()); });
|
[change_disc] { change_disc->setEnabled(Core::IsRunning()); });
|
||||||
@ -275,7 +274,7 @@ void GameList::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
if (platform == DiscIO::Platform::WiiDisc)
|
if (platform == DiscIO::Platform::WiiDisc)
|
||||||
{
|
{
|
||||||
auto* perform_disc_update = AddAction(menu, tr("Perform System Update"), this, [this] {
|
auto* perform_disc_update = menu->addAction(tr("Perform System Update"), this, [this] {
|
||||||
WiiUpdate::PerformDiscUpdate(GetSelectedGame()->GetFilePath(), this);
|
WiiUpdate::PerformDiscUpdate(GetSelectedGame()->GetFilePath(), this);
|
||||||
});
|
});
|
||||||
perform_disc_update->setEnabled(!Core::IsRunning() || !SConfig::GetInstance().bWii);
|
perform_disc_update->setEnabled(!Core::IsRunning() || !SConfig::GetInstance().bWii);
|
||||||
@ -309,13 +308,13 @@ void GameList::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
if (platform == DiscIO::Platform::WiiWAD || platform == DiscIO::Platform::WiiDisc)
|
if (platform == DiscIO::Platform::WiiWAD || platform == DiscIO::Platform::WiiDisc)
|
||||||
{
|
{
|
||||||
AddAction(menu, tr("Open Wii &save folder"), this, &GameList::OpenSaveFolder);
|
menu->addAction(tr("Open Wii &save folder"), this, &GameList::OpenSaveFolder);
|
||||||
AddAction(menu, tr("Export Wii save (Experimental)"), this, &GameList::ExportWiiSave);
|
menu->addAction(tr("Export Wii save (Experimental)"), this, &GameList::ExportWiiSave);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
AddAction(menu, tr("Open &containing folder"), this, &GameList::OpenContainingFolder);
|
menu->addAction(tr("Open &containing folder"), this, &GameList::OpenContainingFolder);
|
||||||
AddAction(menu, tr("Delete File..."), this, &GameList::DeleteFile);
|
menu->addAction(tr("Delete File..."), this, &GameList::DeleteFile);
|
||||||
|
|
||||||
QAction* netplay_host = new QAction(tr("Host with NetPlay"), menu);
|
QAction* netplay_host = new QAction(tr("Host with NetPlay"), menu);
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
|
|
||||||
#include "DolphinQt/AboutDialog.h"
|
#include "DolphinQt/AboutDialog.h"
|
||||||
#include "DolphinQt/Host.h"
|
#include "DolphinQt/Host.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
#include "DolphinQt/Updater.h"
|
#include "DolphinQt/Updater.h"
|
||||||
|
|
||||||
@ -171,38 +170,38 @@ void MenuBar::AddDVDBackupMenu(QMenu* file_menu)
|
|||||||
for (size_t i = 0; i < drives.size() && i < 24; i++)
|
for (size_t i = 0; i < drives.size() && i < 24; i++)
|
||||||
{
|
{
|
||||||
auto drive = QString::fromStdString(drives[i]);
|
auto drive = QString::fromStdString(drives[i]);
|
||||||
AddAction(m_backup_menu, drive, this, [this, drive] { emit BootDVDBackup(drive); });
|
m_backup_menu->addAction(drive, this, [this, drive] { emit BootDVDBackup(drive); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddFileMenu()
|
void MenuBar::AddFileMenu()
|
||||||
{
|
{
|
||||||
QMenu* file_menu = addMenu(tr("&File"));
|
QMenu* file_menu = addMenu(tr("&File"));
|
||||||
m_open_action = AddAction(file_menu, tr("&Open..."), this, &MenuBar::Open,
|
m_open_action = file_menu->addAction(tr("&Open..."), this, &MenuBar::Open,
|
||||||
QKeySequence(QStringLiteral("Ctrl+O")));
|
QKeySequence(QStringLiteral("Ctrl+O")));
|
||||||
|
|
||||||
file_menu->addSeparator();
|
file_menu->addSeparator();
|
||||||
|
|
||||||
m_change_disc = AddAction(file_menu, tr("Change &Disc..."), this, &MenuBar::ChangeDisc);
|
m_change_disc = file_menu->addAction(tr("Change &Disc..."), this, &MenuBar::ChangeDisc);
|
||||||
m_eject_disc = AddAction(file_menu, tr("&Eject Disc"), this, &MenuBar::EjectDisc);
|
m_eject_disc = file_menu->addAction(tr("&Eject Disc"), this, &MenuBar::EjectDisc);
|
||||||
|
|
||||||
AddDVDBackupMenu(file_menu);
|
AddDVDBackupMenu(file_menu);
|
||||||
|
|
||||||
file_menu->addSeparator();
|
file_menu->addSeparator();
|
||||||
|
|
||||||
m_exit_action = AddAction(file_menu, tr("E&xit"), this, &MenuBar::Exit,
|
m_exit_action = file_menu->addAction(tr("E&xit"), this, &MenuBar::Exit,
|
||||||
QKeySequence(QStringLiteral("Alt+F4")));
|
QKeySequence(QStringLiteral("Alt+F4")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddToolsMenu()
|
void MenuBar::AddToolsMenu()
|
||||||
{
|
{
|
||||||
QMenu* tools_menu = addMenu(tr("&Tools"));
|
QMenu* tools_menu = addMenu(tr("&Tools"));
|
||||||
|
|
||||||
AddAction(tools_menu, tr("&Memory Card Manager (GC)"), this,
|
tools_menu->addAction(tr("&Memory Card Manager (GC)"), this,
|
||||||
[this] { emit ShowMemcardManager(); });
|
[this] { emit ShowMemcardManager(); });
|
||||||
|
|
||||||
m_show_cheat_manager =
|
m_show_cheat_manager =
|
||||||
AddAction(tools_menu, tr("&Cheats Manager"), this, [this] { emit ShowCheatsManager(); });
|
tools_menu->addAction(tr("&Cheats Manager"), this, [this] { emit ShowCheatsManager(); });
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EnableCheatsChanged, [this](bool enabled) {
|
connect(&Settings::Instance(), &Settings::EnableCheatsChanged, [this](bool enabled) {
|
||||||
m_show_cheat_manager->setEnabled(Core::GetState() != Core::State::Uninitialized && enabled);
|
m_show_cheat_manager->setEnabled(Core::GetState() != Core::State::Uninitialized && enabled);
|
||||||
@ -210,54 +209,53 @@ void MenuBar::AddToolsMenu()
|
|||||||
|
|
||||||
tools_menu->addSeparator();
|
tools_menu->addSeparator();
|
||||||
|
|
||||||
AddAction(tools_menu, tr("Import Wii Save..."), this, &MenuBar::ImportWiiSave);
|
tools_menu->addAction(tr("Import Wii Save..."), this, &MenuBar::ImportWiiSave);
|
||||||
AddAction(tools_menu, tr("Export All Wii Saves"), this, &MenuBar::ExportWiiSaves);
|
tools_menu->addAction(tr("Export All Wii Saves"), this, &MenuBar::ExportWiiSaves);
|
||||||
|
|
||||||
tools_menu->addSeparator();
|
tools_menu->addSeparator();
|
||||||
|
|
||||||
m_wad_install_action = AddAction(tools_menu, tr("Install WAD..."), this, &MenuBar::InstallWAD);
|
m_wad_install_action = tools_menu->addAction(tr("Install WAD..."), this, &MenuBar::InstallWAD);
|
||||||
|
|
||||||
tools_menu->addSeparator();
|
tools_menu->addSeparator();
|
||||||
QMenu* gc_ipl = tools_menu->addMenu(tr("Load GameCube Main Menu"));
|
QMenu* gc_ipl = tools_menu->addMenu(tr("Load GameCube Main Menu"));
|
||||||
|
|
||||||
m_ntscj_ipl = AddAction(gc_ipl, tr("NTSC-J"), this,
|
m_ntscj_ipl = gc_ipl->addAction(tr("NTSC-J"), this,
|
||||||
[this] { emit BootGameCubeIPL(DiscIO::Region::NTSC_J); });
|
[this] { emit BootGameCubeIPL(DiscIO::Region::NTSC_J); });
|
||||||
m_ntscu_ipl = AddAction(gc_ipl, tr("NTSC-U"), this,
|
m_ntscu_ipl = gc_ipl->addAction(tr("NTSC-U"), this,
|
||||||
[this] { emit BootGameCubeIPL(DiscIO::Region::NTSC_U); });
|
[this] { emit BootGameCubeIPL(DiscIO::Region::NTSC_U); });
|
||||||
m_pal_ipl =
|
m_pal_ipl =
|
||||||
AddAction(gc_ipl, tr("PAL"), this, [this] { emit BootGameCubeIPL(DiscIO::Region::PAL); });
|
gc_ipl->addAction(tr("PAL"), this, [this] { emit BootGameCubeIPL(DiscIO::Region::PAL); });
|
||||||
|
|
||||||
AddAction(tools_menu, tr("Start &NetPlay..."), this, &MenuBar::StartNetPlay);
|
tools_menu->addAction(tr("Start &NetPlay..."), this, &MenuBar::StartNetPlay);
|
||||||
AddAction(tools_menu, tr("FIFO Player"), this, &MenuBar::ShowFIFOPlayer);
|
tools_menu->addAction(tr("FIFO Player"), this, &MenuBar::ShowFIFOPlayer);
|
||||||
|
|
||||||
tools_menu->addSeparator();
|
tools_menu->addSeparator();
|
||||||
|
|
||||||
// Label will be set by a NANDRefresh later
|
// Label will be set by a NANDRefresh later
|
||||||
m_boot_sysmenu =
|
m_boot_sysmenu =
|
||||||
AddAction(tools_menu, QStringLiteral(""), this, [this] { emit BootWiiSystemMenu(); });
|
tools_menu->addAction(QStringLiteral(""), this, [this] { emit BootWiiSystemMenu(); });
|
||||||
m_import_backup = AddAction(tools_menu, tr("Import BootMii NAND Backup..."), this,
|
m_import_backup = tools_menu->addAction(tr("Import BootMii NAND Backup..."), this,
|
||||||
[this] { emit ImportNANDBackup(); });
|
[this] { emit ImportNANDBackup(); });
|
||||||
m_check_nand = AddAction(tools_menu, tr("Check NAND..."), this, &MenuBar::CheckNAND);
|
m_check_nand = tools_menu->addAction(tr("Check NAND..."), this, &MenuBar::CheckNAND);
|
||||||
m_extract_certificates = AddAction(tools_menu, tr("Extract Certificates from NAND"), this,
|
m_extract_certificates = tools_menu->addAction(tr("Extract Certificates from NAND"), this,
|
||||||
&MenuBar::NANDExtractCertificates);
|
&MenuBar::NANDExtractCertificates);
|
||||||
|
|
||||||
m_boot_sysmenu->setEnabled(false);
|
m_boot_sysmenu->setEnabled(false);
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::NANDRefresh, [this] { UpdateToolsMenu(false); });
|
connect(&Settings::Instance(), &Settings::NANDRefresh, [this] { UpdateToolsMenu(false); });
|
||||||
|
|
||||||
m_perform_online_update_menu = tools_menu->addMenu(tr("Perform Online System Update"));
|
m_perform_online_update_menu = tools_menu->addMenu(tr("Perform Online System Update"));
|
||||||
m_perform_online_update_for_current_region =
|
m_perform_online_update_for_current_region = m_perform_online_update_menu->addAction(
|
||||||
AddAction(m_perform_online_update_menu, tr("Current Region"), this,
|
tr("Current Region"), this, [this] { emit PerformOnlineUpdate(""); });
|
||||||
[this] { emit PerformOnlineUpdate(""); });
|
|
||||||
m_perform_online_update_menu->addSeparator();
|
m_perform_online_update_menu->addSeparator();
|
||||||
AddAction(m_perform_online_update_menu, tr("Europe"), this,
|
m_perform_online_update_menu->addAction(tr("Europe"), this,
|
||||||
[this] { emit PerformOnlineUpdate("EUR"); });
|
[this] { emit PerformOnlineUpdate("EUR"); });
|
||||||
AddAction(m_perform_online_update_menu, tr("Japan"), this,
|
m_perform_online_update_menu->addAction(tr("Japan"), this,
|
||||||
[this] { emit PerformOnlineUpdate("JPN"); });
|
[this] { emit PerformOnlineUpdate("JPN"); });
|
||||||
AddAction(m_perform_online_update_menu, tr("Korea"), this,
|
m_perform_online_update_menu->addAction(tr("Korea"), this,
|
||||||
[this] { emit PerformOnlineUpdate("KOR"); });
|
[this] { emit PerformOnlineUpdate("KOR"); });
|
||||||
AddAction(m_perform_online_update_menu, tr("United States"), this,
|
m_perform_online_update_menu->addAction(tr("United States"), this,
|
||||||
[this] { emit PerformOnlineUpdate("USA"); });
|
[this] { emit PerformOnlineUpdate("USA"); });
|
||||||
|
|
||||||
QMenu* menu = new QMenu(tr("Connect Wii Remotes"));
|
QMenu* menu = new QMenu(tr("Connect Wii Remotes"));
|
||||||
|
|
||||||
@ -266,29 +264,29 @@ void MenuBar::AddToolsMenu()
|
|||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
m_wii_remotes[i] = AddAction(menu, tr("Connect Wii Remote %1").arg(i + 1), this,
|
m_wii_remotes[i] = menu->addAction(tr("Connect Wii Remote %1").arg(i + 1), this,
|
||||||
[this, i] { emit ConnectWiiRemote(i); });
|
[this, i] { emit ConnectWiiRemote(i); });
|
||||||
m_wii_remotes[i]->setCheckable(true);
|
m_wii_remotes[i]->setCheckable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
m_wii_remotes[4] =
|
m_wii_remotes[4] =
|
||||||
AddAction(menu, tr("Connect Balance Board"), this, [this] { emit ConnectWiiRemote(4); });
|
menu->addAction(tr("Connect Balance Board"), this, [this] { emit ConnectWiiRemote(4); });
|
||||||
m_wii_remotes[4]->setCheckable(true);
|
m_wii_remotes[4]->setCheckable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddEmulationMenu()
|
void MenuBar::AddEmulationMenu()
|
||||||
{
|
{
|
||||||
QMenu* emu_menu = addMenu(tr("&Emulation"));
|
QMenu* emu_menu = addMenu(tr("&Emulation"));
|
||||||
m_play_action = AddAction(emu_menu, tr("&Play"), this, &MenuBar::Play);
|
m_play_action = emu_menu->addAction(tr("&Play"), this, &MenuBar::Play);
|
||||||
m_pause_action = AddAction(emu_menu, tr("&Pause"), this, &MenuBar::Pause);
|
m_pause_action = emu_menu->addAction(tr("&Pause"), this, &MenuBar::Pause);
|
||||||
m_stop_action = AddAction(emu_menu, tr("&Stop"), this, &MenuBar::Stop);
|
m_stop_action = emu_menu->addAction(tr("&Stop"), this, &MenuBar::Stop);
|
||||||
m_reset_action = AddAction(emu_menu, tr("&Reset"), this, &MenuBar::Reset);
|
m_reset_action = emu_menu->addAction(tr("&Reset"), this, &MenuBar::Reset);
|
||||||
m_fullscreen_action = AddAction(emu_menu, tr("Toggle &Fullscreen"), this, &MenuBar::Fullscreen);
|
m_fullscreen_action = emu_menu->addAction(tr("Toggle &Fullscreen"), this, &MenuBar::Fullscreen);
|
||||||
m_frame_advance_action = AddAction(emu_menu, tr("&Frame Advance"), this, &MenuBar::FrameAdvance);
|
m_frame_advance_action = emu_menu->addAction(tr("&Frame Advance"), this, &MenuBar::FrameAdvance);
|
||||||
|
|
||||||
m_screenshot_action = AddAction(emu_menu, tr("Take Screenshot"), this, &MenuBar::Screenshot);
|
m_screenshot_action = emu_menu->addAction(tr("Take Screenshot"), this, &MenuBar::Screenshot);
|
||||||
|
|
||||||
emu_menu->addSeparator();
|
emu_menu->addSeparator();
|
||||||
|
|
||||||
@ -301,10 +299,10 @@ void MenuBar::AddEmulationMenu()
|
|||||||
void MenuBar::AddStateLoadMenu(QMenu* emu_menu)
|
void MenuBar::AddStateLoadMenu(QMenu* emu_menu)
|
||||||
{
|
{
|
||||||
m_state_load_menu = emu_menu->addMenu(tr("&Load State"));
|
m_state_load_menu = emu_menu->addMenu(tr("&Load State"));
|
||||||
AddAction(m_state_load_menu, tr("Load State from File"), this, &MenuBar::StateLoad);
|
m_state_load_menu->addAction(tr("Load State from File"), this, &MenuBar::StateLoad);
|
||||||
AddAction(m_state_load_menu, tr("Load State from Selected Slot"), this, &MenuBar::StateLoadSlot);
|
m_state_load_menu->addAction(tr("Load State from Selected Slot"), this, &MenuBar::StateLoadSlot);
|
||||||
m_state_load_slots_menu = m_state_load_menu->addMenu(tr("Load State from Slot"));
|
m_state_load_slots_menu = m_state_load_menu->addMenu(tr("Load State from Slot"));
|
||||||
AddAction(m_state_load_menu, tr("Undo Load State"), this, &MenuBar::StateLoadUndo);
|
m_state_load_menu->addAction(tr("Undo Load State"), this, &MenuBar::StateLoadUndo);
|
||||||
|
|
||||||
for (int i = 1; i <= 10; i++)
|
for (int i = 1; i <= 10; i++)
|
||||||
{
|
{
|
||||||
@ -317,11 +315,11 @@ void MenuBar::AddStateLoadMenu(QMenu* emu_menu)
|
|||||||
void MenuBar::AddStateSaveMenu(QMenu* emu_menu)
|
void MenuBar::AddStateSaveMenu(QMenu* emu_menu)
|
||||||
{
|
{
|
||||||
m_state_save_menu = emu_menu->addMenu(tr("Sa&ve State"));
|
m_state_save_menu = emu_menu->addMenu(tr("Sa&ve State"));
|
||||||
AddAction(m_state_save_menu, tr("Save State to File"), this, &MenuBar::StateSave);
|
m_state_save_menu->addAction(tr("Save State to File"), this, &MenuBar::StateSave);
|
||||||
AddAction(m_state_save_menu, tr("Save State to Selected Slot"), this, &MenuBar::StateSaveSlot);
|
m_state_save_menu->addAction(tr("Save State to Selected Slot"), this, &MenuBar::StateSaveSlot);
|
||||||
AddAction(m_state_save_menu, tr("Save State to Oldest Slot"), this, &MenuBar::StateSaveOldest);
|
m_state_save_menu->addAction(tr("Save State to Oldest Slot"), this, &MenuBar::StateSaveOldest);
|
||||||
m_state_save_slots_menu = m_state_save_menu->addMenu(tr("Save State to Slot"));
|
m_state_save_slots_menu = m_state_save_menu->addMenu(tr("Save State to Slot"));
|
||||||
AddAction(m_state_save_menu, tr("Undo Save State"), this, &MenuBar::StateSaveUndo);
|
m_state_save_menu->addAction(tr("Undo Save State"), this, &MenuBar::StateSaveUndo);
|
||||||
|
|
||||||
for (int i = 1; i <= 10; i++)
|
for (int i = 1; i <= 10; i++)
|
||||||
{
|
{
|
||||||
@ -457,19 +455,19 @@ void MenuBar::AddViewMenu()
|
|||||||
AddShowRegionsMenu(view_menu);
|
AddShowRegionsMenu(view_menu);
|
||||||
|
|
||||||
view_menu->addSeparator();
|
view_menu->addSeparator();
|
||||||
AddAction(view_menu, tr("Search"), this, &MenuBar::ToggleSearch,
|
view_menu->addAction(tr("Search"), this, &MenuBar::ToggleSearch,
|
||||||
QKeySequence(QStringLiteral("Ctrl+F")));
|
QKeySequence(QStringLiteral("Ctrl+F")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddOptionsMenu()
|
void MenuBar::AddOptionsMenu()
|
||||||
{
|
{
|
||||||
QMenu* options_menu = addMenu(tr("&Options"));
|
QMenu* options_menu = addMenu(tr("&Options"));
|
||||||
AddAction(options_menu, tr("Co&nfiguration"), this, &MenuBar::Configure);
|
options_menu->addAction(tr("Co&nfiguration"), this, &MenuBar::Configure);
|
||||||
options_menu->addSeparator();
|
options_menu->addSeparator();
|
||||||
AddAction(options_menu, tr("&Graphics Settings"), this, &MenuBar::ConfigureGraphics);
|
options_menu->addAction(tr("&Graphics Settings"), this, &MenuBar::ConfigureGraphics);
|
||||||
AddAction(options_menu, tr("&Audio Settings"), this, &MenuBar::ConfigureAudio);
|
options_menu->addAction(tr("&Audio Settings"), this, &MenuBar::ConfigureAudio);
|
||||||
AddAction(options_menu, tr("&Controller Settings"), this, &MenuBar::ConfigureControllers);
|
options_menu->addAction(tr("&Controller Settings"), this, &MenuBar::ConfigureControllers);
|
||||||
AddAction(options_menu, tr("&Hotkey Settings"), this, &MenuBar::ConfigureHotkeys);
|
options_menu->addAction(tr("&Hotkey Settings"), this, &MenuBar::ConfigureHotkeys);
|
||||||
|
|
||||||
options_menu->addSeparator();
|
options_menu->addSeparator();
|
||||||
|
|
||||||
@ -488,7 +486,7 @@ void MenuBar::AddOptionsMenu()
|
|||||||
connect(m_automatic_start, &QAction::toggled, this,
|
connect(m_automatic_start, &QAction::toggled, this,
|
||||||
[](bool enable) { SConfig::GetInstance().bAutomaticStart = enable; });
|
[](bool enable) { SConfig::GetInstance().bAutomaticStart = enable; });
|
||||||
|
|
||||||
m_change_font = AddAction(options_menu, tr("&Font..."), this, &MenuBar::ChangeDebugFont);
|
m_change_font = options_menu->addAction(tr("&Font..."), this, &MenuBar::ChangeDebugFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -531,11 +529,11 @@ void MenuBar::AddHelpMenu()
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
help_menu->addSeparator();
|
help_menu->addSeparator();
|
||||||
|
|
||||||
AddAction(help_menu, tr("&Check for Updates..."), this, &MenuBar::InstallUpdateManually);
|
help_menu->addAction(tr("&Check for Updates..."), this, &MenuBar::InstallUpdateManually);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
help_menu->addSeparator();
|
help_menu->addSeparator();
|
||||||
AddAction(help_menu, tr("&About"), this, &MenuBar::ShowAboutDialog);
|
help_menu->addAction(tr("&About"), this, &MenuBar::ShowAboutDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::AddGameListTypeSection(QMenu* view_menu)
|
void MenuBar::AddGameListTypeSection(QMenu* view_menu)
|
||||||
@ -652,13 +650,13 @@ void MenuBar::AddMovieMenu()
|
|||||||
{
|
{
|
||||||
auto* movie_menu = addMenu(tr("&Movie"));
|
auto* movie_menu = addMenu(tr("&Movie"));
|
||||||
m_recording_start =
|
m_recording_start =
|
||||||
AddAction(movie_menu, tr("Start Re&cording Input"), this, [this] { emit StartRecording(); });
|
movie_menu->addAction(tr("Start Re&cording Input"), this, [this] { emit StartRecording(); });
|
||||||
m_recording_play =
|
m_recording_play =
|
||||||
AddAction(movie_menu, tr("P&lay Input Recording..."), this, [this] { emit PlayRecording(); });
|
movie_menu->addAction(tr("P&lay Input Recording..."), this, [this] { emit PlayRecording(); });
|
||||||
m_recording_stop = AddAction(movie_menu, tr("Stop Playing/Recording Input"), this,
|
m_recording_stop = movie_menu->addAction(tr("Stop Playing/Recording Input"), this,
|
||||||
[this] { emit StopRecording(); });
|
[this] { emit StopRecording(); });
|
||||||
m_recording_export =
|
m_recording_export =
|
||||||
AddAction(movie_menu, tr("Export Recording..."), this, [this] { emit ExportRecording(); });
|
movie_menu->addAction(tr("Export Recording..."), this, [this] { emit ExportRecording(); });
|
||||||
|
|
||||||
m_recording_start->setEnabled(false);
|
m_recording_start->setEnabled(false);
|
||||||
m_recording_play->setEnabled(false);
|
m_recording_play->setEnabled(false);
|
||||||
@ -670,7 +668,7 @@ void MenuBar::AddMovieMenu()
|
|||||||
m_recording_read_only->setChecked(Movie::IsReadOnly());
|
m_recording_read_only->setChecked(Movie::IsReadOnly());
|
||||||
connect(m_recording_read_only, &QAction::toggled, [](bool value) { Movie::SetReadOnly(value); });
|
connect(m_recording_read_only, &QAction::toggled, [](bool value) { Movie::SetReadOnly(value); });
|
||||||
|
|
||||||
AddAction(movie_menu, tr("TAS Input"), this, [this] { emit ShowTASInput(); });
|
movie_menu->addAction(tr("TAS Input"), this, [this] { emit ShowTASInput(); });
|
||||||
|
|
||||||
movie_menu->addSeparator();
|
movie_menu->addSeparator();
|
||||||
|
|
||||||
@ -750,14 +748,14 @@ void MenuBar::AddJITMenu()
|
|||||||
ClearCache();
|
ClearCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
m_jit_clear_cache = AddAction(m_jit, tr("Clear Cache"), this, &MenuBar::ClearCache);
|
m_jit_clear_cache = m_jit->addAction(tr("Clear Cache"), this, &MenuBar::ClearCache);
|
||||||
|
|
||||||
m_jit->addSeparator();
|
m_jit->addSeparator();
|
||||||
|
|
||||||
m_jit_log_coverage =
|
m_jit_log_coverage =
|
||||||
AddAction(m_jit, tr("Log JIT Instruction Coverage"), this, &MenuBar::LogInstructions);
|
m_jit->addAction(tr("Log JIT Instruction Coverage"), this, &MenuBar::LogInstructions);
|
||||||
m_jit_search_instruction =
|
m_jit_search_instruction =
|
||||||
AddAction(m_jit, tr("Search for an Instruction"), this, &MenuBar::SearchInstruction);
|
m_jit->addAction(tr("Search for an Instruction"), this, &MenuBar::SearchInstruction);
|
||||||
|
|
||||||
m_jit->addSeparator();
|
m_jit->addSeparator();
|
||||||
|
|
||||||
@ -854,29 +852,29 @@ void MenuBar::AddSymbolsMenu()
|
|||||||
{
|
{
|
||||||
m_symbols = addMenu(tr("Symbols"));
|
m_symbols = addMenu(tr("Symbols"));
|
||||||
|
|
||||||
AddAction(m_symbols, tr("&Clear Symbols"), this, &MenuBar::ClearSymbols);
|
m_symbols->addAction(tr("&Clear Symbols"), this, &MenuBar::ClearSymbols);
|
||||||
|
|
||||||
auto* generate = m_symbols->addMenu(tr("&Generate Symbols From"));
|
auto* generate = m_symbols->addMenu(tr("&Generate Symbols From"));
|
||||||
AddAction(generate, tr("Address"), this, &MenuBar::GenerateSymbolsFromAddress);
|
generate->addAction(tr("Address"), this, &MenuBar::GenerateSymbolsFromAddress);
|
||||||
AddAction(generate, tr("Signature Database"), this, &MenuBar::GenerateSymbolsFromSignatureDB);
|
generate->addAction(tr("Signature Database"), this, &MenuBar::GenerateSymbolsFromSignatureDB);
|
||||||
AddAction(generate, tr("RSO Modules"), this, &MenuBar::GenerateSymbolsFromRSO);
|
generate->addAction(tr("RSO Modules"), this, &MenuBar::GenerateSymbolsFromRSO);
|
||||||
m_symbols->addSeparator();
|
m_symbols->addSeparator();
|
||||||
|
|
||||||
AddAction(m_symbols, tr("&Load Symbol Map"), this, &MenuBar::LoadSymbolMap);
|
m_symbols->addAction(tr("&Load Symbol Map"), this, &MenuBar::LoadSymbolMap);
|
||||||
AddAction(m_symbols, tr("&Save Symbol Map"), this, &MenuBar::SaveSymbolMap);
|
m_symbols->addAction(tr("&Save Symbol Map"), this, &MenuBar::SaveSymbolMap);
|
||||||
m_symbols->addSeparator();
|
m_symbols->addSeparator();
|
||||||
|
|
||||||
AddAction(m_symbols, tr("Load &Other Map File..."), this, &MenuBar::LoadOtherSymbolMap);
|
m_symbols->addAction(tr("Load &Other Map File..."), this, &MenuBar::LoadOtherSymbolMap);
|
||||||
AddAction(m_symbols, tr("Save Symbol Map &As..."), this, &MenuBar::SaveSymbolMapAs);
|
m_symbols->addAction(tr("Save Symbol Map &As..."), this, &MenuBar::SaveSymbolMapAs);
|
||||||
m_symbols->addSeparator();
|
m_symbols->addSeparator();
|
||||||
|
|
||||||
AddAction(m_symbols, tr("Save Code"), this, &MenuBar::SaveCode);
|
m_symbols->addAction(tr("Save Code"), this, &MenuBar::SaveCode);
|
||||||
m_symbols->addSeparator();
|
m_symbols->addSeparator();
|
||||||
|
|
||||||
AddAction(m_symbols, tr("&Create Signature File..."), this, &MenuBar::CreateSignatureFile);
|
m_symbols->addAction(tr("&Create Signature File..."), this, &MenuBar::CreateSignatureFile);
|
||||||
m_symbols->addSeparator();
|
m_symbols->addSeparator();
|
||||||
|
|
||||||
AddAction(m_symbols, tr("&Patch HLE Functions"), this, &MenuBar::PatchHLEFunctions);
|
m_symbols->addAction(tr("&Patch HLE Functions"), this, &MenuBar::PatchHLEFunctions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::UpdateToolsMenu(bool emulation_started)
|
void MenuBar::UpdateToolsMenu(bool emulation_started)
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
// Copyright 2017 Dolphin Emulator Project
|
|
||||||
// Licensed under GPLv2+
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
#include <QKeySequence>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
// Since we have to support Qt < 5.6, we need our own implementation of addAction(QString&
|
|
||||||
// text,QObject*,PointerToMemberFunction);
|
|
||||||
template <typename ParentClass, typename RecieverClass, typename Func>
|
|
||||||
QAction* AddAction(ParentClass* parent, const QString& text, const RecieverClass* receiver,
|
|
||||||
Func slot, const QKeySequence& shortcut = 0)
|
|
||||||
{
|
|
||||||
QAction* action = parent->addAction(text);
|
|
||||||
action->setShortcut(shortcut);
|
|
||||||
action->connect(action, &QAction::triggered, receiver, slot);
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "DolphinQt/Host.h"
|
#include "DolphinQt/Host.h"
|
||||||
#include "DolphinQt/QtUtils/ActionHelper.h"
|
|
||||||
#include "DolphinQt/Resources.h"
|
#include "DolphinQt/Resources.h"
|
||||||
#include "DolphinQt/Settings.h"
|
#include "DolphinQt/Settings.h"
|
||||||
#include "DolphinQt/ToolBar.h"
|
#include "DolphinQt/ToolBar.h"
|
||||||
@ -91,29 +90,29 @@ void ToolBar::OnDebugModeToggled(bool enabled)
|
|||||||
|
|
||||||
void ToolBar::MakeActions()
|
void ToolBar::MakeActions()
|
||||||
{
|
{
|
||||||
m_step_action = AddAction(this, tr("Step"), this, &ToolBar::StepPressed);
|
m_step_action = addAction(tr("Step"), this, &ToolBar::StepPressed);
|
||||||
m_step_over_action = AddAction(this, tr("Step Over"), this, &ToolBar::StepOverPressed);
|
m_step_over_action = addAction(tr("Step Over"), this, &ToolBar::StepOverPressed);
|
||||||
m_step_out_action = AddAction(this, tr("Step Out"), this, &ToolBar::StepOutPressed);
|
m_step_out_action = addAction(tr("Step Out"), this, &ToolBar::StepOutPressed);
|
||||||
m_skip_action = AddAction(this, tr("Skip"), this, &ToolBar::SkipPressed);
|
m_skip_action = addAction(tr("Skip"), this, &ToolBar::SkipPressed);
|
||||||
m_show_pc_action = AddAction(this, tr("Show PC"), this, &ToolBar::ShowPCPressed);
|
m_show_pc_action = addAction(tr("Show PC"), this, &ToolBar::ShowPCPressed);
|
||||||
m_set_pc_action = AddAction(this, tr("Set PC"), this, &ToolBar::SetPCPressed);
|
m_set_pc_action = addAction(tr("Set PC"), this, &ToolBar::SetPCPressed);
|
||||||
|
|
||||||
m_open_action = AddAction(this, tr("Open"), this, &ToolBar::OpenPressed);
|
m_open_action = addAction(tr("Open"), this, &ToolBar::OpenPressed);
|
||||||
m_refresh_action = AddAction(this, tr("Refresh"), this, &ToolBar::RefreshPressed);
|
m_refresh_action = addAction(tr("Refresh"), this, &ToolBar::RefreshPressed);
|
||||||
|
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
m_pause_play_action = AddAction(this, tr("Play"), this, &ToolBar::PlayPressed);
|
m_pause_play_action = addAction(tr("Play"), this, &ToolBar::PlayPressed);
|
||||||
|
|
||||||
m_stop_action = AddAction(this, tr("Stop"), this, &ToolBar::StopPressed);
|
m_stop_action = addAction(tr("Stop"), this, &ToolBar::StopPressed);
|
||||||
m_fullscreen_action = AddAction(this, tr("FullScr"), this, &ToolBar::FullScreenPressed);
|
m_fullscreen_action = addAction(tr("FullScr"), this, &ToolBar::FullScreenPressed);
|
||||||
m_screenshot_action = AddAction(this, tr("ScrShot"), this, &ToolBar::ScreenShotPressed);
|
m_screenshot_action = addAction(tr("ScrShot"), this, &ToolBar::ScreenShotPressed);
|
||||||
|
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
m_config_action = AddAction(this, tr("Config"), this, &ToolBar::SettingsPressed);
|
m_config_action = addAction(tr("Config"), this, &ToolBar::SettingsPressed);
|
||||||
m_graphics_action = AddAction(this, tr("Graphics"), this, &ToolBar::GraphicsPressed);
|
m_graphics_action = addAction(tr("Graphics"), this, &ToolBar::GraphicsPressed);
|
||||||
m_controllers_action = AddAction(this, tr("Controllers"), this, &ToolBar::ControllersPressed);
|
m_controllers_action = addAction(tr("Controllers"), this, &ToolBar::ControllersPressed);
|
||||||
m_controllers_action->setEnabled(true);
|
m_controllers_action->setEnabled(true);
|
||||||
|
|
||||||
// Ensure every button has about the same width
|
// Ensure every button has about the same width
|
||||||
|
Loading…
x
Reference in New Issue
Block a user