32
32
#include "gioalias.h"
35
35
* SECTION:gmountoperation
36
* @short_description: Authentication methods for mountable locations
36
* @short_description: Object used for authentication and user interaction
37
37
* @include: gio/gio.h
39
* #GMountOperation provides a mechanism for authenticating mountable
40
* operations, such as loop mounting files, hard drive partitions or
43
* Mounting operations are handed a #GMountOperation that then can use
44
* if they require any privileges or authentication for their volumes
45
* to be mounted (e.g. a hard disk partition or an encrypted filesystem),
46
* or if they are implementing a remote server protocol which requires
47
* user credentials such as FTP or WebDAV.
49
* Users should instantiate a subclass of this that implements all
50
* the various callbacks to show the required dialogs, such as
39
* #GMountOperation provides a mechanism for interacting with the user.
40
* It can be used for authenticating mountable operations, such as loop
41
* mounting files, hard drive partitions or server locations. It can
42
* also be used to ask the user questions or show a list of applications
43
* preventing unmount or eject operations from completing.
45
* Note that #GMountOperation is used for more than just #GMount
46
* objects – for example it is also used in g_drive_start() and
49
* Users should instantiate a subclass of this that implements all the
50
* various callbacks to show the required dialogs, such as
51
* #GtkMountOperation. If no user interaction is desired (for example
52
* when automounting filesystems at login time), usually %NULL can be
53
* passed, see each method taking a #GMountOperation for details.
54
56
G_DEFINE_TYPE (GMountOperation, g_mount_operation, G_TYPE_OBJECT);
233
show_processes (GMountOperation *op,
234
const gchar *message,
236
const gchar *choices[])
238
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
239
reply_non_handled_in_idle,
230
245
g_mount_operation_class_init (GMountOperationClass *klass)
232
247
GObjectClass *object_class;
345
* GMountOperation::show-processes:
346
* @op: a #GMountOperation.
347
* @message: string containing a message to display to the user.
348
* @processes: an array of #GPid for processes blocking the operation.
349
* @choices: an array of strings for each possible choice.
351
* Emitted when one or more processes are blocking an operation
352
* e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
354
* Note that this signal may be emitted several times to update the
355
* list of blocking processes as processes close files. The
356
* application should only respond with g_mount_operation_reply() to
357
* the latest signal (setting #GMountOperation:choice to the choice
360
* If the message contains a line break, the first line should be
361
* presented as a heading. For example, it may be used as the
362
* primary text in a #GtkMessageDialog.
366
signals[SHOW_PROCESSES] =
367
g_signal_new (I_("show-processes"),
368
G_TYPE_FROM_CLASS (object_class),
370
G_STRUCT_OFFSET (GMountOperationClass, show_processes),
372
_gio_marshal_VOID__STRING_BOXED_BOXED,
374
G_TYPE_STRING, G_TYPE_ARRAY, G_TYPE_STRV);
329
377
* GMountOperation:username:
331
379
* The user name that is used for authentication when carrying out