Skip to content

Commit

Permalink
Add a button control buttons widget to open the debug adapter setting…
Browse files Browse the repository at this point in the history
…s dialog in
  • Loading branch information
xusheng6 committed Apr 11, 2023
1 parent dfbcc29 commit e10caa3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions debuggerui.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<file>icons/debugger.svg</file>
<file>icons/breakpoint.svg</file>
<file>icons/menu.png</file>
<file>icons/settings.svg</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions icons/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion open-source.md
Original file line number Diff line number Diff line change
@@ -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))
- [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/))
12 changes: 12 additions & 0 deletions ui/controlswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions ui/controlswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class DebugControlsWidget : public QToolBar
QAction* m_actionStepOver;
QAction* m_actionStepReturn;

QAction* m_actionSettings;

bool canExec();
bool canConnect();

Expand Down Expand Up @@ -75,4 +77,6 @@ public Q_SLOTS:
void performStepInto();
void performStepOver();
void performStepReturn();

void performSettings();
};

0 comments on commit e10caa3

Please sign in to comment.