~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to gio/gmountoperation.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  REPLY,
60
60
  ABORTED,
61
61
  SHOW_PROCESSES,
 
62
  SHOW_UNMOUNT_PROGRESS,
62
63
  LAST_SIGNAL
63
64
};
64
65
 
240
241
}
241
242
 
242
243
static void
 
244
show_unmount_progress (GMountOperation *op,
 
245
                       const gchar     *message,
 
246
                       gint64           time_left,
 
247
                       gint64           bytes_left)
 
248
{
 
249
  /* nothing to do */
 
250
}
 
251
 
 
252
static void
243
253
g_mount_operation_class_init (GMountOperationClass *klass)
244
254
{
245
255
  GObjectClass *object_class;
254
264
  klass->ask_password = ask_password;
255
265
  klass->ask_question = ask_question;
256
266
  klass->show_processes = show_processes;
 
267
  klass->show_unmount_progress = show_unmount_progress;
257
268
  
258
269
  /**
259
270
   * GMountOperation::ask-password:
373
384
                  G_TYPE_STRING, G_TYPE_ARRAY, G_TYPE_STRV);
374
385
 
375
386
  /**
 
387
   * GMountOperation::show-unmount-progress:
 
388
   * @op: a #GMountOperation:
 
389
   * @message: string containing a mesage to display to the user
 
390
   * @time_left: the estimated time left before the operation completes,
 
391
   *     in microseconds, or -1
 
392
   * @bytes_left: the amount of bytes to be written before the operation
 
393
   *     completes (or -1 if such amount is not known), or zero if the operation
 
394
   *     is completed
 
395
   *
 
396
   * Emitted when an unmount operation has been busy for more than some time
 
397
   * (typically 1.5 seconds).
 
398
   *
 
399
   * When unmounting or ejecting a volume, the kernel might need to flush
 
400
   * pending data in its buffers to the volume stable storage, and this operation
 
401
   * can take a considerable amount of time. This signal may be emitted several
 
402
   * times as long as the unmount operation is outstanding, and then one
 
403
   * last time when the operation is completed, with @bytes_left set to zero.
 
404
   *
 
405
   * Implementations of GMountOperation should handle this signal by
 
406
   * showing an UI notification, and then dismiss it, or show another notification
 
407
   * of completion, when @bytes_left reaches zero.
 
408
   *
 
409
   * If the message contains a line break, the first line should be
 
410
   * presented as a heading. For example, it may be used as the
 
411
   * primary text in a #GtkMessageDialog.
 
412
   *
 
413
   * Since: 2.34
 
414
   */
 
415
  signals[SHOW_UNMOUNT_PROGRESS] =
 
416
    g_signal_new (I_("show-unmount-progress"),
 
417
                  G_TYPE_FROM_CLASS (object_class),
 
418
                  G_SIGNAL_RUN_LAST,
 
419
                  G_STRUCT_OFFSET (GMountOperationClass, show_unmount_progress),
 
420
                  NULL, NULL, NULL,
 
421
                  G_TYPE_NONE, 3,
 
422
                  G_TYPE_STRING, G_TYPE_INT64, G_TYPE_INT64);
 
423
 
 
424
  /**
376
425
   * GMountOperation:username:
377
426
   *
378
427
   * The user name that is used for authentication when carrying out