[gnome-system-monitor] Fixed incorrectly translatable priority strings from change priority dialog. https://bugzilla.gnom



commit 1f699ffdf58f21b2e305b9bfd2c4e816b7de64a8
Author: Robert Roth <robert roth off gmail com>
Date:   Thu Sep 27 21:40:05 2012 +0300

    Fixed incorrectly translatable priority strings from change
     priority dialog.
     https://bugzilla.gnome.org/show_bug.cgi?id=674396

 src/procdialogs.cpp |    4 ++--
 src/util.cpp        |   14 ++++++++++++++
 src/util.h          |    2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index 806d8f4..61927dc 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -127,7 +127,7 @@ renice_scale_changed (GtkAdjustment *adj, gpointer data)
     GtkWidget *label = GTK_WIDGET (data);
 
     new_nice_value = int(gtk_adjustment_get_value (adj));
-    gchar* text = g_strdup_printf(_("(%s Priority)"), procman::get_nice_level (new_nice_value));
+    gchar* text = g_strdup(procman::get_nice_level_with_priority (new_nice_value));
     gtk_label_set_text (GTK_LABEL (label), text);
     g_free(text);
 
@@ -188,7 +188,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
     new_nice_value = 0;
     
     priority_label =  GTK_WIDGET (gtk_builder_get_object (builder, "priority_label"));
-    gtk_label_set_label (GTK_LABEL(priority_label), procman::get_nice_level (info->nice));
+    gtk_label_set_label (GTK_LABEL(priority_label), procman::get_nice_level_with_priority (info->nice));
 
     text = g_strconcat("<small><i><b>", _("Note:"), "</b> ",
                        _("The priority of a process is given by its nice value. A lower nice value corresponds to a higher priority."),
diff --git a/src/util.cpp b/src/util.cpp
index d930059..660664d 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -225,6 +225,20 @@ procman::get_nice_level (gint nice)
         return _("Very Low");
 }
 
+gchar *
+procman::get_nice_level_with_priority (gint nice)
+{
+    if (nice < -7)
+        return _("Very High Priority");
+    else if (nice < -2)
+        return _("High Priority");
+    else if (nice < 3)
+        return _("Normal Priority");
+    else if (nice < 7)
+        return _("Low Priority");
+    else
+        return _("Very Low Priority");
+}
 
 gboolean
 load_symbols(const char *module, ...)
diff --git a/src/util.h b/src/util.h
index 8db79c1..9bd4b2c 100644
--- a/src/util.h
+++ b/src/util.h
@@ -151,6 +151,8 @@ namespace procman
 
     gchar* get_nice_level (gint nice);
 
+    gchar* get_nice_level_with_priority (gint nice);
+
     std::string format_rate(guint64 rate, guint64 max_rate = 0, bool want_bits = false);
 
     std::string format_network(guint64 rate, guint64 max_rate = 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]