Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gfpm/.git;a=commitdiff;h=0aadca6c6eced3c187b4b25dfa25c376dd18d58e

commit 0aadca6c6eced3c187b4b25dfa25c376dd18d58e
Author: Priyank <[EMAIL PROTECTED]>
Date:   Wed Aug 1 00:05:36 2007 +0530

gfpm-progress: display transfer rate only when fetching packages and not 
otherwise.

diff --git a/glade/gfpm.glade b/glade/gfpm.glade
index 7e15c97..15eb02c 100644
--- a/glade/gfpm.glade
+++ b/glade/gfpm.glade
@@ -569,26 +569,37 @@ Installed packages</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
-              <widget class="GtkLabel" id="label8">
+              <widget class="GtkHBox" id="rate_pr_box">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK 
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Transfer Rate:  
</property>
+                <child>
+                  <widget class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Transfer Rate:  
</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="rate_pr_label">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
-              <widget class="GtkLabel" id="rate_pr_label">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">1</property>
-              </packing>
+              <placeholder/>
</child>
<child>
<placeholder/>
diff --git a/src/gfpm-progress.c b/src/gfpm-progress.c
index 21d6251..500e46f 100644
--- a/src/gfpm-progress.c
+++ b/src/gfpm-progress.c
@@ -32,11 +32,12 @@

extern GladeXML *xml;

-GtkProgressBar *progressbar = NULL;
-GtkWidget      *progresswindow = NULL;
-GtkWidget      *main_label = NULL;
-GtkWidget      *sub_label = NULL;
-GtkWidget      *rate_label = NULL;
+GtkProgressBar         *progressbar = NULL;
+GtkWidget              *progresswindow = NULL;
+static GtkWidget       *main_label = NULL;
+static GtkWidget       *sub_label = NULL;
+static GtkWidget       *rate_label = NULL;
+static GtkWidget       *rate_box = NULL;

float           rate;
int             offset;
@@ -58,6 +59,7 @@ gfpm_progress_init (void)
main_label = glade_xml_get_widget (xml, "main_pr_label");
sub_label = glade_xml_get_widget (xml, "sub_pr_label");
rate_label = glade_xml_get_widget (xml, "rate_pr_label");
+       rate_box = glade_xml_get_widget (xml, "rate_pr_box");

return;
}
@@ -178,6 +180,7 @@ gfpm_progress_event (unsigned char event, void *data1, void 
*data2)

if (data1 == NULL)
return;
+       gtk_widget_hide (rate_box);
while (gtk_events_pending ())
gtk_main_iteration ();
switch (event)
@@ -221,6 +224,7 @@ gfpm_progress_event (unsigned char event, void *data1, void 
*data2)
break;
case PM_TRANS_EVT_RETRIEVE_START:       substr = g_strdup_printf (_("Retrieving 
packages from %s"), (char*)data1);
m = 1;
+                                                       gtk_widget_show 
(rate_box);
break;
default:                                return;
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to