Register global keybindings.

This commit is contained in:
Martín Lucas Golini
2025-01-05 17:22:21 -03:00
parent dafd342960
commit 424b50b7e8
4 changed files with 26 additions and 4 deletions

View File

@@ -2,8 +2,10 @@
#include "../../notificationcenter.hpp"
#include "../../projectbuild.hpp"
#include "../../uistatusbar.hpp"
#include "../../widgetcommandexecuter.hpp"
#include "busprocess.hpp"
#include "dap/debuggerclientdap.hpp"
#include "debuggerclientlistener.hpp"
#include "statusdebuggercontroller.hpp"
#include <eepp/graphics/primitives.hpp>
#include <eepp/system/filesystem.hpp>
@@ -111,6 +113,11 @@ DebuggerPlugin::~DebuggerPlugin() {
mDebugger.reset();
mListener.reset();
if ( !isShuttingDown() && getPluginContext()->getMainLayout() ) {
for ( const auto& kb : mKeyBindings )
getPluginContext()->getMainLayout()->getKeyBindings().removeCommandKeybind( kb.first );
}
}
void DebuggerPlugin::load( PluginManager* pluginManager ) {
@@ -294,8 +301,14 @@ PluginRequestHandle DebuggerPlugin::processMessage( const PluginMessage& msg ) {
break;
}
case ecode::PluginMessageType::UIReady: {
for ( const auto& kb : mKeyBindings ) {
getPluginContext()->getMainLayout()->getKeyBindings().addKeybindString( kb.second,
kb.first );
}
if ( !mInitialized )
updateUI();
break;
}
default:

View File

@@ -2,13 +2,19 @@
#include "../plugin.hpp"
#include "../pluginmanager.hpp"
#include "debuggerclientlistener.hpp"
#include "statusdebuggercontroller.hpp"
using namespace EE::UI::Models;
using namespace EE::UI;
namespace ecode {
class DebuggerClient;
class DebuggerClientListener;
namespace dap {
class SourceBreakpointStateful;
}
struct DapRunConfig {
std::string command;
std::vector<std::string> args;
@@ -66,7 +72,7 @@ class DebuggerPlugin : public PluginBase {
UIDropDownList* mUIDebuggerList{ nullptr };
UIDropDownList* mUIDebuggerConfList{ nullptr };
UIPushButton* mRunButton{ nullptr };
UnorderedMap<std::string, UnorderedSet<SourceBreakpointStateful>> mBreakpoints;
UnorderedMap<std::string, UnorderedSet<dap::SourceBreakpointStateful>> mBreakpoints;
UnorderedSet<std::string> mPendingBreakpoints;
Mutex mBreakpointsMutex;