[network-manager-applet/polkit1] editor: make sure Apply and Edit/Delete buttons show up



commit 0e03f112d7f2707765fe8d98f19ced5a5b39a166
Author: Dan Williams <dcbw redhat com>
Date:   Tue Aug 11 14:02:38 2009 -0500

    editor: make sure Apply and Edit/Delete buttons show up
    
    Broke when PolkitGnomeAction got removed.

 src/connection-editor/nm-connection-editor.c     |    9 +++++----
 src/connection-editor/nm-connection-editor.glade |   15 +++++++++++++--
 src/connection-editor/nm-connection-list.c       |    1 +
 3 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index e30bc2b..6ce6601 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -163,6 +163,7 @@ connection_editor_validate (NMConnectionEditor *editor)
 
 done:
 	gtk_widget_set_sensitive (editor->system_checkbutton, valid);
+	gtk_widget_set_sensitive (editor->ok_button, valid);
 #if 0
 	g_object_set (editor->system_gnome_action, "master-sensitive", valid, NULL);
 #endif
@@ -287,8 +288,9 @@ system_pk_result_changed_cb (PolKitGnomeAction *gnome_action,
 static void
 nm_connection_editor_init (NMConnectionEditor *editor)
 {
-	GtkWidget *dialog, *hbox;
+	GtkWidget *dialog;
 #if 0
+	GtkWidget *hbox;
 	const char *auth_label, *auth_tooltip;
 	const char *label, *tooltip;
 #endif
@@ -323,6 +325,7 @@ nm_connection_editor_init (NMConnectionEditor *editor)
 	editor->window = glade_xml_get_widget (editor->xml, "nm-connection-editor");
 	editor->cancel_button = glade_xml_get_widget (editor->xml, "cancel_button");
 	editor->system_checkbutton = glade_xml_get_widget (editor->xml, "system_checkbutton");
+	editor->ok_button = glade_xml_get_widget (editor->xml, "apply_button");
 
 #if 0
 	editor->system_action = polkit_action_new ();
@@ -372,11 +375,9 @@ nm_connection_editor_init (NMConnectionEditor *editor)
 	                  G_CALLBACK (system_pk_result_changed_cb), editor);
 
 	editor->ok_button = polkit_gnome_action_create_button (editor->system_gnome_action);
-#endif
-
-	editor->ok_button = gtk_button_new_from_stock (GTK_STOCK_APPLY);
 	hbox = glade_xml_get_widget (editor->xml, "action_area_hbox");
 	gtk_box_pack_end (GTK_BOX (hbox), editor->ok_button, TRUE, TRUE, 0);
+#endif
 }
 
 static void
diff --git a/src/connection-editor/nm-connection-editor.glade b/src/connection-editor/nm-connection-editor.glade
index 03f087a..b634693 100644
--- a/src/connection-editor/nm-connection-editor.glade
+++ b/src/connection-editor/nm-connection-editor.glade
@@ -589,7 +589,7 @@
                     <property name="label">gtk-cancel</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
+                    <property name="receives_default">False</property>
                     <property name="use_stock">True</property>
                   </widget>
                   <packing>
@@ -599,7 +599,18 @@
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
+                  <widget class="GtkButton" id="apply_button">
+                    <property name="label">gtk-apply</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_stock">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
                 </child>
               </widget>
               <packing>
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index fcb772c..1788fc2 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -1467,6 +1467,7 @@ add_connection_tab (NMConnectionList *self,
 
 	treeview = add_connection_treeview (self, prefix);
 	add_connection_buttons (self, prefix, treeview, ctype, new_func);
+	gtk_widget_show_all (GTK_WIDGET (notebook));
 
 	g_object_set_data (G_OBJECT (treeview), TV_TYPE_TAG, GUINT_TO_POINTER (ctype));
 	self->treeviews = g_slist_prepend (self->treeviews, treeview);



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