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

« back to all changes in this revision

Viewing changes to gio/gvolumemonitor.c

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mto: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 70.
  • Revision ID: james.westby@ubuntu.com-20090215130043-6snh45flhit8oalb
Tags: upstream-2.18.4
ImportĀ upstreamĀ versionĀ 2.18.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 *         David Zeuthen <davidz@redhat.com>
24
24
 */
25
25
 
26
 
#include <config.h>
 
26
#include "config.h"
27
27
#include "gvolumemonitor.h"
 
28
#include "gvolume.h"
 
29
#include "gmount.h"
 
30
#include "gdrive.h"
28
31
#include "glibintl.h"
29
32
 
30
33
#include "gioalias.h"
53
56
  DRIVE_CONNECTED,
54
57
  DRIVE_DISCONNECTED,
55
58
  DRIVE_CHANGED,
 
59
  DRIVE_EJECT_BUTTON,
56
60
  LAST_SIGNAL
57
61
};
58
62
 
66
70
 
67
71
  monitor = G_VOLUME_MONITOR (object);
68
72
 
69
 
  if (G_OBJECT_CLASS (g_volume_monitor_parent_class)->finalize)
70
 
    (*G_OBJECT_CLASS (g_volume_monitor_parent_class)->finalize) (object);
 
73
  G_OBJECT_CLASS (g_volume_monitor_parent_class)->finalize (object);
71
74
}
72
75
 
73
76
static void
84
87
   * 
85
88
   * Emitted when a mountable volume is added to the system.
86
89
   **/
