mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
mount-operation: add show-unmount-progress signal
The actual implementation will be in gvfs. https://bugzilla.gnome.org/show_bug.cgi?id=676111
This commit is contained in:
parent
37fbd702d5
commit
44375ad7c5
@ -59,6 +59,7 @@ enum {
|
||||
REPLY,
|
||||
ABORTED,
|
||||
SHOW_PROCESSES,
|
||||
SHOW_UNMOUNT_PROGRESS,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@ -239,6 +240,15 @@ show_processes (GMountOperation *op,
|
||||
g_object_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
show_unmount_progress (GMountOperation *op,
|
||||
const gchar *message,
|
||||
guint64 time_left,
|
||||
guint64 bytes_left)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
static void
|
||||
g_mount_operation_class_init (GMountOperationClass *klass)
|
||||
{
|
||||
@ -254,6 +264,7 @@ g_mount_operation_class_init (GMountOperationClass *klass)
|
||||
klass->ask_password = ask_password;
|
||||
klass->ask_question = ask_question;
|
||||
klass->show_processes = show_processes;
|
||||
klass->show_unmount_progress = show_unmount_progress;
|
||||
|
||||
/**
|
||||
* GMountOperation::ask-password:
|
||||
@ -372,6 +383,41 @@ g_mount_operation_class_init (GMountOperationClass *klass)
|
||||
G_TYPE_NONE, 3,
|
||||
G_TYPE_STRING, G_TYPE_ARRAY, G_TYPE_STRV);
|
||||
|
||||
/**
|
||||
* GMountOperation::show-unmount-progress:
|
||||
* @op: a #GMountOperation:
|
||||
* @message: string containing a mesage to display to the user
|
||||
* @time_left: the estimated time left before the operation completes, or -1
|
||||
* @bytes_left: the amount of bytes to be written before the operation
|
||||
* completes (or -1 if such amount is not known), or zero if the operation
|
||||
* is completed
|
||||
*
|
||||
* Emitted when an unmount operation has been busy for more than some time
|
||||
* (typically 1.5 seconds).
|
||||
*
|
||||
* When unmounting or ejecting a volume, the kernel might need to flush
|
||||
* pending data in its buffers to the volume stable storage, and this operation
|
||||
* can take a considerable amount of time. This signal may be emitted several
|
||||
* times as long as the unmount operation is outstanding, and then one
|
||||
* last time when the operation is completed, with @bytes_left set to zero.
|
||||
*
|
||||
* Implementations of GMountOperation should handle this signal by
|
||||
* showing an UI notification, and then dismiss it, or show another notification
|
||||
* of completion, when @bytes_left reaches zero.
|
||||
*
|
||||
* If the message contains a line break, the first line should be
|
||||
* presented as a heading. For example, it may be used as the
|
||||
* primary text in a #GtkMessageDialog.
|
||||
*/
|
||||
signals[SHOW_UNMOUNT_PROGRESS] =
|
||||
g_signal_new (I_("show-unmount-progress"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GMountOperationClass, show_unmount_progress),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 3,
|
||||
G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_UINT64);
|
||||
|
||||
/**
|
||||
* GMountOperation:username:
|
||||
*
|
||||
|
@ -80,6 +80,11 @@ struct _GMountOperationClass
|
||||
GArray *processes,
|
||||
const gchar *choices[]);
|
||||
|
||||
void (* show_unmount_progress) (GMountOperation *op,
|
||||
const gchar *message,
|
||||
guint64 time_left,
|
||||
guint64 bytes_left);
|
||||
|
||||
/*< private >*/
|
||||
/* Padding for future expansion */
|
||||
void (*_g_reserved1) (void);
|
||||
@ -91,7 +96,6 @@ struct _GMountOperationClass
|
||||
void (*_g_reserved7) (void);
|
||||
void (*_g_reserved8) (void);
|
||||
void (*_g_reserved9) (void);
|
||||
void (*_g_reserved10) (void);
|
||||
};
|
||||
|
||||
GType g_mount_operation_get_type (void) G_GNUC_CONST;
|
||||
|
Loading…
Reference in New Issue
Block a user