[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 02/03: Some intermediate Clean-Up: Lint'ing, indendation, code cleanup wrt. tooltips because of outstanding bugs with tacho display

noreply at xfce.org noreply at xfce.org
Sun Mar 20 23:12:11 CET 2016


This is an automated email from the git hooks/post-receive script.

timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.

commit 3facd3555658154fe84e8eec4953303f99036fc9
Author: Fabian <timystery at arcor.de>
Date:   Sun Mar 20 23:08:12 2016 +0100

    Some intermediate Clean-Up: Lint'ing, indendation, code cleanup wrt. tooltips because of outstanding bugs with tacho display
---
 lib/acpi.c                     |   2 +-
 lib/configuration.c            |   9 +-
 lib/cpu.c                      |   4 +-
 lib/hddtemp.c                  |   3 +-
 lib/nvidia.c                   | 242 +++++++++++++++++++++--------------------
 lib/sensors-interface-common.c |   1 +
 lib/sensors-interface.c        |   9 +-
 panel-plugin/sensors-plugin.c  |  27 ++---
 src/actions.c                  |  14 +--
 src/callbacks.c                |  16 +--
 src/interface.c                |  10 +-
 src/interface.h                |   1 -
 12 files changed, 157 insertions(+), 181 deletions(-)

diff --git a/lib/acpi.c b/lib/acpi.c
index 2ad2d63..4b21616 100644
--- a/lib/acpi.c
+++ b/lib/acpi.c
@@ -762,7 +762,7 @@ get_acpi_value (char *filename)
     if (!file)
         return NULL;
 
-    p = fgets (buf, 1024, file);
+    fgets (buf, 1024, file);
     fclose (file);
 
     p = strip_key_colon_spaces (buf);
diff --git a/lib/configuration.c b/lib/configuration.c
index 50fa5bb..bd3f360 100644
--- a/lib/configuration.c
+++ b/lib/configuration.c
@@ -255,6 +255,7 @@ sensors_read_general_config (XfceRc *rc, t_sensors *sensors)
     TRACE ("leaves sensors_read_general_config");
 }
 
+
 void
 sensors_read_preliminary_config (XfcePanelPlugin *plugin, t_sensors *sensors)
 {
@@ -283,6 +284,7 @@ sensors_read_preliminary_config (XfcePanelPlugin *plugin, t_sensors *sensors)
     TRACE ("leaves sensors_read_preliminary_config");
 }
 
+
 /* Read the configuration file at init */
 // TODO: modify to store chipname as indicator and access features by acpitz-1_Feature0 etc.
 // this will require differently storing the stuff as well. 
@@ -343,10 +345,9 @@ sensors_read_config (XfcePanelPlugin *plugin, t_sensors *sensors)
               chip = (t_chip *) g_ptr_array_index (sensors->chips, k++);
               if (chip==NULL || k==sensors->num_sensorchips)
                   break;
-              //DBG("k=%d, chip=%p, name=.\n", k, chip);
               }
             while (chip!=NULL && sensorName != NULL && strcmp(chip->sensorId, sensorName) != 0 );
