From e10caa3ee5dd3d242eaa0110d0b9b2f2f5bd4c7a Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 31 Mar 2023 18:05:00 +0800 Subject: [PATCH] Add a button control buttons widget to open the debug adapter settings dialog in --- debuggerui.qrc | 1 + icons/settings.svg | 1 + open-source.md | 3 ++- ui/controlswidget.cpp | 12 ++++++++++++ ui/controlswidget.h | 4 ++++ 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 icons/settings.svg diff --git a/debuggerui.qrc b/debuggerui.qrc index 3ab46ef4..1685e889 100644 --- a/debuggerui.qrc +++ b/debuggerui.qrc @@ -14,5 +14,6 @@ icons/debugger.svg icons/breakpoint.svg icons/menu.png + icons/settings.svg diff --git a/icons/settings.svg b/icons/settings.svg new file mode 100644 index 00000000..4f33e750 --- /dev/null +++ b/icons/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/open-source.md b/open-source.md index f137c1d9..2b02cfdd 100644 --- a/open-source.md +++ b/open-source.md @@ -1,3 +1,4 @@ ## Open Source - [fmt](https://github.com/fmtlib/fmt) ([fmt license](https://github.com/fmtlib/fmt/blob/master/LICENSE.rst) - MIT) -- [lldb](https://lldb.llvm.org/) ([Apache 2.0 License with LLVM exceptions](https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework)) \ No newline at end of file +- [lldb](https://lldb.llvm.org/) ([Apache 2.0 License with LLVM exceptions](https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework)) +- [Settings icon](https://www.iconfinder.com/icons/9035575/settings_outline_icon) ([MIT](https://opensource.org/license/mit/)) \ No newline at end of file diff --git a/ui/controlswidget.cpp b/ui/controlswidget.cpp index f7030372..52aed6c3 100644 --- a/ui/controlswidget.cpp +++ b/ui/controlswidget.cpp @@ -98,7 +98,12 @@ DebugControlsWidget::DebugControlsWidget(QWidget* parent, const std::string name performStepReturn(); }); m_actionStepReturn->setToolTip(getToolTip("Step Return")); + addSeparator(); + m_actionSettings = addAction(getColoredIcon(":/debugger_icons/icons/settings.svg", cyan), "Settings", [this]() { + performSettings(); + }); + m_actionSettings->setToolTip(getToolTip("Debug Adapter Settings")); updateButtons(); } @@ -244,6 +249,13 @@ void DebugControlsWidget::performStepReturn() } +void DebugControlsWidget::performSettings() +{ + auto* dialog = new AdapterSettingsDialog(this, m_controller); + dialog->show(); +} + + bool DebugControlsWidget::canExec() { auto currentAdapter = m_controller->GetAdapterType(); diff --git a/ui/controlswidget.h b/ui/controlswidget.h index 4a96a831..bbe3eb21 100644 --- a/ui/controlswidget.h +++ b/ui/controlswidget.h @@ -47,6 +47,8 @@ class DebugControlsWidget : public QToolBar QAction* m_actionStepOver; QAction* m_actionStepReturn; + QAction* m_actionSettings; + bool canExec(); bool canConnect(); @@ -75,4 +77,6 @@ public Q_SLOTS: void performStepInto(); void performStepOver(); void performStepReturn(); + + void performSettings(); };