~ubuntu-branches/ubuntu/vivid/xfce4-netload-plugin/vivid

« back to all changes in this revision

Viewing changes to debian/patches/02_fix-tooltips-gtk2.16.patch

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Lionel Le Folgoc, Yves-Alexis Perez
  • Date: 2011-04-19 23:12:43 UTC
  • mfrom: (1.1.4 upstream) (9.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110419231243-tkce1b7gx8kjiu7h
Tags: 1.0.0-2
[ Lionel Le Folgoc ]
* Upload to unstable.
* debian/control:
  - add myself to Uploaders.
  - remove Simon and Emanuele from uploaders, thanks to them.

[ Yves-Alexis Perez ]
* debian/control:
  - update standards version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- ./panel-plugin/netload.c.orig       2005-10-09 12:08:01.000000000 +0300
2
 
+++ ./panel-plugin/netload.c    2009-05-23 20:50:22.000000000 +0300
3
 
@@ -30,8 +30,6 @@
4
 
 #include <libxfce4panel/xfce-panel-plugin.h>
5
 
 
6
 
 
7
 
-static GtkTooltips *tooltips = NULL;
8
 
-
9
 
 #define BORDER 8
10
 
 
11
 
 /* Defaults */
12
 
@@ -219,7 +217,7 @@
13
 
                     "Incoming: %s kByte/s\nOutgoing: %s kByte/s\nTotal: %s kByte/s"),
14
 
                     get_name(&(global->monitor->data)), ip ? ip : _("no IP address"),
15
 
                     HISTSIZE_CALCULATE, buffer[IN], buffer[OUT], buffer[TOT]);
16
 
-        gtk_tooltips_set_tip(tooltips, GTK_WIDGET(global->ebox), caption, NULL);
17
 
+        gtk_widget_set_tooltip_text(GTK_WIDGET(global->ebox), caption);
18
 
     }
19
 
 
20
 
     return TRUE;
21
 
@@ -237,6 +235,14 @@
22
 
 
23
 
     if (global->monitor->options.update_interval > 0)
24
 
     {
25
 
+#if GLIB_CHECK_VERSION( 2,14,0 )
26
 
+        if (global->monitor->options.update_interval % 1000 == 0)
27
 
+        {
28
 
+            global->timeout_id = g_timeout_add_seconds(global->monitor->
29
 
+                options.update_interval / 1000, (GtkFunction)update_monitors, global);
30
 
+        }
31
 
+       else
32
 
+#endif
33
 
         global->timeout_id =  g_timeout_add( global->monitor->options.update_interval, 
34
 
             (GtkFunction)update_monitors, global);
35
 
     }
36
 
@@ -368,11 +374,6 @@
37
 
     global->plugin = plugin;
38
 
     xfce_panel_plugin_add_action_widget (plugin, global->ebox);
39
 
 
40
 
-    if (!tooltips) 
41
 
-    {
42
 
-        tooltips = gtk_tooltips_new();
43
 
-    }
44
 
-
45
 
     global->monitor = g_new(t_monitor, 1);
46
 
     global->monitor->options.label_text = g_strdup(DEFAULT_TEXT);
47
 
     global->monitor->options.network_device = g_strdup("");
48
 
@@ -819,6 +820,10 @@
49
 
     GtkWidget        *sep1, *sep2;
50
 
     GtkBox           *update_hbox;
51
 
     GtkWidget        *update_label, *update_unit_label;
52
 
+#if GLIB_CHECK_VERSION( 2,14,0 )
53
 
+    GtkBox           *update_hint_hbox;
54
 
+    GtkWidget        *update_hint_label;
55
 
+#endif
56
 
     GtkWidget        *color_label[SUM];
57
 
     GtkWidget        *align;
58
 
     GtkBox           *color_hbox[SUM];
59
 
@@ -935,7 +940,7 @@
60
 
     gtk_misc_set_alignment(GTK_MISC(update_label), 0, 0.5);
61
 
     gtk_box_pack_start(GTK_BOX(update_hbox), GTK_WIDGET(update_label), FALSE, FALSE, 0);
62
 
     
63
 
-    global->monitor->update_spinner = gtk_spin_button_new_with_range (0.1, 10.0, 0.05);
64
 
+    global->monitor->update_spinner = gtk_spin_button_new_with_range (1.0, 10.0, 0.25);
65
 
     gtk_spin_button_set_digits( GTK_SPIN_BUTTON(global->monitor->update_spinner), 2 );
66
 
     gtk_spin_button_set_value( GTK_SPIN_BUTTON(global->monitor->update_spinner), 
67
 
             global->monitor->options.update_interval / 1000.0 );
68
 
@@ -948,6 +953,18 @@
69
 
     
70
 
     gtk_widget_show_all(GTK_WIDGET(update_hbox));
71
 
     gtk_size_group_add_widget(sg, update_label);
72
 
+
73
 
+#if GLIB_CHECK_VERSION( 2,14,0 )
74
 
+    /* Update interval hint */
75
 
+    update_hint_hbox = GTK_BOX(gtk_hbox_new(FALSE, 5));
76
 
+    update_hint_label = gtk_label_new(_("Note: Whole seconds are more power-efficient"));
77
 
+    gtk_label_set_line_wrap(GTK_LABEL(update_hint_label), TRUE);
78
 
+    gtk_box_pack_start(GTK_BOX(update_hint_hbox), GTK_WIDGET(update_hint_label),
79
 
+                       FALSE, FALSE, 0);
80
 
+    gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox),
81
 
+                       GTK_WIDGET(update_hint_hbox), FALSE, FALSE, 0);
82
 
+    gtk_widget_show_all(GTK_WIDGET(update_hint_hbox));
83
 
+#endif
84
 
     
85
 
     
86
 
     sep1 = gtk_hseparator_new();