Lines 30-37
Link Here
|
30 |
#include <libxfce4panel/xfce-panel-plugin.h> |
30 |
#include <libxfce4panel/xfce-panel-plugin.h> |
31 |
|
31 |
|
32 |
|
32 |
|
33 |
static GtkTooltips *tooltips = NULL; |
|
|
34 |
|
35 |
#define BORDER 8 |
33 |
#define BORDER 8 |
36 |
|
34 |
|
37 |
/* Defaults */ |
35 |
/* Defaults */ |
Lines 219-225
Link Here
|
219 |
"Incoming: %s kByte/s\nOutgoing: %s kByte/s\nTotal: %s kByte/s"), |
217 |
"Incoming: %s kByte/s\nOutgoing: %s kByte/s\nTotal: %s kByte/s"), |
220 |
get_name(&(global->monitor->data)), ip ? ip : _("no IP address"), |
218 |
get_name(&(global->monitor->data)), ip ? ip : _("no IP address"), |
221 |
HISTSIZE_CALCULATE, buffer[IN], buffer[OUT], buffer[TOT]); |
219 |
HISTSIZE_CALCULATE, buffer[IN], buffer[OUT], buffer[TOT]); |
222 |
gtk_tooltips_set_tip(tooltips, GTK_WIDGET(global->ebox), caption, NULL); |
220 |
gtk_widget_set_tooltip_text(GTK_WIDGET(global->ebox), caption); |
223 |
} |
221 |
} |
224 |
|
222 |
|
225 |
return TRUE; |
223 |
return TRUE; |
Lines 237-242
Link Here
|
237 |
|
235 |
|
238 |
if (global->monitor->options.update_interval > 0) |
236 |
if (global->monitor->options.update_interval > 0) |
239 |
{ |
237 |
{ |
|
|
238 |
#if GLIB_CHECK_VERSION( 2,14,0 ) |
239 |
if (global->monitor->options.update_interval % 1000 == 0) |
240 |
{ |
241 |
global->timeout_id = g_timeout_add_seconds(global->monitor-> |
242 |
options.update_interval / 1000, (GtkFunction)update_monitors, global); |
243 |
} |
244 |
else |
245 |
#endif |
240 |
global->timeout_id = g_timeout_add( global->monitor->options.update_interval, |
246 |
global->timeout_id = g_timeout_add( global->monitor->options.update_interval, |
241 |
(GtkFunction)update_monitors, global); |
247 |
(GtkFunction)update_monitors, global); |
242 |
} |
248 |
} |
Lines 368-378
Link Here
|
368 |
global->plugin = plugin; |
374 |
global->plugin = plugin; |
369 |
xfce_panel_plugin_add_action_widget (plugin, global->ebox); |
375 |
xfce_panel_plugin_add_action_widget (plugin, global->ebox); |
370 |
|
376 |
|
371 |
if (!tooltips) |
|
|
372 |
{ |
373 |
tooltips = gtk_tooltips_new(); |
374 |
} |
375 |
|
376 |
global->monitor = g_new(t_monitor, 1); |
377 |
global->monitor = g_new(t_monitor, 1); |
377 |
global->monitor->options.label_text = g_strdup(DEFAULT_TEXT); |
378 |
global->monitor->options.label_text = g_strdup(DEFAULT_TEXT); |
378 |
global->monitor->options.network_device = g_strdup(""); |
379 |
global->monitor->options.network_device = g_strdup(""); |
Lines 819-824
Link Here
|
819 |
GtkWidget *sep1, *sep2; |
820 |
GtkWidget *sep1, *sep2; |
820 |
GtkBox *update_hbox; |
821 |
GtkBox *update_hbox; |
821 |
GtkWidget *update_label, *update_unit_label; |
822 |
GtkWidget *update_label, *update_unit_label; |
|
|
823 |
#if GLIB_CHECK_VERSION( 2,14,0 ) |
824 |
GtkBox *update_hint_hbox; |
825 |
GtkWidget *update_hint_label; |
826 |
#endif |
822 |
GtkWidget *color_label[SUM]; |
827 |
GtkWidget *color_label[SUM]; |
823 |
GtkWidget *align; |
828 |
GtkWidget *align; |
824 |
GtkBox *color_hbox[SUM]; |
829 |
GtkBox *color_hbox[SUM]; |
Lines 935-941
Link Here
|
935 |
gtk_misc_set_alignment(GTK_MISC(update_label), 0, 0.5); |
940 |
gtk_misc_set_alignment(GTK_MISC(update_label), 0, 0.5); |
936 |
gtk_box_pack_start(GTK_BOX(update_hbox), GTK_WIDGET(update_label), FALSE, FALSE, 0); |
941 |
gtk_box_pack_start(GTK_BOX(update_hbox), GTK_WIDGET(update_label), FALSE, FALSE, 0); |
937 |
|
942 |
|
938 |
global->monitor->update_spinner = gtk_spin_button_new_with_range (0.1, 10.0, 0.05); |
943 |
global->monitor->update_spinner = gtk_spin_button_new_with_range (1.0, 10.0, 0.25); |
939 |
gtk_spin_button_set_digits( GTK_SPIN_BUTTON(global->monitor->update_spinner), 2 ); |
944 |
gtk_spin_button_set_digits( GTK_SPIN_BUTTON(global->monitor->update_spinner), 2 ); |
940 |
gtk_spin_button_set_value( GTK_SPIN_BUTTON(global->monitor->update_spinner), |
945 |
gtk_spin_button_set_value( GTK_SPIN_BUTTON(global->monitor->update_spinner), |
941 |
global->monitor->options.update_interval / 1000.0 ); |
946 |
global->monitor->options.update_interval / 1000.0 ); |
Lines 948-953
Link Here
|
948 |
|
953 |
|
949 |
gtk_widget_show_all(GTK_WIDGET(update_hbox)); |
954 |
gtk_widget_show_all(GTK_WIDGET(update_hbox)); |
950 |
gtk_size_group_add_widget(sg, update_label); |
955 |
gtk_size_group_add_widget(sg, update_label); |
|
|
956 |
|
957 |
#if GLIB_CHECK_VERSION( 2,14,0 ) |
958 |
/* Update interval hint */ |
959 |
update_hint_hbox = GTK_BOX(gtk_hbox_new(FALSE, 5)); |
960 |
update_hint_label = gtk_label_new(_("Note: Whole seconds are more power-efficient")); |
961 |
gtk_label_set_line_wrap(GTK_LABEL(update_hint_label), TRUE); |
962 |
gtk_box_pack_start(GTK_BOX(update_hint_hbox), GTK_WIDGET(update_hint_label), |
963 |
FALSE, FALSE, 0); |
964 |
gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox), |
965 |
GTK_WIDGET(update_hint_hbox), FALSE, FALSE, 0); |
966 |
gtk_widget_show_all(GTK_WIDGET(update_hint_hbox)); |
967 |
#endif |
951 |
|
968 |
|
952 |
|
969 |
|
953 |
sep1 = gtk_hseparator_new(); |
970 |
sep1 = gtk_hseparator_new(); |