-            //DBG("Found a chip.\n");
+            
             if ( chip!=NULL && sensorName != NULL && strcmp(chip->sensorId, sensorName)==0 ) {
 
                 for (j=0; j<chip->num_features; j++) {
@@ -360,7 +361,7 @@ sensors_read_config (XfcePanelPlugin *plugin, t_sensors *sensors)
                     if (xfce_rc_has_group (rc, feature)) {
                         xfce_rc_set_group (rc, feature);
 
-                        id=0; address=0;
+                        address=0;
 
                         id = (gint) xfce_rc_read_int_entry (rc, "Id", 0);
 
@@ -368,7 +369,7 @@ sensors_read_config (XfcePanelPlugin *plugin, t_sensors *sensors)
                             address = (gint) xfce_rc_read_int_entry (rc, "Address", 0);
                         else
 
-                         /* FIXME: compare strings, or also have hddtmep and acpi store numeric values */
+                         /* FIXME: compare strings, or also have hddtemp and acpi store numeric values */
 
                         /* assert correctly saved file */
                         if (strcmp(chip->sensorId, _("Hard disks")) != 0) { /* chip->name? */
diff --git a/lib/cpu.c b/lib/cpu.c
index 4fbf386..5a98538 100644
--- a/lib/cpu.c
+++ b/lib/cpu.c
@@ -209,10 +209,10 @@ gtk_cpu_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
   //int minwh;
   
   TRACE("enter gtk_cpu_size_allocate\n");
-  DBG ("width x height = %d x %d\n", allocation->width, allocation->height);
   g_return_if_fail(widget != NULL);
   g_return_if_fail(GTK_IS_CPU(widget));
   g_return_if_fail(allocation != NULL);
+  DBG ("width x height = %d x %d\n", allocation->width, allocation->height);
 
   //minwh = min(allocation->width, allocation->height);
   //DBG("minimum is %d\n", minwh);
@@ -282,10 +282,10 @@ static gboolean
 gtk_cpu_expose(GtkWidget *widget, GdkEventExpose *event)
 {
   TRACE("enter gtk_cpu_expose\n");
-  DBG("event: %d\n", event->type);
   g_return_val_if_fail(widget != NULL, FALSE);
   g_return_val_if_fail(GTK_IS_CPU(widget), FALSE);
   g_return_val_if_fail(event != NULL, FALSE);
+  DBG("event: %d\n", event->type);
 
   gtk_cpu_paint(widget);
 
diff --git a/lib/hddtemp.c b/lib/hddtemp.c
index cb5139c..d9708b5 100644
--- a/lib/hddtemp.c
+++ b/lib/hddtemp.c
@@ -568,9 +568,8 @@ get_hddtemp_value (char* disk, gboolean *suppressmessage)
             tmp3 = strtok (tmp2, SINGLE_DELIMITER); // device name
             if (strcmp(tmp3, disk)==0)
             {
-                tmp3 = strtok(NULL, SINGLE_DELIMITER); // name
+                strtok(NULL, SINGLE_DELIMITER); // name
                 tmp3 = strdup(strtok(NULL, SINGLE_DELIMITER)); // value
-                // tmp3 = strtok(NULL, SINGLE_DELIMITER); // temperature unit
                 exit_status = 0;
                 g_free(error);
                 error = NULL;
diff --git a/lib/nvidia.c b/lib/nvidia.c
index 47961f9..85ac0a6 100644
--- a/lib/nvidia.c
+++ b/lib/nvidia.c
@@ -45,138 +45,144 @@ int read_gpus (t_chip *chip);
 /* Defines */
 #define ZERO_KELVIN -273
 
-int initialize_nvidia (GPtrArray *chips) {
-	int retval;
-	int num_gpus;
-	t_chip *chip;
-	t_chipfeature *chipfeature;
-
-	TRACE ("enters initialize_nvidia");
-	
-	chip = g_new0 (t_chip, 1);
-	//chip -> chip_name = g_strdup(_("nvidia"));
-	chip -> chip_features = g_ptr_array_new ();
-	chip -> num_features = 0;
-	chip -> description = g_strdup(_("NVidia GPU core temperature"));
-	chip -> name = g_strdup(_("nvidia"));
-	chip -> sensorId = g_strdup("nvidia");
-	chip -> type = GPU;
-
-	num_gpus = read_gpus (chip);
-	if (chip -> num_features > 0) {
-		int i;
-		for (i = 0; i < num_gpus; i++) {
-			chipfeature = g_ptr_array_index (chip -> chip_features, i);
-			g_assert (chipfeature != NULL);
-			chipfeature -> address = i;
-			chipfeature -> name = g_strdup(chipfeature -> devicename);
-			chipfeature -> color = g_strdup ("#000000");
-			chipfeature -> valid = TRUE;
-			chipfeature -> formatted_value = g_strdup ("0.0");
-			chipfeature -> raw_value = 0.0;
-			chipfeature -> class = TEMPERATURE;
-			chipfeature -> min_value = 10.0;
-			chipfeature -> max_value = 50.0;
-			chipfeature -> show = FALSE;
-		}
-		g_ptr_array_add (chips, chip);
-		retval = 2;
-	} else retval = 0;
-
-	TRACE ("leaves initialize_nvidia");
-
-	return retval;
+int initialize_nvidia (GPtrArray *chips) 
+{
+    int retval;
+    int num_gpus;
+    t_chip *chip;
+    t_chipfeature *chipfeature;
+
+    TRACE ("enters initialize_nvidia");
+    
+    chip = g_new0 (t_chip, 1);
+    //chip -> chip_name = g_strdup(_("nvidia"));
+    chip -> chip_features = g_ptr_array_new ();
+    chip -> num_features = 0;
+    chip -> description = g_strdup(_("NVidia GPU core temperature"));
+    chip -> name = g_strdup(_("nvidia"));
+    chip -> sensorId = g_strdup("nvidia");
+    chip -> type = GPU;
+
+    num_gpus = read_gpus (chip);
+    if (chip -> num_features > 0) {
+        int i;
+        for (i = 0; i < num_gpus; i++) {
+            chipfeature = g_ptr_array_index (chip -> chip_features, i);
+            g_assert (chipfeature != NULL);
+            chipfeature -> address = i;
+            chipfeature -> name = g_strdup(chipfeature -> devicename);
+            chipfeature -> color = g_strdup ("#000000");
+            chipfeature -> valid = TRUE;
+            chipfeature -> formatted_value = g_strdup ("0.0");
+            chipfeature -> raw_value = 0.0;
+            chipfeature -> class = TEMPERATURE;
+            chipfeature -> min_value = 10.0;
+            chipfeature -> max_value = 50.0;
+            chipfeature -> show = FALSE;
+        }
+        g_ptr_array_add (chips, chip);
+        retval = 2;
+    } 
+    else 
+        retval = 0;
+
+    TRACE ("leaves initialize_nvidia");
+
+    return retval;
 }
 
-double get_nvidia_value (int gpu) {
-	int temp;
 
-	TRACE ("enters get_nvidia_value for %d gpu", gpu);
+double get_nvidia_value (int gpu) 
+{
+    int temp;
 
-	if (!(XNVCTRLQueryTargetAttribute (nvidia_sensors_display, 
-				NV_CTRL_TARGET_TYPE_GPU,
-				gpu,
-				0,
-				NV_CTRL_GPU_CORE_TEMPERATURE,
-				&temp))) {
-		TRACE ("NVCtrl doesn't work properly");
-		return ZERO_KELVIN;
-	}
+    TRACE ("enters get_nvidia_value for %d gpu", gpu);
 
-	TRACE ("leaves get_nvidia_value for %d gpu", gpu);
+    if (!(XNVCTRLQueryTargetAttribute (nvidia_sensors_display, 
+                                       NV_CTRL_TARGET_TYPE_GPU,
+                                       gpu,
+                                       0,
+                                       NV_CTRL_GPU_CORE_TEMPERATURE,
+                                       &temp))) {
+        TRACE ("NVCtrl doesn't work properly");
+        return ZERO_KELVIN;
+    }
 
-	return (double) (1.0 * temp);
+    TRACE ("leaves get_nvidia_value for %d gpu", gpu);
+
+    return (double) (1.0 * temp);
 }
 
-void refresh_nvidia (gpointer chip_feature, gpointer data) {
-	t_chipfeature *cf;
-	double value;
-	t_sensors *sensors;
 
-	g_assert (chip_feature != NULL);
+void refresh_nvidia (gpointer chip_feature, gpointer data) 
+{
+    t_chipfeature *cf;
+    double value;
 
-	TRACE ("enters refresh_nvidia");
+    g_assert (chip_feature != NULL);
 
-	if (data) sensors = (t_sensors *) data;	
-	cf = (t_chipfeature *) chip_feature;
-	value = get_nvidia_value (cf -> address);
-	if (value == ZERO_KELVIN) return; 
+    TRACE ("enters refresh_nvidia");
 
-	g_free (cf -> formatted_value);
-	cf -> formatted_value = g_strdup_printf(_("%.1f °C"), value);
-	cf -> raw_value = value;
+    cf = (t_chipfeature *) chip_feature;
+    value = get_nvidia_value (cf -> address);
+    if (value == ZERO_KELVIN) 
+        return; 
 
-	TRACE ("leaves refresh_nvidia");
+    g_free (cf -> formatted_value);
+    cf -> formatted_value = g_strdup_printf(_("%.1f °C"), value);
+    cf -> raw_value = value;
 
+    TRACE ("leaves refresh_nvidia");
 }
 
-int read_gpus (t_chip *chip) {
-	t_chipfeature *chipfeature;
-	int num_gpus;
-	int event, error;
-	int i;
-
-	TRACE ("enters read_gpus");
-
-	/* create the connection to the X server */
-	if (!(nvidia_sensors_display = XOpenDisplay (NULL))) {
-		TRACE ("failed to connect to X server");
-		return 0;
-	}
-
-	/* check if the NVCtrl is available on this X server
-	 * if so - add sensors*/
-	if (!(XNVCTRLQueryExtension (nvidia_sensors_display, 
-			&event, &error))) {
-		TRACE ("NVCtrl is not available");
-		return 0;
-	}
-	
-	if (!(XNVCTRLQueryTargetCount (nvidia_sensors_display,
-			NV_CTRL_TARGET_TYPE_GPU,
-			&num_gpus))) {
-		TRACE ("No NVidia devices found");
-		return 0;
-	}
-	
-	for (i = 0; i < num_gpus; i++){ 
-		gchar *device_name = (gchar*) malloc (100 * sizeof(gchar));
-		if (XNVCTRLQueryTargetStringAttribute (
-					nvidia_sensors_display,
-					NV_CTRL_TARGET_TYPE_GPU, 
-					i,
-					0,
-					NV_CTRL_STRING_PRODUCT_NAME,
-					&device_name))
-			TRACE ("GPU%d:%s", i, device_name);
-		chipfeature = g_new0 (t_chipfeature, 1);
-		chipfeature -> devicename = g_strdup (device_name);
-		chipfeature -> name = g_strdup (device_name);
-		g_ptr_array_add (chip -> chip_features, chipfeature);
-		chip -> num_features++;
-	}
-
-	TRACE ("leaves read_gpus");
-	return num_gpus;
-}
 
+int read_gpus (t_chip *chip) 
+{
+    t_chipfeature *chipfeature;
+    int num_gpus;
+    int event, error;
+    int i;
+
+    TRACE ("enters read_gpus");
+
+    /* create the connection to the X server */
+    if (!(nvidia_sensors_display = XOpenDisplay (NULL))) {
+        TRACE ("failed to connect to X server");
+        return 0;
+    }
+
+    /* check if the NVCtrl is available on this X server
+     * if so - add sensors*/
+    if (!(XNVCTRLQueryExtension (nvidia_sensors_display, 
+                &event, &error))) {
+        TRACE ("NVCtrl is not available");
+        return 0;
+    }
+    
+    if (!(XNVCTRLQueryTargetCount (nvidia_sensors_display,
+            NV_CTRL_TARGET_TYPE_GPU,
+            &num_gpus))) {
+        TRACE ("No NVidia devices found");
+        return 0;
+    }
+    
+    for (i = 0; i < num_gpus; i++) { 
+        gchar *device_name = (gchar*) malloc (100 * sizeof(gchar));
+        if (XNVCTRLQueryTargetStringAttribute (nvidia_sensors_display,
+                                               NV_CTRL_TARGET_TYPE_GPU, 
+                                               i,
+                                               0,
+                                               NV_CTRL_STRING_PRODUCT_NAME,
+                                               &device_name))
+            TRACE ("GPU%d:%s", i, device_name);
+            
+        chipfeature = g_new0 (t_chipfeature, 1);
+        chipfeature -> devicename = g_strdup (device_name);
+        chipfeature -> name = g_strdup (device_name);
+        g_ptr_array_add (chip -> chip_features, chipfeature);
+        chip -> num_features++;
+    }
+
+    TRACE ("leaves read_gpus");
+    return num_gpus;
+}
diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
index 5f0aca7..efd376e 100644
--- a/lib/sensors-interface-common.c
+++ b/lib/sensors-interface-common.c
@@ -103,6 +103,7 @@ sensors_init_default_values  (t_sensors *sensors, XfcePanelPlugin *plugin)
     sensors->show_labels = TRUE;
     sensors->display_values_type = DISPLAY_TEXT;
     sensors->bars_created = FALSE;
+    sensors->tachos_created = FALSE;
     sensors->font_size = g_strdup("medium");
     sensors->font_size_numerical = 2;
     sensors->lines_size = 3;
diff --git a/lib/sensors-interface.c b/lib/sensors-interface.c
index 22ea776..396f224 100644
--- a/lib/sensors-interface.c
+++ b/lib/sensors-interface.c
@@ -34,7 +34,6 @@
 #include <gtk/gtk.h>
 
 /* Xfce includes */
-//#include <libxfcegui4/libxfcegui4.h>
 #include <libxfce4ui/libxfce4ui.h>
 
 /* Package includes */
@@ -45,10 +44,6 @@
 /* forward declaration to not make gcc 4.3 -Wall complain */
 void produce_min_max_values (t_chipfeature *chipfeature, t_tempscale scale, float *minval, float *maxval);
 
-/*
- * Tooltips to display for any part of this plugin
- */
-GtkTooltips *tooltips = NULL;
 
 void
 produce_min_max_values (t_chipfeature *chipfeature, t_tempscale scale, float *minval, float *maxval)
@@ -75,7 +70,7 @@ fill_gtkTreeStore (GtkTreeStore *model, t_chip *chip, t_tempscale scale, t_senso
 #if defined(HAVE_LIBNOTIFY4) || defined(HAVE_LIBNOTIFY7)
     NotifyNotification *nn;
     GError *error = NULL;
-		gchar *icon;
+    gchar *icon;
 #endif
     gchar *summary, *body;
     float minval, maxval;
@@ -183,7 +178,7 @@ add_type_box (GtkWidget * vbox, t_sensors_dialog * sd)
         gtk_combo_box_get_active(GTK_COMBO_BOX(sd->myComboBox));
 
     chip = g_ptr_array_index (sd->sensors->chips, gtk_combo_box_active);
-		DBG("index: %d, chip: %p\n", gtk_combo_box_active, chip);
+        DBG("index: %d, chip: %p\n", gtk_combo_box_active, chip);
 
     /* if (sd->sensors->num_sensorchips > 0)
         sd->mySensorLabel = gtk_label_new
diff --git a/panel-plugin/sensors-plugin.c b/panel-plugin/sensors-plugin.c
index e32b470..05cc978 100644
--- a/panel-plugin/sensors-plugin.c
+++ b/panel-plugin/sensors-plugin.c
@@ -40,7 +40,6 @@
 
 /* Xfce includes */
 #include <libxfce4util/libxfce4util.h>
-//#include <libxfcegui4/libxfcegui4.h>
 #include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
@@ -375,7 +374,6 @@ sensors_add_graphical_display (t_sensors *sensors)
     gtk_widget_hide (sensors->panel_label_data);
 
     sensors->bars_created = TRUE;
-    sensors_update_graphical_panel (sensors);
 
     TRACE ("leaves sensors_add_graphical_display");
 }
@@ -397,6 +395,8 @@ sensors_add_tacho_display (t_sensors *sensors)
     text = g_strdup (_("<span><b>Sensors</b></span>"));
     gtk_label_set_markup (GTK_LABEL(sensors->panel_label_text), text);
     g_free (text);
+    
+    gtk_widget_set_has_tooltip(sensors->eventbox, FALSE);
 
     
     gtk_container_set_border_width (GTK_CONTAINER(sensors->widget_sensors), 0);
@@ -461,7 +461,6 @@ sensors_add_tacho_display (t_sensors *sensors)
 
     DBG("12");
     sensors->tachos_created = TRUE;
-    sensors_update_tacho_panel (sensors);
 
     TRACE ("leaves sensors_add_tacho_display");
 }
@@ -472,10 +471,10 @@ sensors_show_graphical_display (t_sensors *sensors)
 {
     TRACE ("enters sensors_show_graphical_display");
 
-    if (sensors->bars_created == TRUE)
-        sensors_update_graphical_panel (sensors);
-    else
+    if (sensors->bars_created == FALSE)
         sensors_add_graphical_display (sensors);
+        
+    sensors_update_graphical_panel (sensors);
 
     TRACE ("leaves sensors_show_graphical_display");
 
@@ -488,11 +487,11 @@ sensors_show_tacho_display (t_sensors *sensors)
 {
     TRACE ("enters sensors_show_tacho_display");
 
-    if (sensors->tachos_created == TRUE)
-        sensors_update_tacho_panel (sensors);
-    else
+    if (sensors->tachos_created == FALSE)
         sensors_add_tacho_display (sensors);
-
+        
+    sensors_update_tacho_panel (sensors);
+    
     TRACE ("leaves sensors_show_tacho_display");
 
     return TRUE;
@@ -868,9 +867,7 @@ sensors_create_tooltip (gpointer data)
 
     gtk_widget_set_tooltip_markup (GTK_WIDGET(sensors->eventbox), myToolTipText);
     DBG("tooltip text: %s.\n", myToolTipText);
-    
-    gtk_widget_set_has_tooltip(GTK_WIDGET(sensors->eventbox), !sensors->suppresstooltip);
-    
+        
     TRACE ("freeing myToolTipText");
     g_free (myToolTipText);
 
@@ -1245,10 +1242,6 @@ display_style_changed_tacho (GtkWidget *widget, t_sensors_dialog *sd)
     gtk_widget_hide (sd->smallspacing_checkbox);
 
     sd->sensors->display_values_type = DISPLAY_TACHO;
-    //gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON(widget) );
-
-    if (!sd->sensors->suppresstooltip)
-      suppresstooltip_changed (widget, sd);
     
     sensors_show_panel ((gpointer) sd->sensors);
 
diff --git a/src/actions.c b/src/actions.c
index a72b9ad..81b606f 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -28,7 +28,6 @@
 #include <gtk/gtk.h>
 
 /* Xfce includes */
-//#include <libxfcegui4/libxfcegui4.h>
 #include <libxfce4ui/libxfce4ui.h>
 
 /* Package includes */
@@ -43,6 +42,9 @@
 gboolean
 refresh_sensor_data (t_sensors_dialog *sd);
 
+void 
+gtk_widget_unparent_ext (GtkWidget *widget, gpointer data);
+
 /* actual implementations */
 gboolean
 refresh_sensor_data (t_sensors_dialog *sd)
@@ -109,8 +111,6 @@ refresh_sensor_data (t_sensors_dialog *sd)
   
 //}
 
-void gtk_widget_unparent_ext (GtkWidget *widget, gpointer data);
-
 void
 gtk_widget_unparent_ext (GtkWidget *widget, gpointer data)
 {
@@ -128,7 +128,6 @@ refresh_tacho_view (t_sensors_dialog *sd)
   GtkWidget *table; //, *widget;
   //GList *list;
   gdouble d;
-  gchar *myToolTipText;
   
   TRACE ("enters refresh_tacho_view");
   
@@ -200,12 +199,7 @@ refresh_tacho_view (t_sensors_dialog *sd)
                 gtk_widget_show (sensors->tachos [i][index_feature]);
                 //gtk_cpu_paint(sensors->tachos [i][index_feature]);
                 //gtk_cpu_expose(sensors->tachos [i][index_feature], NULL);
-                
-    /* #if GTK_VERSION < 2.11 */
-    myToolTipText = g_strdup(_("You can change a feature's properties such as name, colours, min/max value by double-clicking the entry, editing the content, and pressing \"Return\" or selecting a different field."));
-    gtk_tooltips_set_tip (tooltips, GTK_WIDGET(sensors->tachos [i][index_feature]),
-                          myToolTipText, NULL);
-                
+                                
                 if (col>=3) {
                     row++;
                     col = 0;
diff --git a/src/callbacks.c b/src/callbacks.c
index b59d68f..06f8f59 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 
 /* Xfce includes */
-//#include <libxfcegui4/libxfcegui4.h>
 #include <libxfce4ui/libxfce4ui.h>
 
 /* Package includes */
@@ -213,9 +212,7 @@ list_cell_toggle (GtkCellRendererToggle *cell, gchar *path_str,
     gtk_tree_path_free (path);
 
     /* update tooltip and panel widget */
-    //sensors_show_panel ((gpointer) sd->sensors);
-    //res = 
-		refresh_view ((gpointer) sd);
+    refresh_view ((gpointer) sd);
 
     TRACE ("leaves list_cell_toggle");//~ 
 }
@@ -272,7 +269,7 @@ list_cell_color_edited (GtkCellRendererText *cellrenderertext, gchar *path_str,
         //sensors_show_panel ((gpointer) sd->sensors);
         //res = refresh_view ((gpointer) sd);
         if (sd->sensors->tachos [gtk_combo_box_active][atoi(path_str)]!=NULL)
-          gtk_cpu_set_color(GTK_CPU(sd->sensors->tachos[gtk_combo_box_active][atoi(path_str)]), new_color);
+            gtk_cpu_set_color(GTK_CPU(sd->sensors->tachos[gtk_combo_box_active][atoi(path_str)]), new_color);
         
     }
 
@@ -313,7 +310,7 @@ minimum_changed (GtkCellRendererText *cellrenderertext, gchar *path_str,
 
     chipfeature = (t_chipfeature *) g_ptr_array_index(chip->chip_features, atoi(path_str));
     if (sd->sensors->scale==FAHRENHEIT)
-      value = (value -32 ) * 5/9;
+        value = (value -32 ) * 5/9;
     chipfeature->min_value = value;
 
     /* clean up */
@@ -321,8 +318,7 @@ minimum_changed (GtkCellRendererText *cellrenderertext, gchar *path_str,
 
     /* update panel */
     if (sd->sensors->tachos [gtk_combo_box_active][atoi(path_str)]!=NULL)
-      //res = 
-			refresh_view ((gpointer) sd);
+        refresh_view ((gpointer) sd);
 
     TRACE ("leaves minimum_changed");
 }
@@ -370,7 +366,7 @@ maximum_changed (GtkCellRendererText *cellrenderertext, gchar *path_str,
     /* update panel */
     if (sd->sensors->tachos [gtk_combo_box_active][atoi(path_str)]!=NULL)
       //res = 
-			refresh_view ((gpointer) sd);
+            refresh_view ((gpointer) sd);
 
     TRACE ("leaves maximum_changed");
 }
@@ -407,5 +403,3 @@ temperature_unit_change (GtkWidget *widget, t_sensors_dialog *sd)
 
     TRACE ("laeves temperature_unit_change ");
 }
-
-
diff --git a/src/interface.c b/src/interface.c
index 492e399..b8b98d9 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -24,7 +24,6 @@
 #endif
 
 /* Xfce includes */
-//#include <libxfcegui4/libxfcegui4.h>
 #include <libxfce4ui/libxfce4ui.h>
 
 /* Package includes */
@@ -76,8 +75,7 @@ add_notebook (GtkWidget *box, t_sensors_dialog *sd)
     add_update_time_box (child, sd);
     
     tab_label = gtk_label_new_with_mnemonic(_("_Overview"));
-    gtk_widget_show (tab_label); 
-		//res = 
+    gtk_widget_show (tab_label);
     gtk_notebook_append_page       (GTK_NOTEBOOK(nb), child, tab_label);
     
     child = gtk_vbox_new (FALSE, BORDER);
@@ -98,8 +96,7 @@ add_notebook (GtkWidget *box, t_sensors_dialog *sd)
     
     tab_label = gtk_label_new_with_mnemonic(_("_Tachometers"));
     gtk_widget_show (tab_label); 
-    //res = 
-		gtk_notebook_append_page       (GTK_NOTEBOOK(nb), child, tab_label);
+    gtk_notebook_append_page       (GTK_NOTEBOOK(nb), child, tab_label);
     
     gtk_box_pack_start(GTK_BOX(box), nb, TRUE, TRUE, 0);
 }
@@ -145,9 +142,6 @@ create_main_window (t_sensors_dialog *sd)
         
     gtk_window_set_default_size (GTK_WINDOW(dlg), sd->sensors->preferred_width, sd->sensors->preferred_height);
     
-    if (!tooltips)
-      tooltips = gtk_tooltips_new();
-
 
     g_signal_connect (G_OBJECT(dlg), "response", G_CALLBACK(on_main_window_response), sd); // also captures the dialog-destroy event and the closekeybinding-pressed event
     //g_signal_connect (G_OBJECT(dlg), "destroy", G_CALLBACK(on_main_window_response), sd);
diff --git a/src/interface.h b/src/interface.h
index 70d6c27..8c62893 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -24,6 +24,5 @@
 
 /* Package includes */
 #include <sensors-interface-common.h>
-GtkTooltips *tooltips;
 
 GtkWidget * create_main_window (t_sensors_dialog *sd);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list