Add an "aborted" signal to abort a mount operation from the backend side.
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 17 Feb 2009 00:02:06 +0000 (00:02 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 17 Feb 2009 00:02:06 +0000 (00:02 +0000)
        * gmountoperation.[hc]: Add an "aborted" signal to abort a
        mount operation from the backend side.

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

svn path=/trunk/; revision=7866

gio/ChangeLog
gio/gmountoperation.c
gio/gmountoperation.h
gio/gvolume.h

index c27397ea686ad8b687955cc5ee416abe6076b803..23f537935a1937c8c5cd13eb3eaf4ed8fcd1612f 100644 (file)
@@ -1,3 +1,10 @@
+2009-02-16  Matthias Clasen  <mclasen@redhat.com>
+
+       * gmountoperation.[hc]: Add an "aborted" signal to abort a
+       mount operation from the backend side.
+
+       * gvolume.h: Add docs regarding the "aborted" signal.
+
 2009-02-13  Ryan Lortie  <desrt@desrt.ca>
 
        Bug 505042 – add file attribute for actually used file size in bytes
index 8234b8315ba8328aaf86965ec0c58579d21683a2..0635e759471a5933c316d0525b158c6e970e2fc8 100644 (file)
@@ -57,6 +57,7 @@ enum {
   ASK_PASSWORD,
   ASK_QUESTION,
   REPLY,
+  ABORTED,
   LAST_SIGNAL
 };
 
@@ -296,6 +297,26 @@ g_mount_operation_class_init (GMountOperationClass *klass)
                  G_TYPE_NONE, 1,
                  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:
    *
index 6c3029dc8cd02ded475efa8c412cc5902ac132ee..e6ba51a9c0d75a71d5eaea4d7a12f2780cb22939 100644 (file)
@@ -73,6 +73,8 @@ struct _GMountOperationClass
   void (* reply)        (GMountOperation       *op,
                         GMountOperationResult  result);
 
+  void (* aborted)      (GMountOperation       *op);
+
   /*< private >*/
   /* Padding for future expansion */
   void (*_g_reserved1) (void);
@@ -86,7 +88,6 @@ struct _GMountOperationClass
   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;
index 640c42fd04cef6d0dd826ffca3707272299045d3..f81faad2eaa81fae5d364793f2cf478d9793228d 100644 (file)
@@ -85,7 +85,10 @@ G_BEGIN_DECLS
  * @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.