[gnome-disk-utility] don't show tasks if the number of tasks is undefined or less than 2



commit 015d9e438b7b24d85a5a61b788ca5c7fc6144d6b
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 30 17:18:41 2009 -0400

    don't show tasks if the number of tasks is undefined or less than 2
    
    http://bugzilla.gnome.org/show_bug.cgi?id=575854
    
    Signed-off-by: David Zeuthen <davidz redhat com>
---
 src/palimpsest/gdu-section-job.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/palimpsest/gdu-section-job.c b/src/palimpsest/gdu-section-job.c
index ec8bac1..b5e13d6 100644
--- a/src/palimpsest/gdu-section-job.c
+++ b/src/palimpsest/gdu-section-job.c
@@ -100,12 +100,16 @@ job_update (GduSectionJob *section, GduDevice *device)
                 gtk_label_set_markup (GTK_LABEL (section->priv->job_description_label), s);
                 g_free (s);
 
-                s = g_strdup_printf (_("%s (task %d of %d)"),
-                                     task_description,
-                                     gdu_device_job_get_cur_task (device) + 1,
-                                     gdu_device_job_get_num_tasks (device));
-                gtk_label_set_markup (GTK_LABEL (section->priv->job_task_label), s);
-                g_free (s);
+		if (gdu_device_job_get_num_tasks (device) < 2)
+                        gtk_label_set_markup (GTK_LABEL (section->priv->job_task_label), task_description);
+                else {
+                        s = g_strdup_printf (_("%s (task %d of %d)"),
+                                             task_description,
+                                             gdu_device_job_get_cur_task (device) + 1,
+                                             gdu_device_job_get_num_tasks (device));
+                        gtk_label_set_markup (GTK_LABEL (section->priv->job_task_label), s);
+                        g_free (s);
+                }
 
                 percentage = gdu_device_job_get_cur_task_percentage (device);
                 if (percentage < 0) {



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