Commit 7a5a2be9 authored by David Zeuthen's avatar David Zeuthen Committed by David Zeuthen
Browse files

Export the eject-button signal on the volume monitor class (#541794).

2008-07-06  David Zeuthen  <davidz@redhat.com>

        * gvolumemonitor.[ch]:
        * gunionvolumemonitor.c: Export the eject-button signal on the
        volume monitor class (#541794).


svn path=/trunk/; revision=7168
parent 532e476d
2008-07-06 David Zeuthen <davidz@redhat.com>
* gvolumemonitor.[ch]:
* gunionvolumemonitor.c: Export the eject-button signal on the
volume monitor class (#541794).
2008-07-06 Matthias Clasen <mclasen@redhat.com>
* gappinfo.c: More doc tweaks
......
......@@ -343,6 +343,16 @@ child_drive_changed (GVolumeMonitor *child_monitor,
child_drive);
}
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
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment