From: David Zeuthen Date: Mon, 7 Jul 2008 02:23:52 +0000 (+0000) Subject: Export the eject-button signal on the volume monitor class (#541794). X-Git-Tag: GLIB_2_17_4~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a5a2be92b0502deb171830020124bc6c4b9f65e;p=platform%2Fupstream%2Fglib.git Export the eject-button signal on the volume monitor class (#541794). 2008-07-06 David Zeuthen * gvolumemonitor.[ch]: * gunionvolumemonitor.c: Export the eject-button signal on the volume monitor class (#541794). svn path=/trunk/; revision=7168 --- diff --git a/gio/ChangeLog b/gio/ChangeLog index 664cdaf..658c7f4 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,9 @@ +2008-07-06 David Zeuthen + + * gvolumemonitor.[ch]: + * gunionvolumemonitor.c: Export the eject-button signal on the + volume monitor class (#541794). + 2008-07-06 Matthias Clasen * gappinfo.c: More doc tweaks diff --git a/gio/gunionvolumemonitor.c b/gio/gunionvolumemonitor.c index 22aa220..35d2189 100644 --- a/gio/gunionvolumemonitor.c +++ b/gio/gunionvolumemonitor.c @@ -344,6 +344,16 @@ child_drive_changed (GVolumeMonitor *child_monitor, } static void +child_drive_eject_button (GVolumeMonitor *child_monitor, + GDrive *child_drive, + GUnionVolumeMonitor *union_monitor) +{ + g_signal_emit_by_name (union_monitor, + "drive_eject_button", + child_drive); +} + +static void g_union_volume_monitor_add_monitor (GUnionVolumeMonitor *union_monitor, GVolumeMonitor *volume_monitor) { @@ -364,6 +374,7 @@ g_union_volume_monitor_add_monitor (GUnionVolumeMonitor *union_monitor, g_signal_connect (volume_monitor, "drive_connected", (GCallback)child_drive_connected, union_monitor); g_signal_connect (volume_monitor, "drive_disconnected", (GCallback)child_drive_disconnected, union_monitor); g_signal_connect (volume_monitor, "drive_changed", (GCallback)child_drive_changed, union_monitor); + g_signal_connect (volume_monitor, "drive_eject_button", (GCallback)child_drive_eject_button, union_monitor); } static void @@ -388,6 +399,7 @@ g_union_volume_monitor_remove_monitor (GUnionVolumeMonitor *union_monitor, g_signal_handlers_disconnect_by_func (child_monitor, child_drive_connected, union_monitor); g_signal_handlers_disconnect_by_func (child_monitor, child_drive_disconnected, union_monitor); g_signal_handlers_disconnect_by_func (child_monitor, child_drive_changed, union_monitor); + g_signal_handlers_disconnect_by_func (child_monitor, child_drive_eject_button, union_monitor); } static GType diff --git a/gio/gvolumemonitor.c b/gio/gvolumemonitor.c index 8b9560e..e14af16 100644 --- a/gio/gvolumemonitor.c +++ b/gio/gvolumemonitor.c @@ -56,6 +56,7 @@ enum { DRIVE_CONNECTED, DRIVE_DISCONNECTED, DRIVE_CHANGED, + DRIVE_EJECT_BUTTON, LAST_SIGNAL }; @@ -229,6 +230,23 @@ g_volume_monitor_class_init (GVolumeMonitorClass *klass) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_DRIVE); + /** + * GVolumeMonitor::drive-eject-button: + * @volume_monitor: The volume monitor emitting the signal. + * @drive: the drive where the eject button was pressed + * + * Emitted when the eject button is pressed on @drive. + * + * Since: 2.18 + **/ + signals[DRIVE_EJECT_BUTTON] = g_signal_new (I_("drive_eject_button"), + G_TYPE_VOLUME_MONITOR, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GVolumeMonitorClass, drive_eject_button), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_DRIVE); + } static void diff --git a/gio/gvolumemonitor.h b/gio/gvolumemonitor.h index 6bf7349..3376378 100644 --- a/gio/gvolumemonitor.h +++ b/gio/gvolumemonitor.h @@ -110,7 +110,11 @@ struct _GVolumeMonitorClass { /* These arguments are unfortunately backwards by mistake (bug #520169) */ GVolume * (*adopt_orphan_mount) (GMount *mount, GVolumeMonitor *volume_monitor); - + + /* signal added in 2.17 */ + void (* drive_eject_button) (GVolumeMonitor *volume_monitor, + GDrive *drive); + /*< private >*/ /* Padding for future expansion */ void (*_g_reserved1) (void); @@ -120,7 +124,6 @@ struct _GVolumeMonitorClass { void (*_g_reserved5) (void); void (*_g_reserved6) (void); void (*_g_reserved7) (void); - void (*_g_reserved8) (void); }; GType g_volume_monitor_get_type (void) G_GNUC_CONST;