]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkmountoperation.c
gtk: remove "gboolean homogeneous" from gtk_box_new()
[~andy/gtk] / gtk / gtkmountoperation.c
index 4a1c9f8a8b2c5ef74a0e54e5af781a7fd3e20c18..2cdd1d594bb19992fc40abc246a32ab055404740 100644 (file)
 #include "gtkicontheme.h"
 #include "gtkimagemenuitem.h"
 #include "gtkmain.h"
-#include "gtkalias.h"
 
 /**
  * SECTION:filesystem
  * @short_description: Functions for working with GIO
+ * @Title: Filesystem utilities
  *
  * The functions and objects described here make working with GTK+ and
- * GIO more convenient. #GtkMountOperation is needed when mounting volumes
- * and gtk_show_uri() is a convenient way to launch applications for URIs.
- * Another object that is worth mentioning in this context is 
- * #GdkAppLaunchContext, which provides visual feedback when lauching
- * applications.
- */
-
-/**
- * GtkMountOperation:
+ * GIO more convenient.
  *
- * #GtkMountOperation is an implementation of #GMountOperation that
- * can be used with GIO functions for mounting volumes such as
+ * #GtkMountOperation is needed when mounting volumes:
+ * It is an implementation of #GMountOperation that can be used with
+ * GIO functions for mounting volumes such as
  * g_file_mount_enclosing_volume(), g_file_mount_mountable(),
- * g_volume_mount(), g_mount_unmount() and others.
+ * g_volume_mount(), g_mount_unmount_with_operation() and others.
  *
  * When necessary, #GtkMountOperation shows dialogs to ask for
  * passwords, questions or show processes blocking unmount.
+ *
+ * gtk_show_uri() is a convenient way to launch applications for URIs.
+ *
+ * Another object that is worth mentioning in this context is
+ * #GdkAppLaunchContext, which provides visual feedback when lauching
+ * applications.
  */
 
 static void   gtk_mount_operation_finalize     (GObject          *object);
@@ -458,6 +457,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
   GtkWidget *hbox, *main_vbox, *vbox, *icon;
   GtkWidget *table;
   GtkWidget *message_label;
+  GtkWidget *content_area, *action_area;
   gboolean   can_anonymous;
   guint      rows;
   const gchar *secondary;
@@ -473,12 +473,14 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
 
   priv->dialog = dialog;
 
+  content_area = gtk_dialog_get_content_area (dialog);
+  action_area = gtk_dialog_get_action_area (dialog);
+
   /* Set the dialog up with HIG properties */
-  gtk_dialog_set_has_separator (dialog, FALSE);
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-  gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
-  gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
-  gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+  gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+  gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+  gtk_box_set_spacing (GTK_BOX (action_area), 6);
 
   gtk_window_set_resizable (window, FALSE);
   gtk_window_set_title (window, "");
@@ -496,9 +498,9 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
                                            -1);
 
   /* Build contents */
-  hbox = gtk_hbox_new (FALSE, 12);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-  gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
 
   icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
                                    GTK_ICON_SIZE_DIALOG);
@@ -506,7 +508,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
   gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
   gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
 
-  main_vbox = gtk_vbox_new (FALSE, 18);
+  main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
   gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
 
   secondary = strstr (message, "\n");
@@ -537,7 +539,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
                           FALSE, FALSE, 0);
     }
 
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
 
   can_anonymous = flags & G_ASK_PASSWORD_ANONYMOUS_SUPPORTED;
@@ -549,7 +551,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
       GtkWidget *choice;
       GSList    *group;
 
-      anon_box = gtk_vbox_new (FALSE, 6);
+      anon_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
       gtk_box_pack_start (GTK_BOX (vbox), anon_box,
                           FALSE, FALSE, 0);
 
@@ -623,7 +625,7 @@ gtk_mount_operation_ask_password (GMountOperation   *mount_op,
       GSList       *group;
       GPasswordSave password_save;
 
-      remember_box = gtk_vbox_new (FALSE, 6);
+      remember_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
       gtk_box_pack_start (GTK_BOX (vbox), remember_box,
                           FALSE, FALSE, 0);
 
@@ -878,7 +880,7 @@ add_pid_to_process_list_store (GtkMountOperation              *mount_operation,
                                     &pixbuf);
 
   if (name == NULL)
-    name = g_strdup_printf (_("Unknown Application (pid %d)"), pid);
+    name = g_strdup_printf (_("Unknown Application (PID %d)"), pid);
 
   if (command_line == NULL)
     command_line = g_strdup ("");
@@ -1214,10 +1216,9 @@ create_show_processes_dialog (GMountOperation *op,
   if (priv->parent_window != NULL)
     gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);
   gtk_window_set_title (GTK_WINDOW (dialog), "");
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-  vbox = gtk_vbox_new (FALSE, 12);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
   gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
 
@@ -1359,7 +1360,7 @@ gtk_mount_operation_aborted (GMountOperation *op)
 
 /**
  * gtk_mount_operation_new:
- * @parent: transient parent of the window, or %NULL
+ * @parent: (allow-none): transient parent of the window, or %NULL
  *
  * Creates a new #GtkMountOperation
  *
@@ -1400,7 +1401,7 @@ gtk_mount_operation_is_showing (GtkMountOperation *op)
 /**
  * gtk_mount_operation_set_parent:
  * @op: a #GtkMountOperation
- * @parent: transient parent of the window, or %NULL
+ * @parent: (allow-none): transient parent of the window, or %NULL
  *
  * Sets the transient parent for windows shown by the
  * #GtkMountOperation.
@@ -1450,7 +1451,7 @@ gtk_mount_operation_set_parent (GtkMountOperation *op,
  *
  * Gets the transient parent used by the #GtkMountOperation
  *
- * Returns: the transient parent for windows shown by @op
+ * Returns: (transfer none): the transient parent for windows shown by @op
  *
  * Since: 2.14
  */
@@ -1500,10 +1501,10 @@ gtk_mount_operation_set_screen (GtkMountOperation *op,
  * gtk_mount_operation_get_screen:
  * @op: a #GtkMountOperation
  *
- * Gets the screen on which windows of the #GtkMountOperation 
+ * Gets the screen on which windows of the #GtkMountOperation
  * will be shown.
  *
- * Returns: the screen on which windows of @op are shown
+ * Returns: (transfer none): the screen on which windows of @op are shown
  *
  * Since: 2.14
  */
@@ -1525,6 +1526,3 @@ gtk_mount_operation_get_screen (GtkMountOperation *op)
   else
     return gdk_screen_get_default ();
 }
-
-#define __GTK_MOUNT_OPERATION_C__
-#include "gtkaliasdef.c"