gio.VolumeMonitorVolume Monitor.Synopsisgio.VolumeMonitorgobject.GObjectget_connected_drivesget_mount_for_uuiduuidget_mountsget_volume_for_uuiduuidget_volumesFunctionsgio.volume_monitor_adopt_orphan_mountgio.volume_monitor_getAncestry+-- gobject.GObject
+-- gio.VolumeMonitor
gio.VolumeMonitor Signal Prototypesgobject.GObject Signal Prototypes"drive-changed"callbackvolume_monitordriveuser_param1..."drive-connected"callbackvolume_monitordriveuser_param1..."drive-disconnected"callbackvolume_monitordriveuser_param1..."drive-eject-button"callbackvolume_monitordriveuser_param1..."mount-added"callbackvolume_monitormountuser_param1..."mount-changed"callbackvolume_monitormountuser_param1..."mount-pre-unmount"callbackvolume_monitormountuser_param1..."mount-removed"callbackvolume_monitormountuser_param1..."volume-added"callbackvolume_monitorvolumeuser_param1..."volume-changed"callbackvolume_monitorvolumeuser_param1..."volume-removed"callbackvolume_monitorvolumeuser_param1...Description
The gio.VolumeMonitor
is for listing the user interesting devices and volumes on the computer. In other words,
what a file selector or file manager would show in a sidebar.
Methodsgio.VolumeMonitor.get_connected_drivesget_connected_drivesReturns :a list of connected
gio.Drive objects.
The get_connected_drives() method gets a list
of drives connected to the system.
gio.VolumeMonitor.get_mount_for_uuidget_mount_for_uuiduuiduuid :The UUID to look for.
Returns :A
gio.Mount
or None if no such mount is available.
The get_mount_for_uuid() method finds a
gio.Mount
object by it's UUID (see
gio.Mount.get_uuid())
gio.VolumeMonitor.get_mountsget_mountsReturns :A list of
gio.Mount
objects.
The get_mounts() method gets a list of the mounts on the system.
gio.VolumeMonitor.get_volume_for_uuidget_volume_for_uuiduuiduuid :The UUID to look for.
Returns :A
gio.Volume
or None if no such volume is available.
The get_mount_for_uuid() method finds a
gio.Mount
object by it's UUID (see
gio.Mount.get_uuid())
gio.VolumeMonitor.get_volumesget_volumesReturns :A list of
gio.Volume
objects.
The get_volumes() method gets a list of the volumes on the system.
Functionsgio.volume_monitor_adopt_orphan_mountvolume_monitor_adopt_orphan_mountReturns :The gio.Volume
object that is the parent for mount or None if no wants to adopt the
gio.Mount.
This method will be deprecated starting from GIO 2.20
The volume_monitor_adopt_orphan_mount() function should
be called by any gio.VolumeMonitor
implementation when a new gio.Mount
object is created that is not associated with a
gio.Volume object.
It must be called just before emitting the mount_added signal.
If the return value is not None, the caller must associate the returned
gio.Volume
object with the
gio.Mount.
This involves returning it in it's
gio.Mount.get_volumes()
implementation. The caller must also listen for the "removed" signal on the
returned object and give up it's reference when handling that signal
Similary, if implementing
gio.volume_monitor_adopt_orphan_mount(),
the implementor must take a reference to mount and return it in it's
gio.Volume.get_mount()
implemented. Also, the implementor must listen for the "unmounted" signal
on mount and give up it's reference upon handling that signal.
There are two main use cases for this function.
One is when implementing a user space file system driver that reads blocks of
a block device that is already represented by the native volume monitor
(for example a CD Audio file system driver). Such a driver will generate it's own
gio.Mount
object that needs to be assoicated with the
gio.Volume
object that represents the volume.
The other is for implementing a
gio.VolumeMonitor
whose sole purpose is to return
gio.Volume
objects representing entries in the users "favorite servers" list or similar.
gio.volume_monitor_getvolume_monitor_getReturns :A reference to the
gio.VolumeMonitor
used by gio.
The volume_monitor_get() function gets the
volume monitor used by gio.
SignalsThe "drive-changed" gio.Volume Signalcallbackvolume_monitordriveuser_param1...volume_monitor :the volume monitordrive :the drive that changeduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a drive changes.
The "drive-connected" gio.Volume Signalcallbackvolume_monitordriveuser_param1...volume_monitor :the volume monitordrive :the drive that was connecteduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a drive is connected to the system.
The "drive-disconnected" gio.Volume Signalcallbackvolume_monitordriveuser_param1...volume_monitor :the volume monitordrive :the drive that was disconnecteduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a drive is disconnected from the system.
The "drive-eject-button" gio.Volume Signalcallbackvolume_monitordriveuser_param1...volume_monitor :the volume monitordrive :the drive where the eject button was presseduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when the eject button is pressed on drive.
The "mount-added" gio.Volume Signalcallbackvolumemountuser_param1...volume_monitor :the volume monitormount :a Mount that was added.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mount is added.
The "mount-changed" gio.Volume Signalcallbackvolume_monitormountuser_param1...volume_monitor :the volume monitormount :the Mount that changed.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mount changes.
The "mount-pre-unmount" gio.Volume Signalcallbackvolume_monitormountuser_param1...volume_monitor :the volume monitormount :the Mount that is being unmounted.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mount is about to be removed.
The "mount-removed" gio.Volume Signalcallbackvolume_monitormountuser_param1...volume_monitor :the volume monitormount :the Mount that was removed.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mount is removed.
The "volume-added" gio.Volume Signalcallbackvolume_monitorvolumeuser_param1...volume_monitor :the volume monitorvolume :a Volume that was added.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mountable volume is added to the system.
The "volume-changed" gio.Volume Signalcallbackvolume_monitorvolumeuser_param1...volume_monitor :the volume monitorvolume :a Volume that changed.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when mountable volume is changed.
The "volume-removed" gio.Volume Signalcallbackvolume_monitorvolumeuser_param1...volume_monitor :the volume monitorvolume :a Volume that was removed.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)
Emitted when a mountable volume is removed from the system.