[Goodies-commits] r2328 - in xfce4-diskperf-plugin/trunk: . panel-plugin

Nick Schermer nick at xfce.org
Tue Jan 9 20:00:37 CET 2007


Author: nick
Date: 2007-01-09 19:00:37 +0000 (Tue, 09 Jan 2007)
New Revision: 2328

Modified:
   xfce4-diskperf-plugin/trunk/ChangeLog
   xfce4-diskperf-plugin/trunk/panel-plugin/main.c
Log:
panel-plugin/main.c: Apply patch from bug 1842


Modified: xfce4-diskperf-plugin/trunk/ChangeLog
===================================================================
--- xfce4-diskperf-plugin/trunk/ChangeLog	2007-01-09 18:41:36 UTC (rev 2327)
+++ xfce4-diskperf-plugin/trunk/ChangeLog	2007-01-09 19:00:37 UTC (rev 2328)
@@ -1,3 +1,6 @@
+2006-01-09 Nick Schermer
+	* Apply patch from bug 1842
+
 2003-10-07 1.0 Roger Seguin
 	* Initial release (1.0) - Linux 2.4.x, x >= 20
 

Modified: xfce4-diskperf-plugin/trunk/panel-plugin/main.c
===================================================================
--- xfce4-diskperf-plugin/trunk/panel-plugin/main.c	2007-01-09 18:41:36 UTC (rev 2327)
+++ xfce4-diskperf-plugin/trunk/panel-plugin/main.c	2007-01-09 19:00:37 UTC (rev 2328)
@@ -141,6 +141,8 @@
 
 	/**************************************************************/
 
+static int timerNeedsUpdate = 0;
+
 static int DisplayPerf (struct diskperf_t *p_poPlugin)
  /* Get the last disk perfomance data, compute the statistics and update
     the panel-docked monitor bars */
@@ -272,6 +274,12 @@
     struct param_t *poConf = &(poPlugin->oConf.oParam);
 
     DisplayPerf (poPlugin);
+    
+    if (timerNeedsUpdate) {
+        g_source_remove (poPlugin->iTimerId);
+        poPlugin->iTimerId = 0;
+        timerNeedsUpdate = 0;
+    }
 
     if (!poPlugin->iTimerId)
         poPlugin->iTimerId = g_timeout_add (poConf->iPeriod_ms,
@@ -773,6 +781,7 @@
     struct param_t *poConf = &(poPlugin->oConf.oParam);
     float           r;
 
+    timerNeedsUpdate = 1;
     TRACE ("SetPeriod()\n");
     r = gtk_spin_button_get_value (GTK_SPIN_BUTTON (p_wSc));
     poConf->iPeriod_ms = (r * 1000) + 0.5;	/* rounded */
@@ -1096,8 +1105,6 @@
 {
     diskperf_t *diskperf = diskperf_create_control (plugin);
 
-    diskperf_read_config (plugin, diskperf);
-
     g_signal_connect (plugin, "free-data", G_CALLBACK (diskperf_free), 
                       diskperf);
 
@@ -1121,6 +1128,9 @@
 
     CreateMonitorBars (diskperf, xfce_panel_plugin_get_orientation (plugin));
     
+    diskperf_read_config (plugin, diskperf);
+    DevPerfInit();
+    
     SetTimer (diskperf);
 }
 




More information about the Goodies-commits mailing list