87
 
  signals[VOLUME_ADDED] = g_signal_new (I_("volume_added"),
 
90
  signals[VOLUME_ADDED] = g_signal_new (I_("volume-added"),
88
91
                                        G_TYPE_VOLUME_MONITOR,
89
92
                                        G_SIGNAL_RUN_LAST,
90
93
                                        G_STRUCT_OFFSET (GVolumeMonitorClass, volume_added),
99
102
   * 
100
103
   * Emitted when a mountable volume is removed from the system.
101
104
   **/  
102
 
  signals[VOLUME_REMOVED] = g_signal_new (I_("volume_removed"),
 
105
  signals[VOLUME_REMOVED] = g_signal_new (I_("volume-removed"),
103
106
                                          G_TYPE_VOLUME_MONITOR,
104
107
                                          G_SIGNAL_RUN_LAST,
105
108
                                          G_STRUCT_OFFSET (GVolumeMonitorClass, volume_removed),
114
117
   * 
115
118
   * Emitted when mountable volume is changed.
116
119
   **/  
117
 
  signals[VOLUME_CHANGED] = g_signal_new (I_("volume_changed"),
 
120
  signals[VOLUME_CHANGED] = g_signal_new (I_("volume-changed"),
118
121
                                          G_TYPE_VOLUME_MONITOR,
119
122
                                          G_SIGNAL_RUN_LAST,
120
123
                                          G_STRUCT_OFFSET (GVolumeMonitorClass, volume_changed),
129
132
   * 
130
133
   * Emitted when a mount is added.
131
134
   **/
132
 
  signals[MOUNT_ADDED] = g_signal_new (I_("mount_added"),
 
135
  signals[MOUNT_ADDED] = g_signal_new (I_("mount-added"),
133
136
                                       G_TYPE_VOLUME_MONITOR,
134
137
                                       G_SIGNAL_RUN_LAST,
135
138
                                       G_STRUCT_OFFSET (GVolumeMonitorClass, mount_added),
144
147
   * 
145
148
   * Emitted when a mount is removed.
146
149
   **/
147
 
  signals[MOUNT_REMOVED] = g_signal_new (I_("mount_removed"),
 
150
  signals[MOUNT_REMOVED] = g_signal_new (I_("mount-removed"),
148
151
                                         G_TYPE_VOLUME_MONITOR,
149
152
                                         G_SIGNAL_RUN_LAST,
150
153
                                         G_STRUCT_OFFSET (GVolumeMonitorClass, mount_removed),
159
162
   *
160
163
   * Emitted when a mount is about to be removed.
161
164
   **/ 
162
 
  signals[MOUNT_PRE_UNMOUNT] = g_signal_new (I_("mount_pre_unmount"),
 
165
  signals[MOUNT_PRE_UNMOUNT] = g_signal_new (I_("mount-pre-unmount"),
163
166
                                             G_TYPE_VOLUME_MONITOR,
164
167
                                             G_SIGNAL_RUN_LAST,
165
168
                                             G_STRUCT_OFFSET (GVolumeMonitorClass, mount_pre_unmount),
174
177
   *
175
178
   * Emitted when a mount changes.
176
179
   **/ 
177
 
  signals[MOUNT_CHANGED] = g_signal_new (I_("mount_changed"),
 
180
  signals[MOUNT_CHANGED] = g_signal_new (I_("mount-changed"),
178
181
                                         G_TYPE_VOLUME_MONITOR,
179
182
                                         G_SIGNAL_RUN_LAST,
180
183
                                         G_STRUCT_OFFSET (GVolumeMonitorClass, mount_changed),
189
192
   * 
190
193
   * Emitted when a drive is connected to the system.
191
194
   **/
192
 
  signals[DRIVE_CONNECTED] = g_signal_new (I_("drive_connected"),
 
195
  signals[DRIVE_CONNECTED] = g_signal_new (I_("drive-connected"),
193
196
                                           G_TYPE_VOLUME_MONITOR,
194
197
                                           G_SIGNAL_RUN_LAST,
195
198
                                           G_STRUCT_OFFSET (GVolumeMonitorClass, drive_connected),
204
207
   * 
205
208
   * Emitted when a drive is disconnected from the system.
206
209
   **/  
207
 
  signals[DRIVE_DISCONNECTED] = g_signal_new (I_("drive_disconnected"),
 
210
  signals[DRIVE_DISCONNECTED] = g_signal_new (I_("drive-disconnected"),
208
211
                                              G_TYPE_VOLUME_MONITOR,
209
212
                                              G_SIGNAL_RUN_LAST,
210
213
                                              G_STRUCT_OFFSET (GVolumeMonitorClass, drive_disconnected),
219
222
   *
220
223
   * Emitted when a drive changes.
221
224
   **/ 
222
 
  signals[DRIVE_CHANGED] = g_signal_new (I_("drive_changed"),
 
225
  signals[DRIVE_CHANGED] = g_signal_new (I_("drive-changed"),
223
226
                                         G_TYPE_VOLUME_MONITOR,
224
227
                                         G_SIGNAL_RUN_LAST,
225
228
                                         G_STRUCT_OFFSET (GVolumeMonitorClass, drive_changed),
227
230
                                         g_cclosure_marshal_VOID__OBJECT,
228
231
                                         G_TYPE_NONE, 1, G_TYPE_DRIVE);
229
232
 
 
233
  /**
 
234
   * GVolumeMonitor::drive-eject-button:
 
235
   * @volume_monitor: The volume monitor emitting the signal.
 
236
   * @drive: the drive where the eject button was pressed
 
237
   *
 
238
   * Emitted when the eject button is pressed on @drive.
 
239
   *
 
240
   * Since: 2.18
 
241
   **/
 
242
  signals[DRIVE_EJECT_BUTTON] = g_signal_new (I_("drive-eject-button"),
 
243
                                              G_TYPE_VOLUME_MONITOR,
 
244
                                              G_SIGNAL_RUN_LAST,
 
245
                                              G_STRUCT_OFFSET (GVolumeMonitorClass, drive_eject_button),
 
246
                                              NULL, NULL,
 
247
                                              g_cclosure_marshal_VOID__OBJECT,
 
248
                                              G_TYPE_NONE, 1, G_TYPE_DRIVE);
 
249
 
230
250
}
231
251
 
232
252
static void
244
264
 * The returned list should be freed with g_list_free(), after
245
265
 * its elements have been unreffed with g_object_unref().
246
266
 *
247
 
 * Returns: a #GList of connected #GDrive<!-- -->s
 
267
 * Returns: a #GList of connected #GDrive objects.
248
268
 **/
249
269
GList *
250
270
g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor)
267
287
 * The returned list should be freed with g_list_free(), after
268
288
 * its elements have been unreffed with g_object_unref().
269
289
 *
270
 
 * Returns: a #GList of #GVolume<!-- -->s.
 
290
 * Returns: a #GList of #GVolume objects.
271
291
 **/
272
292
GList *
273
293
g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor)
290
310
 * The returned list should be freed with g_list_free(), after
291
311
 * its elements have been unreffed with g_object_unref().
292
312
 * 
293
 
 * Returns: a #GList of #GMount<!-- -->s
 
313
 * Returns: a #GList of #GMount objects.
294
314
 **/
295
315
GList *
296
316
g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor)
312
332
 * Finds a #GVolume object by it's UUID (see g_volume_get_uuid())
313
333
 * 
314
334
 * Returns: a #GVolume or %NULL if no such volume is available.
 
335
 *     Free the returned object with g_object_unref().
315
336
 **/
316
337
GVolume *
317
338
g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor, 
335
356
 * Finds a #GMount object by it's UUID (see g_mount_get_uuid())
336
357
 * 
337
358
 * Returns: a #GMount or %NULL if no such mount is available.
 
359
 *     Free the returned object with g_object_unref().
338
360
 **/
339
361
GMount *
340
362
g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,