Skip to content

Commit

Permalink
Merge pull request #6853 from aldelaro5/qt-debugger-hotkey-fixes
Browse files Browse the repository at this point in the history
Qt debugger hotkey fixes
  • Loading branch information
leoetlino committed May 18, 2018
2 parents cfe7f0f + 0a2357f commit 49c9c1e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
13 changes: 12 additions & 1 deletion Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
Expand Up @@ -289,7 +289,18 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
widget = new HotkeyGeneral(this);
AddWidget(tr("General"), widget);
AddWidget(tr("TAS Tools"), new HotkeyTAS(this));
AddWidget(tr("Debugging"), new HotkeyDebugging(this));

HotkeyDebugging* debugging_widget = new HotkeyDebugging(this);
QWidget* debugging_widget_wrapper = GetWrappedWidget(debugging_widget, this, 150, 150);
connect(&Settings::Instance(), &Settings::DebugModeToggled, this, [=](bool enabled) {
if (enabled)
m_tab_widget->insertTab(2, debugging_widget_wrapper, tr("Debugging"));
else
m_tab_widget->removeTab(2);
});
if (Settings::Instance().IsDebugModeEnabled())
AddWidget(tr("Debugging"), debugging_widget);

AddWidget(tr("Wii and Wii Remote"), new HotkeyWii(this));
AddWidget(tr("Graphics"), new HotkeyGraphics(this));
AddWidget(tr("3D"), new Hotkey3D(this));
Expand Down
54 changes: 31 additions & 23 deletions Source/Core/DolphinQt2/HotkeyScheduler.cpp
Expand Up @@ -213,29 +213,10 @@ void HotkeyScheduler::Run()
IsHotkey(HK_TRIGGER_SYNC_BUTTON, true));
}

if (IsHotkey(HK_STEP))
emit Step();

if (IsHotkey(HK_STEP_OVER))
emit StepOver();

if (IsHotkey(HK_STEP_OUT))
emit StepOut();

if (IsHotkey(HK_SKIP))
emit Skip();

if (IsHotkey(HK_SHOW_PC))
emit ShowPC();

if (IsHotkey(HK_SET_PC))
emit Skip();

if (IsHotkey(HK_BP_TOGGLE))
emit ToggleBreakpoint();

if (IsHotkey(HK_BP_ADD))
emit AddBreakpoint();
if (SConfig::GetInstance().bEnableDebugging)
{
CheckDebuggingHotkeys();
}

// TODO: HK_MBP_ADD

Expand Down Expand Up @@ -468,3 +449,30 @@ void HotkeyScheduler::Run()
emit StateSaveUndo();
}
}

void HotkeyScheduler::CheckDebuggingHotkeys()
{
if (IsHotkey(HK_STEP))
emit Step();

if (IsHotkey(HK_STEP_OVER))
emit StepOver();

if (IsHotkey(HK_STEP_OUT))
emit StepOut();

if (IsHotkey(HK_SKIP))
emit Skip();

if (IsHotkey(HK_SHOW_PC))
emit ShowPC();

if (IsHotkey(HK_SET_PC))
emit Skip();

if (IsHotkey(HK_BP_TOGGLE))
emit ToggleBreakpoint();

if (IsHotkey(HK_BP_ADD))
emit AddBreakpoint();
}
1 change: 1 addition & 0 deletions Source/Core/DolphinQt2/HotkeyScheduler.h
Expand Up @@ -57,6 +57,7 @@ class HotkeyScheduler : public QObject

private:
void Run();
void CheckDebuggingHotkeys();

Common::Flag m_stop_requested;
std::thread m_thread;
Expand Down

0 comments on commit 49c9c1e

Please sign in to comment.