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
4
#include <libxfce4panel/xfce-panel-plugin.h>
7
-static GtkTooltips *tooltips = NULL;
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);
23
if (global->monitor->options.update_interval > 0)
25
+#if GLIB_CHECK_VERSION( 2,14,0 )
26
+ if (global->monitor->options.update_interval % 1000 == 0)
28
+ global->timeout_id = g_timeout_add_seconds(global->monitor->
29
+ options.update_interval / 1000, (GtkFunction)update_monitors, global);
33
global->timeout_id = g_timeout_add( global->monitor->options.update_interval,
34
(GtkFunction)update_monitors, global);
37
global->plugin = plugin;
38
xfce_panel_plugin_add_action_widget (plugin, global->ebox);
42
- tooltips = gtk_tooltips_new();
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("");
49
GtkWidget *sep1, *sep2;
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;
56
GtkWidget *color_label[SUM];
58
GtkBox *color_hbox[SUM];
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);
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 );
70
gtk_widget_show_all(GTK_WIDGET(update_hbox));
71
gtk_size_group_add_widget(sg, update_label);
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),
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));
86
sep1 = gtk_hseparator_new();