Hello,
I discovered distcc recently and I'm very impressed by how well it
works.

The attached patch improves distccmon-gnome by replacing the label with
a real status bar.  It looks better, has a grab handle for resizing the
window, and follows the HIG.

Nathan
* looking for [EMAIL PROTECTED]/distcc--devel--2--patch-59 to compare with
* comparing to [EMAIL PROTECTED]/distcc--devel--2--patch-59
M  src/mon-gnome.c

* modified files

--- orig/src/mon-gnome.c
+++ mod/src/mon-gnome.c
@@ -420,10 +420,11 @@
 }
 
 
-static gint dcc_gnome_load_update_cb (gpointer label_void)
+static gint dcc_gnome_load_update_cb (gpointer data)
 {
   gchar message[200];
   double loadavg[3];
+  gint context_id;
 
   if (getloadavg (loadavg, 3) == -1)
     {
@@ -435,8 +436,10 @@
             "Load average: %.2f, %.2f, %.2f",
             loadavg[0], loadavg[1], loadavg[2]);
 
-  gtk_label_set_text (GTK_LABEL (label_void),
-                      message);
+  context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR (data), "load");
+
+  gtk_statusbar_pop(GTK_STATUSBAR (data), context_id);
+  gtk_statusbar_push(GTK_STATUSBAR (data), context_id, message);
 
   return TRUE;                  /* please call again */
 }
@@ -551,11 +554,13 @@
 
 static GtkWidget * dcc_gnome_make_load_bar (void)
 {
-  GtkWidget *bar, *box;
+  GtkWidget *bar;
+  gint context_id;
+
+  bar = gtk_statusbar_new ();
+  context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR (bar), "load");
 
-  bar = gtk_label_new ("Load: ");
-  box = gtk_hbox_new (FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (box), bar, FALSE, FALSE, 6);
+  gtk_statusbar_push(GTK_STATUSBAR (bar), context_id, "Load: ");
 
   g_timeout_add (2000,          /* ms */
                  dcc_gnome_load_update_cb,
@@ -563,7 +568,7 @@
 
   dcc_gnome_load_update_cb (bar);
 
-  return box;
+  return bar;
 }
 
 
@@ -617,13 +622,11 @@
   gtk_container_add (GTK_CONTAINER (topbox),
                      proc_align);
 
-  /* Standard gnome padding is 12px */
-
   gtk_box_pack_end (GTK_BOX (topbox),
                     load_bar,
                     FALSE, /* expand */
                     FALSE,
-                    6);
+                    0);
     
   gtk_window_set_title (GTK_WINDOW (mainwin),
                         dcc_gnome_get_title ());



__ 
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options: 
http://lists.samba.org/mailman/listinfo/distcc

Reply via email to