[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 01/01: begin fixing bug 10840 with feature request to supres tooltip for transparency issues with gtk themes, for stability issues with tachometer panel

noreply at xfce.org noreply at xfce.org
Tue Apr 29 23:57:41 CEST 2014


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 240bf2e67e77f6d9ad6507f8bd0acf3a5b3db57d
Author: Fabian <timystery at arcor.de>
Date:   Tue Apr 29 23:56:41 2014 +0200

    begin fixing bug 10840 with feature request to supres tooltip for transparency issues with gtk themes, for stability issues with tachometer panel
---
 NEWS                               |    2 +-
 include/sensors-interface-common.h |    1 +
 include/sensors-interface-plugin.h |    4 ++-
 lib/configuration.c                |    5 ++++
 panel-plugin/sensors-plugin.c      |   50 ++++++++++++++++++++++++++++++++----
 5 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index 9e693ad..3b78c37 100644
--- a/NEWS
+++ b/NEWS
@@ -32,4 +32,4 @@
 1.2.5:  Fix German translation; fix bug 8887 compile error
 1.2.6:  Bug 9395 fixed: When sensors are no longer available for any reason, 
         plugin won't crash.
-        Bug 10031 fixed.
+        Bug 10031 fixed: Automake/Autoconfigure option for config headers.
diff --git a/include/sensors-interface-common.h b/include/sensors-interface-common.h
index b55eb5f..d477b42 100644
--- a/include/sensors-interface-common.h
+++ b/include/sensors-interface-common.h
@@ -73,6 +73,7 @@ typedef struct {
     GtkWidget *Lines_Box;
     GtkWidget *Lines_Spin_Box;
     GtkWidget *suppressmessage_checkbox;
+    GtkWidget *suppresstooltip_checkbox;
     GtkWidget *smallspacing_checkbox;
     GtkWidget *labels_Box; /* used to enable 'show labels' option when using graphical view */
     GtkWidget *coloredBars_Box;
diff --git a/include/sensors-interface-plugin.h b/include/sensors-interface-plugin.h
index e40aab5..2862c9f 100644
--- a/include/sensors-interface-plugin.h
+++ b/include/sensors-interface-plugin.h
@@ -101,6 +101,9 @@ typedef struct {
 
     /* suppress Hddtemp failure messages and any other messages */
     gboolean suppressmessage;
+    
+    /* suppress tooltip from overlapping widget and thereby crashing the plugin or modifying the background */
+    gboolean suppresstooltip;
 
     /* sensor update time */
     gint sensors_refresh_time;
@@ -186,4 +189,3 @@ t_sensors * sensors_new (XfcePanelPlugin *plugin, gchar * plugin_config_file);
 void sensors_init_default_values  (t_sensors *sensors, XfcePanelPlugin *plugin);
 
 #endif /* XFCE4_SENSORS_INTERFACE_PLUGIN_H */
-
diff --git a/lib/configuration.c b/lib/configuration.c
index 52e6c41..00c1ce5 100644
--- a/lib/configuration.c
+++ b/lib/configuration.c
@@ -126,6 +126,8 @@ sensors_write_config (XfcePanelPlugin *plugin, t_sensors *sensors)
 
     xfce_rc_write_bool_entry (rc, "Suppress_Hddtemp_Message", sensors->suppressmessage);
 
+    xfce_rc_write_bool_entry (rc, "Suppress_Tooltip", sensors->suppresstooltip);
+
   xfce_rc_write_int_entry (rc, "Preferred_Width", sensors->preferred_width);
   xfce_rc_write_int_entry (rc, "Preferred_Height", sensors->preferred_height);
 
@@ -239,6 +241,9 @@ sensors_read_general_config (XfceRc *rc, t_sensors *sensors)
 
         if (!sensors->suppressmessage)
             sensors->suppressmessage = xfce_rc_read_bool_entry (rc, "Suppress_Hddtemp_Message", FALSE);
+
+        if (!sensors->suppresstooltip)
+            sensors->suppresstooltip = xfce_rc_read_bool_entry (rc, "Suppress_Tooltip", FALSE);
             
         sensors->preferred_width = xfce_rc_read_int_entry (rc, "Preferred_Width", 400);
         sensors->preferred_height = xfce_rc_read_int_entry (rc, "Preferred_Height", 400);
diff --git a/panel-plugin/sensors-plugin.c b/panel-plugin/sensors-plugin.c
index 545eb7b..88f1bd7 100644
--- a/panel-plugin/sensors-plugin.c
+++ b/panel-plugin/sensors-plugin.c
@@ -850,6 +850,8 @@ sensors_create_tooltip (gpointer data)
     gtk_widget_set_tooltip_text (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);
 
@@ -871,8 +873,6 @@ sensors_show_panel (gpointer data)
 
     sensors = (t_sensors *) data;
 
-    sensors_create_tooltip ((gpointer) sensors);
-
     switch (sensors->display_values_type)
     {
       case DISPLAY_TACHO: 
@@ -884,6 +884,9 @@ sensors_show_panel (gpointer data)
       default:
         result = sensors_show_text_display (sensors);
     }
+    
+    sensors_create_tooltip ((gpointer) sensors);
+    
     TRACE ("leaves sensors_show_panel\n");
     return result;
 }
@@ -1190,6 +1193,21 @@ display_style_changed_bars (GtkWidget *widget, t_sensors_dialog *sd)
     TRACE ("leaves display_style_changed_bars");
 }
 
+
+
+static void
+suppresstooltip_changed (GtkWidget *widget, t_sensors_dialog* sd)
+{
+    TRACE ("enters suppresstooltip_changed");
+
+    sd->sensors->suppresstooltip = ! sd->sensors->suppresstooltip;
+    
+    gtk_widget_set_has_tooltip(sd->sensors->eventbox, !sd->sensors->suppresstooltip);
+
+    TRACE ("leaves suppresstooltip_changed");
+}
+
+
 static void
 display_style_changed_tacho (GtkWidget *widget, t_sensors_dialog *sd)
 {
@@ -1212,6 +1230,9 @@ display_style_changed_tacho (GtkWidget *widget, t_sensors_dialog *sd)
     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);
 
     TRACE ("leaves display_style_changed_tacho");
@@ -1980,6 +2001,24 @@ add_suppressmessage_box (GtkWidget * vbox, t_sensors_dialog * sd)
     TRACE ("leaves add_suppressmessage_box");
 }
 
