Projects
Eulaceura:Factory
drbd
_service:obs_scm:backport-DRBDmon-Add-CLOSE-com...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-DRBDmon-Add-CLOSE-command.patch of Package drbd
From 60e1c2157d5386209ec5bfaa14109f9489f6089f Mon Sep 17 00:00:00 2001 From: Robert Altnoeder <robert.altnoeder@linbit.com> Date: Tue, 20 Feb 2024 15:49:24 +0100 Subject: [PATCH 070/100] DRBDmon: Add /CLOSE command --- user/drbdmon/terminal/GlobalCommandConsts.cpp | 1 + user/drbdmon/terminal/GlobalCommandConsts.h | 1 + user/drbdmon/terminal/GlobalCommandsImpl.cpp | 13 ++++++++++++- user/drbdmon/terminal/GlobalCommandsImpl.h | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/user/drbdmon/terminal/GlobalCommandConsts.cpp b/user/drbdmon/terminal/GlobalCommandConsts.cpp index 8c692878..70a8fe36 100644 --- a/user/drbdmon/terminal/GlobalCommandConsts.cpp +++ b/user/drbdmon/terminal/GlobalCommandConsts.cpp @@ -16,4 +16,5 @@ namespace cmd_names const std::string KEY_CMD_RESOURCE("RESOURCE"); const std::string KEY_CMD_CONNECTION("CONNECTION"); const std::string KEY_CMD_VOLUME("VOLUME"); + const std::string KEY_CMD_CLOSE("CLOSE"); } diff --git a/user/drbdmon/terminal/GlobalCommandConsts.h b/user/drbdmon/terminal/GlobalCommandConsts.h index a55974a7..ccf1fd36 100644 --- a/user/drbdmon/terminal/GlobalCommandConsts.h +++ b/user/drbdmon/terminal/GlobalCommandConsts.h @@ -19,6 +19,7 @@ namespace cmd_names extern const std::string KEY_CMD_RESOURCE; extern const std::string KEY_CMD_CONNECTION; extern const std::string KEY_CMD_VOLUME; + extern const std::string KEY_CMD_CLOSE; } #endif /* GLOBALCOMMANDCONSTS_H */ diff --git a/user/drbdmon/terminal/GlobalCommandsImpl.cpp b/user/drbdmon/terminal/GlobalCommandsImpl.cpp index ab549e1d..6d772b07 100644 --- a/user/drbdmon/terminal/GlobalCommandsImpl.cpp +++ b/user/drbdmon/terminal/GlobalCommandsImpl.cpp @@ -25,7 +25,8 @@ GlobalCommandsImpl::GlobalCommandsImpl(ComponentsHub& comp_hub, Configuration& c entry_cursor(&cmd_names::KEY_CMD_CURSOR, &GlobalCommandsImpl::local_command), entry_resource(&cmd_names::KEY_CMD_RESOURCE, &GlobalCommandsImpl::cmd_resource), entry_connection(&cmd_names::KEY_CMD_CONNECTION, &GlobalCommandsImpl::cmd_connection), - entry_volume(&cmd_names::KEY_CMD_VOLUME, &GlobalCommandsImpl::cmd_volume) + entry_volume(&cmd_names::KEY_CMD_VOLUME, &GlobalCommandsImpl::cmd_volume), + entry_close(&cmd_names::KEY_CMD_CLOSE, &GlobalCommandsImpl::cmd_close) { add_command(entry_exit); add_command(entry_display); @@ -40,6 +41,7 @@ GlobalCommandsImpl::GlobalCommandsImpl(ComponentsHub& comp_hub, Configuration& c add_command(entry_resource); add_command(entry_connection); add_command(entry_volume); + add_command(entry_close); } GlobalCommandsImpl::~GlobalCommandsImpl() noexcept @@ -303,6 +305,15 @@ bool GlobalCommandsImpl::cmd_volume(const std::string& command, StringTokenizer& return accepted; } +bool GlobalCommandsImpl::cmd_close(const std::string& command, StringTokenizer& tokenizer) +{ + bool accepted = true; + + dsp_comp_hub.dsp_selector->leave_display(); + + return accepted; +} + // Dummy method for display local commands bool GlobalCommandsImpl::local_command(const std::string& command, StringTokenizer& tokenizer) { diff --git a/user/drbdmon/terminal/GlobalCommandsImpl.h b/user/drbdmon/terminal/GlobalCommandsImpl.h index aa72863c..564693c9 100644 --- a/user/drbdmon/terminal/GlobalCommandsImpl.h +++ b/user/drbdmon/terminal/GlobalCommandsImpl.h @@ -36,6 +36,7 @@ class GlobalCommandsImpl : public GlobalCommands, public CommandsBase<GlobalComm Entry entry_resource; Entry entry_connection; Entry entry_volume; + Entry entry_close; bool cmd_exit(const std::string& command, StringTokenizer& tokenizer); bool cmd_display(const std::string& command, StringTokenizer& tokenizer); @@ -46,6 +47,7 @@ class GlobalCommandsImpl : public GlobalCommands, public CommandsBase<GlobalComm bool cmd_resource(const std::string& command, StringTokenizer& tokenizer); bool cmd_connection(const std::string& command, StringTokenizer& tokenizer); bool cmd_volume(const std::string& command, StringTokenizer& tokenizer); + bool cmd_close(const std::string& command, StringTokenizer& tokenizer); // Dummy method for display local commands bool local_command(const std::string& command, StringTokenizer& tokenizer); }; -- 2.33.1.windows.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2