fix leaks and remove unnecessary casts
2008-03-01 Jens Granseuer <jensgr@gmx.net> * gnome-keyboard-properties-a11y.c: (notifications_button_clicked_cb), (mousekeys_accel_time_to_widget), (mousekeys_accel_time_from_widget), (setup_a11y_tabs): fix leaks and remove unnecessary casts svn path=/trunk/; revision=8538
This commit is contained in:
parent
e2e3133c3e
commit
abc7d0e053
2 changed files with 34 additions and 23 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-03-01 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
|
* gnome-keyboard-properties-a11y.c:
|
||||||
|
(notifications_button_clicked_cb),
|
||||||
|
(mousekeys_accel_time_to_widget),
|
||||||
|
(mousekeys_accel_time_from_widget), (setup_a11y_tabs): fix leaks
|
||||||
|
and remove unnecessary casts
|
||||||
|
|
||||||
2008-02-05 Jens Granseuer <jensgr@gmx.net>
|
2008-02-05 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
* gnome-keyboard-properties.glade: don't mark padding strings as
|
* gnome-keyboard-properties.glade: don't mark padding strings as
|
||||||
|
|
|
@ -68,7 +68,7 @@ static void
|
||||||
a11y_notifications_dialog_response_cb (GtkWidget *w, gint response)
|
a11y_notifications_dialog_response_cb (GtkWidget *w, gint response)
|
||||||
{
|
{
|
||||||
if (response == GTK_RESPONSE_HELP) {
|
if (response == GTK_RESPONSE_HELP) {
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gtk_widget_destroy (w);
|
gtk_widget_destroy (w);
|
||||||
|
@ -90,46 +90,47 @@ notifications_button_clicked_cb (GtkWidget *button, GladeXML *dialog)
|
||||||
w = NWID ("feature_state_change_beep");
|
w = NWID ("feature_state_change_beep");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/feature_state_change_beep",
|
CONFIG_ROOT "/feature_state_change_beep",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("togglekeys_enable");
|
w = NWID ("togglekeys_enable");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/togglekeys_enable",
|
CONFIG_ROOT "/togglekeys_enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("stickykeys_modifier_beep");
|
w = NWID ("stickykeys_modifier_beep");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/stickykeys_modifier_beep",
|
CONFIG_ROOT "/stickykeys_modifier_beep",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("slowkeys_beep_press");
|
w = NWID ("slowkeys_beep_press");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/slowkeys_beep_press",
|
CONFIG_ROOT "/slowkeys_beep_press",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("slowkeys_beep_accept");
|
w = NWID ("slowkeys_beep_accept");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/slowkeys_beep_accept",
|
CONFIG_ROOT "/slowkeys_beep_accept",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("slowkeys_beep_reject");
|
w = NWID ("slowkeys_beep_reject");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/slowkeys_beep_reject",
|
CONFIG_ROOT "/slowkeys_beep_reject",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("bouncekeys_beep_reject");
|
w = NWID ("bouncekeys_beep_reject");
|
||||||
gconf_peditor_new_boolean (NULL,
|
gconf_peditor_new_boolean (NULL,
|
||||||
CONFIG_ROOT "/bouncekeys_beep_reject",
|
CONFIG_ROOT "/bouncekeys_beep_reject",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = NWID ("a11y_notifications_dialog");
|
w = NWID ("a11y_notifications_dialog");
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (w),
|
gtk_window_set_transient_for (GTK_WINDOW (w),
|
||||||
GTK_WINDOW (WID ("keyboard_dialog")));
|
GTK_WINDOW (WID ("keyboard_dialog")));
|
||||||
g_signal_connect (G_OBJECT (w), "response",
|
g_signal_connect (w, "response",
|
||||||
G_CALLBACK (a11y_notifications_dialog_response_cb), NULL);
|
G_CALLBACK (a11y_notifications_dialog_response_cb), NULL);
|
||||||
|
|
||||||
gtk_dialog_run (GTK_DIALOG (w));
|
gtk_dialog_run (GTK_DIALOG (w));
|
||||||
|
|
||||||
|
g_object_unref (notifications_dialog);
|
||||||
notifications_dialog = NULL;
|
notifications_dialog = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +149,7 @@ mousekeys_accel_time_to_widget (GConfPropertyEditor *peditor, const GConfValue *
|
||||||
GConfValue *new_value;
|
GConfValue *new_value;
|
||||||
|
|
||||||
adjustment = GTK_ADJUSTMENT (gconf_property_editor_get_ui_control (peditor));
|
adjustment = GTK_ADJUSTMENT (gconf_property_editor_get_ui_control (peditor));
|
||||||
g_object_get (G_OBJECT (adjustment),
|
g_object_get (adjustment,
|
||||||
"upper", &range_upper,
|
"upper", &range_upper,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -166,7 +167,7 @@ mousekeys_accel_time_from_widget (GConfPropertyEditor *peditor, const GConfValue
|
||||||
GConfValue *new_value;
|
GConfValue *new_value;
|
||||||
|
|
||||||
adjustment = GTK_ADJUSTMENT (gconf_property_editor_get_ui_control (peditor));
|
adjustment = GTK_ADJUSTMENT (gconf_property_editor_get_ui_control (peditor));
|
||||||
g_object_get (G_OBJECT (adjustment),
|
g_object_get (adjustment,
|
||||||
"value", &range_value,
|
"value", &range_value,
|
||||||
"upper", &range_upper,
|
"upper", &range_upper,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -183,6 +184,7 @@ setup_a11y_tabs (GladeXML *dialog, GConfChangeSet *changeset)
|
||||||
GConfClient *client;
|
GConfClient *client;
|
||||||
GtkWidget *w;
|
GtkWidget *w;
|
||||||
GtkLabel *mousekeys_label;
|
GtkLabel *mousekeys_label;
|
||||||
|
gchar *label;
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
client = gconf_client_get_default ();
|
||||||
gconf_client_add_dir (client, CONFIG_ROOT, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
gconf_client_add_dir (client, CONFIG_ROOT, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||||
|
@ -193,29 +195,29 @@ setup_a11y_tabs (GladeXML *dialog, GConfChangeSet *changeset)
|
||||||
w = WID ("master_enable");
|
w = WID ("master_enable");
|
||||||
gconf_peditor_new_boolean (changeset,
|
gconf_peditor_new_boolean (changeset,
|
||||||
CONFIG_ROOT "/enable",
|
CONFIG_ROOT "/enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
|
|
||||||
w = WID ("stickykeys_enable");
|
w = WID ("stickykeys_enable");
|
||||||
gconf_peditor_new_boolean (changeset,
|
gconf_peditor_new_boolean (changeset,
|
||||||
CONFIG_ROOT "/stickykeys_enable",
|
CONFIG_ROOT "/stickykeys_enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
g_signal_connect (G_OBJECT (w), "toggled",
|
g_signal_connect (w, "toggled",
|
||||||
G_CALLBACK (stickykeys_enable_toggled_cb), dialog);
|
G_CALLBACK (stickykeys_enable_toggled_cb), dialog);
|
||||||
stickykeys_enable_toggled_cb (w, dialog);
|
stickykeys_enable_toggled_cb (w, dialog);
|
||||||
|
|
||||||
w = WID ("slowkeys_enable");
|
w = WID ("slowkeys_enable");
|
||||||
gconf_peditor_new_boolean (changeset,
|
gconf_peditor_new_boolean (changeset,
|
||||||
CONFIG_ROOT "/slowkeys_enable",
|
CONFIG_ROOT "/slowkeys_enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
g_signal_connect (G_OBJECT (w), "toggled",
|
g_signal_connect (w, "toggled",
|
||||||
G_CALLBACK (slowkeys_enable_toggled_cb), dialog);
|
G_CALLBACK (slowkeys_enable_toggled_cb), dialog);
|
||||||
slowkeys_enable_toggled_cb (w, dialog);
|
slowkeys_enable_toggled_cb (w, dialog);
|
||||||
|
|
||||||
w = WID ("bouncekeys_enable");
|
w = WID ("bouncekeys_enable");
|
||||||
gconf_peditor_new_boolean (changeset,
|
gconf_peditor_new_boolean (changeset,
|
||||||
CONFIG_ROOT "/bouncekeys_enable",
|
CONFIG_ROOT "/bouncekeys_enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
g_signal_connect (G_OBJECT (w), "toggled",
|
g_signal_connect (w, "toggled",
|
||||||
G_CALLBACK (bouncekeys_enable_toggled_cb), dialog);
|
G_CALLBACK (bouncekeys_enable_toggled_cb), dialog);
|
||||||
bouncekeys_enable_toggled_cb (w, dialog);
|
bouncekeys_enable_toggled_cb (w, dialog);
|
||||||
|
|
||||||
|
@ -227,7 +229,7 @@ setup_a11y_tabs (GladeXML *dialog, GConfChangeSet *changeset)
|
||||||
WID ("bouncekeys_delay_slide"), NULL);
|
WID ("bouncekeys_delay_slide"), NULL);
|
||||||
|
|
||||||
w = WID ("notifications_button");
|
w = WID ("notifications_button");
|
||||||
g_signal_connect (G_OBJECT (w), "clicked",
|
g_signal_connect (w, "clicked",
|
||||||
G_CALLBACK (notifications_button_clicked_cb), dialog);
|
G_CALLBACK (notifications_button_clicked_cb), dialog);
|
||||||
|
|
||||||
/* Mouse Keys tab */
|
/* Mouse Keys tab */
|
||||||
|
@ -235,15 +237,16 @@ setup_a11y_tabs (GladeXML *dialog, GConfChangeSet *changeset)
|
||||||
w = WID ("mousekeys_enable");
|
w = WID ("mousekeys_enable");
|
||||||
gconf_peditor_new_boolean (changeset,
|
gconf_peditor_new_boolean (changeset,
|
||||||
CONFIG_ROOT "/mousekeys_enable",
|
CONFIG_ROOT "/mousekeys_enable",
|
||||||
GTK_WIDGET (w), NULL);
|
w, NULL);
|
||||||
g_signal_connect (G_OBJECT (w), "toggled",
|
g_signal_connect (w, "toggled",
|
||||||
G_CALLBACK (mousekeys_enable_toggled_cb), dialog);
|
G_CALLBACK (mousekeys_enable_toggled_cb), dialog);
|
||||||
mousekeys_enable_toggled_cb (w, dialog);
|
mousekeys_enable_toggled_cb (w, dialog);
|
||||||
|
|
||||||
mousekeys_label = GTK_LABEL (GTK_BIN (w)->child);
|
mousekeys_label = GTK_LABEL (GTK_BIN (w)->child);
|
||||||
gtk_label_set_label (mousekeys_label,
|
label = g_strconcat ("<b>", gtk_label_get_label (mousekeys_label), "</b>", NULL);
|
||||||
g_strdup_printf ("<b>%s</b>", gtk_label_get_label (mousekeys_label)));
|
gtk_label_set_label (mousekeys_label, label);
|
||||||
gtk_label_set_use_markup (mousekeys_label, TRUE);
|
gtk_label_set_use_markup (mousekeys_label, TRUE);
|
||||||
|
g_free (label);
|
||||||
|
|
||||||
gconf_peditor_new_numeric_range (changeset,
|
gconf_peditor_new_numeric_range (changeset,
|
||||||
CONFIG_ROOT "/mousekeys_accel_time",
|
CONFIG_ROOT "/mousekeys_accel_time",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue