summaryrefslogtreecommitdiff
path: root/src/procdialogs.cpp
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-18 21:30:25 +0100
committerinfirit <[email protected]>2014-12-18 21:31:13 +0100
commit6034caada16eab3b07e090c0f2b29a1a3dd9d105 (patch)
tree8d7d47e968444258975bdd887821f7694241451d /src/procdialogs.cpp
parentad78931540508c4f3d52d938852c47086ce7b03f (diff)
downloadmate-system-monitor-6034caada16eab3b07e090c0f2b29a1a3dd9d105.tar.bz2
mate-system-monitor-6034caada16eab3b07e090c0f2b29a1a3dd9d105.tar.xz
Priority column to the process table to show user-friendly nice values
Taken from GSM commit: 6fcbf5aaa65d63dd751c812c3ac05a937b50450d From: Robert Roth <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=131802
Diffstat (limited to 'src/procdialogs.cpp')
-rw-r--r--src/procdialogs.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index d129bd9..c51a769 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -115,28 +115,15 @@ procdialog_create_kill_dialog (ProcData *procdata, int signal)
gtk_widget_show_all (kill_alert_dialog);
}
-static gchar *
-get_nice_level (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)");
-}
-
static void
renice_scale_changed (GtkAdjustment *adj, gpointer data)
{
GtkWidget *label = GTK_WIDGET (data);
new_nice_value = int(gtk_adjustment_get_value (adj));
- gtk_label_set_text (GTK_LABEL (label), get_nice_level (new_nice_value));
+ gchar* text = g_strdup_printf(_("(%s Priority)"), procman::get_nice_level (new_nice_value));
+ gtk_label_set_text (GTK_LABEL (label), text);
+ g_free(text);
}
@@ -232,10 +219,11 @@ procdialog_create_renice_dialog (ProcData *procdata)
gtk_scale_set_digits (GTK_SCALE (hscale), 0);
gtk_table_attach (GTK_TABLE (table), hscale, 1, 2, 0, 1,
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0);
-
- priority_label = gtk_label_new (get_nice_level (info->nice));
+ text = g_strdup_printf(_("(%s Priority)"), procman::get_nice_level (info->nice));
+ priority_label = gtk_label_new (text);
gtk_table_attach (GTK_TABLE (table), priority_label, 1, 2, 1, 2,
GTK_FILL, GTK_FILL, 0, 0);
+ g_free(text);
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."),