+static void
+add_suppresstooltips_box (GtkWidget * vbox, t_sensors_dialog * sd)
+{
+    TRACE ("enters add_suppresstooltips_box");
+
+    sd->suppresstooltip_checkbox  = gtk_check_button_new_with_mnemonic(_("Suppress tooltip"));
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sd->suppresstooltip_checkbox), sd->sensors->suppresstooltip);
+
+    gtk_widget_show (sd->suppresstooltip_checkbox);
+
+    gtk_box_pack_start (GTK_BOX (vbox), sd->suppresstooltip_checkbox, FALSE, TRUE, 0);
+
+    g_signal_connect   (G_OBJECT (sd->suppresstooltip_checkbox), "toggled",
+                        G_CALLBACK (suppresstooltip_changed), sd );
+
+    TRACE ("leaves add_suppresstooltips_box");
+}
+
 
 /* double-click improvement */
 static void
@@ -2080,8 +2119,10 @@ add_miscellaneous_frame (GtkWidget * notebook, t_sensors_dialog * sd)
 
     add_suppressmessage_box(_vbox, sd);
 
+    add_suppresstooltips_box(_vbox, sd);
+    
     add_command_box (_vbox, sd);
-
+    
     TRACE ("leaves add_miscellaneous_frame");
 }
 
@@ -2244,7 +2285,7 @@ create_sensors_control (XfcePanelPlugin *plugin)
     add_event_box (sensors);
 
     /* Add tooltip to show extended current sensors status */
-    sensors_create_tooltip ((gpointer) sensors);
+    //sensors_create_tooltip ((gpointer) sensors);
 
     /* fill panel widget with boxes, strings, values, ... */
     create_panel_widget (sensors);
@@ -2312,4 +2353,3 @@ sensors_plugin_construct (XfcePanelPlugin *plugin)
 }
 
 XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (sensors_plugin_construct);
-

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


More information about the Xfce4-commits mailing list