[network-manager-applet] editor: really fix CEPolkitButton



commit 0aa64509651242bfbb2a6e8c7c0c76ac2e158912
Author: Dan Williams <dcbw redhat com>
Date:   Mon Sep 28 17:43:30 2009 -0700

    editor: really fix CEPolkitButton
    
    Don't destroy widgets that glade owns; don't hide the Editor dialog
    buttons either.

 src/connection-editor/nm-connection-editor.c |    5 +----
 src/connection-editor/nm-connection-list.c   |    4 ----
 2 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index eb96317..a60e299 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -320,7 +320,7 @@ dispose (GObject *object)
 		editor->orig_connection = NULL;
 	}
 	if (editor->window) {
-		gtk_widget_destroy (editor->window);
+		gtk_widget_hide (editor->window);
 		editor->window = NULL;
 	}
 	if (editor->xml) {
@@ -392,7 +392,6 @@ nm_connection_editor_new (NMConnection *connection,
 	                                          settings,
 	                                          NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
 	ce_polkit_button_set_use_polkit (CE_POLKIT_BUTTON (editor->ok_button), use_polkit);
-	g_object_ref_sink (editor->ok_button);
 
 	g_signal_connect (editor->ok_button, "actionable",
 	                  G_CALLBACK (ok_button_actionable_cb), editor);
@@ -645,7 +644,6 @@ cancel_button_clicked_cb (GtkWidget *widget, gpointer user_data)
 {
 	NMConnectionEditor *self = NM_CONNECTION_EDITOR (user_data);
 
-	gtk_widget_hide (widget);
 	g_signal_emit (self, editor_signals[EDITOR_DONE], 0, GTK_RESPONSE_CANCEL, NULL);
 }
 
@@ -660,7 +658,6 @@ ok_button_clicked_cb (GtkWidget *widget, gpointer user_data)
 {
 	NMConnectionEditor *self = NM_CONNECTION_EDITOR (user_data);
 
-	gtk_widget_hide (widget);
 	g_signal_emit (self, editor_signals[EDITOR_DONE], 0, GTK_RESPONSE_OK, NULL);
 }
 
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index fd31af4..811c182 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -1065,8 +1065,6 @@ dispose (GObject *object)
 	if (list->unknown_icon)
 		g_object_unref (list->unknown_icon);
 
-	if (list->dialog)
-		gtk_widget_destroy (list->dialog);
 	if (list->gui)
 		g_object_unref (list->gui);
 	if (list->client)
@@ -1249,7 +1247,6 @@ add_connection_buttons (NMConnectionList *self,
 	                               GTK_STOCK_EDIT,
 	                               self->system_settings,
 	                               NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
-	g_object_ref_sink (button);
 	gtk_box_pack_end (GTK_BOX (hbox), button, TRUE, TRUE, 0);
 
 	action_info_set_button (info, button);
@@ -1267,7 +1264,6 @@ add_connection_buttons (NMConnectionList *self,
 	                               GTK_STOCK_DELETE,
 	                               self->system_settings,
 	                               NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
-	g_object_ref_sink (button);
 	gtk_box_pack_end (GTK_BOX (hbox), button, TRUE, TRUE, 0);
 
 	action_info_set_button (info, button);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]