]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkmountoperation.c
GtkMountOperation: don't use a GtkAlignment
[~andy/gtk] / gtk / gtkmountoperation.c
index 2cdd1d594bb19992fc40abc246a32ab055404740..f1d7980f08baf8fbfbe549158b1a9822bea8bcad 100644 (file)
@@ -30,7 +30,6 @@
 #include <string.h>
 
 #include "gtkmountoperationprivate.h"
-#include "gtkalignment.h"
 #include "gtkbox.h"
 #include "gtkentry.h"
 #include "gtkhbox.h"
@@ -453,7 +452,6 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
   GtkWidget *widget;
   GtkDialog *dialog;
   GtkWindow *window;
-  GtkWidget *entry_container;
   GtkWidget *hbox, *main_vbox, *vbox, *icon;
   GtkWidget *table;
   GtkWidget *message_label;
@@ -584,19 +582,15 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
     rows++;
 
   /* The table that holds the entries */
-  entry_container = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
-
-  gtk_alignment_set_padding (GTK_ALIGNMENT (entry_container),
-                             0, 0, can_anonymous ? 12 : 0, 0);
-
-  gtk_box_pack_start (GTK_BOX (vbox), entry_container,
-                      FALSE, FALSE, 0);
-  priv->entry_container = entry_container;
-
   table = gtk_table_new (rows, 2, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 12);
   gtk_table_set_row_spacings (GTK_TABLE (table), 6);
-  gtk_container_add (GTK_CONTAINER (entry_container), table);
+
+  if (can_anonymous)
+    gtk_widget_set_margin_left (table, 12);
+
+  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+  priv->entry_container = table;
 
   rows = 0;
 
@@ -1182,7 +1176,7 @@ on_button_press_event_for_process_tree_view (GtkWidget      *widget,
   return ret;
 }
 
-static void
+static GtkWidget *
 create_show_processes_dialog (GMountOperation *op,
                               const char      *message,
                               const char      *choices[])
@@ -1309,9 +1303,9 @@ create_show_processes_dialog (GMountOperation *op,
   g_object_add_weak_pointer (G_OBJECT (tree_view), (gpointer *) &priv->process_tree_view);
 
   g_object_unref (list_store);
-
-  gtk_widget_show_all (dialog);
   g_object_ref (op);
+
+  return dialog;
 }
 
 static void
@@ -1321,6 +1315,7 @@ gtk_mount_operation_show_processes (GMountOperation *op,
                                     const char      *choices[])
 {
   GtkMountOperationPrivate *priv;
+  GtkWidget *dialog = NULL;
 
   g_return_if_fail (GTK_IS_MOUNT_OPERATION (op));
   g_return_if_fail (message != NULL);
@@ -1332,7 +1327,7 @@ gtk_mount_operation_show_processes (GMountOperation *op,
   if (priv->process_list_store == NULL)
     {
       /* need to create the dialog */
-      create_show_processes_dialog (op, message, choices);
+      dialog = create_show_processes_dialog (op, message, choices);
     }
 
   /* otherwise, we're showing the dialog, assume messages+choices hasn't changed */
@@ -1340,6 +1335,11 @@ gtk_mount_operation_show_processes (GMountOperation *op,
   update_process_list_store (GTK_MOUNT_OPERATION (op),
                              priv->process_list_store,
                              processes);
+
+  if (dialog != NULL)
+    {
+      gtk_widget_show_all (dialog);
+    }
 }
 
 static void