Re: GMountOperation issues



>>  Introduce ::cancelled signal
>>   on GMountOperation and add suitable docs.
>
> Sounds reasonable. i'd consider adding that signal if Alex agrees that
> it is a good idea and a patch shows up before Monday night...

Alex was in favour and proposed to name it "aborted" instead. Here is
a patch. Does that look like what you need ?


Matthias
Index: gmountoperation.c
===================================================================
--- gmountoperation.c	(revision 7865)
+++ gmountoperation.c	(working copy)
@@ -57,6 +57,7 @@
   ASK_PASSWORD,
   ASK_QUESTION,
   REPLY,
+  ABORTED,
   LAST_SIGNAL
 };
 
@@ -297,6 +298,28 @@
 		  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, taking possible further
+   * action to inform the user about what happened, and return
+   * #G_IO_ERROR_FAILED_HANDLED.
+   *
+   * 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
Index: gmountoperation.h
===================================================================
--- gmountoperation.h	(revision 7865)
+++ gmountoperation.h	(working copy)
@@ -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;


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