[Xfce4-commits] <xfce4-systemload-plugin:master> Fixed configuration item sensitivity when opening the dialog.
David Schneider
noreply at xfce.org
Sat Jan 28 20:54:01 CET 2012
Updating branch refs/heads/master
to dabd74e7d7d9996ac681872c4910dc7e36ad920b (commit)
from feca146b98e9944f71d29740d781389dee9dde7f (commit)
commit dabd74e7d7d9996ac681872c4910dc7e36ad920b
Author: David Schneider <dnschneid at gmail.com>
Date: Sat Jan 28 11:52:00 2012 -0800
Fixed configuration item sensitivity when opening the dialog.
panel-plugin/systemload.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index e516faf..c24f041 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -645,14 +645,17 @@ entry_changed_cb(GtkEntry *entry, t_global_monitor *global)
static void
check_button_cb(GtkToggleButton *check_button, t_global_monitor *global)
{
+ gboolean oldstate;
gboolean* boolvar;
gpointer sensitive_widget;
boolvar = (gboolean*)g_object_get_data(G_OBJECT(check_button), "boolvar");
sensitive_widget = g_object_get_data(G_OBJECT(check_button), "sensitive_widget");
+ oldstate = *boolvar;
*boolvar = gtk_toggle_button_get_active(check_button);
if (sensitive_widget)
gtk_widget_set_sensitive(GTK_WIDGET(sensitive_widget), *boolvar);
- setup_monitor(global);
+ if (oldstate != *boolvar)
+ setup_monitor(global);
}
static void
@@ -716,9 +719,10 @@ static GtkTable* new_frame(t_global_monitor *global, GtkBox *content,
/* Configure and set check button */
g_object_set_data (G_OBJECT(check), "sensitive_widget", table);
g_object_set_data (G_OBJECT(check), "boolvar", boolvar);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(check), *boolvar);
+ check_button_cb (GTK_TOGGLE_BUTTON(check), global);
g_signal_connect (G_OBJECT(check), "toggled",
G_CALLBACK(check_button_cb), global);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(check), *boolvar);
}
return GTK_TABLE(table);
}
@@ -736,9 +740,10 @@ static GtkWidget *new_label_or_check_button(t_global_monitor *global,
label = gtk_check_button_new_with_mnemonic (labeltext);
g_object_set_data (G_OBJECT(label), "sensitive_widget", target);
g_object_set_data (G_OBJECT(label), "boolvar", boolvar);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(label), *boolvar);
+ check_button_cb (GTK_TOGGLE_BUTTON(label), global);
g_signal_connect (GTK_WIDGET(label), "toggled",
G_CALLBACK(check_button_cb), global);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(label), *boolvar);
} else {
label = gtk_label_new_with_mnemonic (labeltext);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5f); \
More information about the Xfce4-commits
mailing list