[gnome-system-monitor] Use pluralized end process button on revealer
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Use pluralized end process button on revealer
- Date: Thu, 30 Jan 2020 21:03:53 +0000 (UTC)
commit ea7a604d30b304409c8db5b77e54ab1fc8c7dcc0
Author: Robert Roth <robert roth off gmail com>
Date: Thu Jan 30 23:03:28 2020 +0200
Use pluralized end process button on revealer
data/interface.ui | 2 +-
src/proctable.cpp | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/data/interface.ui b/data/interface.ui
index d136f1dd..ecabaecf 100644
--- a/data/interface.ui
+++ b/data/interface.ui
@@ -147,7 +147,7 @@
<property name="visible">True</property>
<child>
<object class="GtkButton" id="end_process_button">
- <property name="label" translatable="yes">End _Process</property>
+ <property name="label" translatable="yes">_End Process</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/src/proctable.cpp b/src/proctable.cpp
index a20ab6d2..b980fb02 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -140,6 +140,12 @@ cb_row_selected (GtkTreeSelection *selection, gpointer data)
GsmApplication *app = (GsmApplication *) data;
ProcInfo *selected_process = NULL;
+ gint selected_count = gtk_tree_selection_count_selected_rows (selection);
+
+ app->selection = selection;
+
+ gchar *button_text = ngettext("_End Process", "_End Processes", selected_count);
+ gtk_button_set_label (GTK_BUTTON(app->end_process_button), button_text);
/* get the most recent selected process and determine if there are
** no selected processes
@@ -612,8 +618,6 @@ proctable_new (GsmApplication * const app)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (proctree));
- app->selection = selection;
-
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
g_signal_connect (G_OBJECT (selection),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]