glib r7866 - trunk/gio



Author: matthiasc
Date: Tue Feb 17 00:02:06 2009
New Revision: 7866
URL: http://svn.gnome.org/viewvc/glib?rev=7866&view=rev

Log:
        * gmountoperation.[hc]: Add an "aborted" signal to abort a
        mount operation from the backend side.

        * gvolume.h: Add docs regarding the "aborted" signal.



Modified:
   trunk/gio/ChangeLog
   trunk/gio/gmountoperation.c
   trunk/gio/gmountoperation.h
   trunk/gio/gvolume.h

Modified: trunk/gio/gmountoperation.c
==============================================================================
--- trunk/gio/gmountoperation.c	(original)
+++ trunk/gio/gmountoperation.c	Tue Feb 17 00:02:06 2009
@@ -57,6 +57,7 @@
   ASK_PASSWORD,
   ASK_QUESTION,
   REPLY,
+  ABORTED,
   LAST_SIGNAL
 };
 
@@ -297,6 +298,26 @@
 		  G_TYPE_MOUNT_OPERATION_RESULT);
 
   /**
+   * GMountOperation::aborted:
+   *
+   * Emitted by the backend when e.g. a device becomes unavailable
+   * while a mount operation is in progress. 
+   *
+   * Implementations of GMountOperation should handle this signal
+   * by dismissing open password dialogs.
+   *
+   * Since: 2.20
+   */
+  signals[ABORTED] = 
+    g_signal_new (I_("aborted"),
+		  G_TYPE_FROM_CLASS (object_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (GMountOperationClass, aborted),
+		  NULL, NULL,
+		  g_cclosure_marshal_VOID__VOID,
+		  G_TYPE_NONE, 0);
+
+  /**
    * GMountOperation:username:
    *
    * The user name that is used for authentication when carrying out

Modified: trunk/gio/gmountoperation.h
==============================================================================
--- trunk/gio/gmountoperation.h	(original)
+++ trunk/gio/gmountoperation.h	Tue Feb 17 00:02:06 2009
@@ -73,6 +73,8 @@
   void (* reply)        (GMountOperation       *op,
 			 GMountOperationResult  result);
 
+  void (* aborted)      (GMountOperation       *op);
+
   /*< private >*/
   /* Padding for future expansion */
   void (*_g_reserved1) (void);
@@ -86,7 +88,6 @@
   void (*_g_reserved9) (void);
   void (*_g_reserved10) (void);
   void (*_g_reserved11) (void);
-  void (*_g_reserved12) (void);
 };
 
 GType             g_mount_operation_get_type      (void) G_GNUC_CONST;

Modified: trunk/gio/gvolume.h
==============================================================================
--- trunk/gio/gvolume.h	(original)
+++ trunk/gio/gvolume.h	Tue Feb 17 00:02:06 2009
@@ -85,7 +85,10 @@
  * @get_mount: Gets a #GMount representing the mounted volume. Returns %NULL if the #GVolume is not mounted.
  * @can_mount: Returns %TRUE if the #GVolume can be mounted.
  * @can_eject: Checks if a #GVolume can be ejected.
- * @mount_fn: Mounts a given #GVolume.
+ * @mount_fn: Mounts a given #GVolume. 
+ *     #GVolume implementations must emit the #GMountOperation::aborted 
+ *     signal before completing a mount operation that is aborted while 
+ *     awaiting input from the user through a #GMountOperation instance.
  * @mount_finish: Finishes a mount operation.
  * @eject: Ejects a given #GVolume.
  * @eject_finish: Finishes an eject operation.



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