Projects
Eulaceura:Factory
drbd
_service:obs_scm:backport-DRBDmon-Fix-resource-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-DRBDmon-Fix-resource-volume-selection-count-labels.patch of Package drbd
From 6862969b90503baff054874fcba17987aee69744 Mon Sep 17 00:00:00 2001 From: Robert Altnoeder <robert.altnoeder@linbit.com> Date: Thu, 15 Feb 2024 18:03:13 +0100 Subject: [PATCH 067/100] DRBDmon: Fix resource & volume selection count labels --- user/drbdmon/terminal/MDspResourceActions.cpp | 9 ++++++++- user/drbdmon/terminal/MDspVolumeActions.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/user/drbdmon/terminal/MDspResourceActions.cpp b/user/drbdmon/terminal/MDspResourceActions.cpp index 2ea16807..621a8019 100644 --- a/user/drbdmon/terminal/MDspResourceActions.cpp +++ b/user/drbdmon/terminal/MDspResourceActions.cpp @@ -225,7 +225,14 @@ void MDspResourceActions::display_content() { ResourcesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_resources_map(); const size_t count = selection_map.get_size(); - dsp_comp_hub.dsp_io->write_fmt("%lu selected resources", static_cast<unsigned long> (count)); + if (count > 1) + { + dsp_comp_hub.dsp_io->write_fmt("%lu selected resources", static_cast<unsigned long> (count)); + } + else + { + dsp_comp_hub.dsp_io->write_fmt("%lu selected resource", static_cast<unsigned long> (count)); + } } else if (!dsp_comp_hub.dsp_shared->monitor_rsc.empty()) diff --git a/user/drbdmon/terminal/MDspVolumeActions.cpp b/user/drbdmon/terminal/MDspVolumeActions.cpp index 7daf1898..cb949a35 100644 --- a/user/drbdmon/terminal/MDspVolumeActions.cpp +++ b/user/drbdmon/terminal/MDspVolumeActions.cpp @@ -111,7 +111,14 @@ void MDspVolumeActions::display_content() { VolumesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_volumes_map(); const size_t count = selection_map.get_size(); - dsp_comp_hub.dsp_io->write_fmt("%lu selected volumes", static_cast<unsigned long> (count)); + if (count > 1) + { + dsp_comp_hub.dsp_io->write_fmt("%lu selected volumes", static_cast<unsigned long> (count)); + } + else + { + dsp_comp_hub.dsp_io->write_fmt("%lu selected volume", static_cast<unsigned long> (count)); + } } else if (dsp_comp_hub.dsp_shared->monitor_vlm != DisplayConsts::VLM_NONE) -- 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