It derives from <GObject>.
<GMountOperation> provides a mechanism for
interacting with the user. It can be used for authenticating mountable
operations, such as loop mounting files, hard drive partitions or server
locations. It can also be used to ask the user questions or show a list
of applications preventing unmount or eject operations from completing.
Note that <GMountOperation> is used for
more than just <GMount> objects – for example it is
also used in drive:start and drive:stop.
Users should instantiate a subclass of this that implements all the
various callbacks to show the required dialogs, such as
‘GtkMountOperation‘.
If no user interaction is desired (for example when automounting
filesystems at login time), usually NULL can be passed, see each
method taking a <GMountOperation> for
details.
Throughout the API, the term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’. TrueCrypt is a discontinued system for encrypting file containers, partitions or whole disks, typically used with Windows. VeraCrypt is a maintained fork of TrueCrypt with various improvements and auditing fixes.
parent-instanceprivWhether to use an anonymous user when authenticating.
Its value is a boolean.
Set it with (set! (mount-operation:anonymous self) value).
The index of the user’s choice when a question is asked during the mount
operation. See the mount-operation:ask-question signal.
Its value is a 32-bit integer.
Set it with (set! (mount-operation:choice self) value).
The domain to use for the mount operation.
Its value is a string, or #f.
Set it with (set! (mount-operation:domain self) value).
Whether the device to be unlocked is a TCRYPT hidden volume. See the VeraCrypt documentation.
Its value is a boolean.
Set it with (set! (mount-operation:is-tcrypt-hidden-volume self)
value).
Whether the device to be unlocked is a TCRYPT system volume. In this context, a system volume is a volume with a bootloader and operating system installed. This is only supported for Windows operating systems. For further documentation, see the VeraCrypt documentation.
Its value is a boolean.
Set it with (set! (mount-operation:is-tcrypt-system-volume self)
value).
The password that is used for authentication when carrying out the mount operation.
Its value is a string, or #f.
Set it with (set! (mount-operation:password self) value).
Determines if and how the password information should be saved.
Its value is a <GPasswordSave> (or, to set
it, one of its symbols).
Set it with (set! (mount-operation:password-save self) value).
The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See the VeraCrypt documentation.html).
Its value is an unsigned 32-bit integer.
Set it with (set! (mount-operation:pim self) value).
The user name that is used for authentication when carrying out the mount operation.
Its value is a string, or #f.
Set it with (set! (mount-operation:username self) value).
Check to see whether the mount operation is being used for an anonymous user.
Passed: a <GMountOperation>.
Returned: a boolean.
#t if mount operation is anonymous.
Gets a choice from the mount operation.
Passed: a <GMountOperation>.
Returned: a 32-bit integer.
an integer containing an index of the user’s choice from the choice’s
list, or 0.
Gets the domain of the mount operation.
Passed: a <GMountOperation>.
Returned: a string, or #f.
a string set to the domain.
Check to see whether the mount operation is being used for a TCRYPT hidden volume.
Passed: a <GMountOperation>.
Returned: a boolean.
#t if mount operation is for hidden volume.
Check to see whether the mount operation is being used for a TCRYPT system volume.
Passed: a <GMountOperation>.
Returned: a boolean.
#t if mount operation is for system volume.
Gets a password from the mount operation.
Passed: a <GMountOperation>.
Returned: a string, or #f.
a string containing the password within self.
Gets the state of saving passwords for the mount operation.
Passed: a <GMountOperation>.
Returned: a <GPasswordSave>.
a <GPasswordSave> flag.
Gets a PIM from the mount operation.
Passed: a <GMountOperation>.
Returned: an unsigned 32-bit integer.
The VeraCrypt PIM within self.
Get the user name from the mount operation.
Passed: a <GMountOperation>.
Returned: a string, or #f.
a string containing the user name.
Creates a new mount operation.
Returned: a <GMountOperation>.
Emits the mount-operation:reply signal.
Passed: a <GMountOperation>.
Passed: a <GMountOperationResult>, or
one of its symbols.
Sets the mount operation to use an anonymous user if anonymous is
#t.
Passed: a <GMountOperation>.
Passed: a boolean.
boolean value.
Sets a default choice for the mount operation.
Passed: a <GMountOperation>.
Passed: a 32-bit integer.
an integer.
Sets the mount operation’s domain.
Passed: a <GMountOperation>.
Passed, or left out: a string, or #f.
the domain to set.
Sets the mount operation to use a hidden volume if hidden-volume
is #t.
Passed: a <GMountOperation>.
Passed: a boolean.
boolean value.
Sets the mount operation to use a system volume if system-volume
is #t.
Passed: a <GMountOperation>.
Passed: a boolean.
boolean value.
Sets the mount operation’s password to password.
Passed: a <GMountOperation>.
Passed, or left out: a string, or #f.
password to set.
Sets the state of saving passwords for the mount operation.
Passed: a <GMountOperation>.
Passed: a <GPasswordSave>, or one of its
symbols.
a set of <GPasswordSave> flags.
Sets the mount operation’s PIM to pim.
Passed: a <GMountOperation>.
Passed: an unsigned 32-bit integer.
an unsigned integer.
Sets the user name within self to username.
Passed: a <GMountOperation>.
Passed, or left out: a string, or #f.
input username.
Connect a handler with (connect object mount-operation:aborted
handler). It is called as (handler self).
Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress.
Implementations of GMountOperation should handle this signal by dismissing open password dialogs.
Passed: a <GMountOperation>.
Connect a handler with (connect object
mount-operation:ask-password handler). It is called as (handler
self message default-user default-domain flags).
Emitted when a mount operation asks the user for a password.
If the message contains a line break, the first line should be presented
as a heading. For example, it may be used as the primary text in a
GtkMessageDialog.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user.
Passed: a string.
string containing the default user name.
Passed: a string.
string containing the default domain.
Passed: a <GAskPasswordFlags>.
a set of <GAskPasswordFlags>.
Connect a handler with (connect object
mount-operation:ask-question handler). It is called as (handler
self message choices).
Emitted when asking the user a question and gives a list of choices for the user to choose from.
If the message contains a line break, the first line should be presented
as a heading. For example, it may be used as the primary text in a
GtkMessageDialog.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user.
Passed: a vector, each a string.
an array of strings for each possible choice.
Connect a handler with (connect object mount-operation:reply
handler). It is called as (handler self result).
Emitted when the user has replied to the mount operation.
Passed: a <GMountOperation>.
Passed: a <GMountOperationResult>.
a <GMountOperationResult> indicating
how the request was handled
Connect a handler with (connect object
mount-operation:show-processes handler). It is called as
(handler self message processes choices).
Emitted when one or more processes are blocking an operation e.g.
unmounting/ejecting a <GMount> or stopping a
<GDrive>.
Note that this signal may be emitted several times to update the list of
blocking processes as processes close files. The application should
only respond with mount-operation:reply to the latest signal (setting
mount-operation:choice to
the choice the user made).
If the message contains a line break, the first line should be presented
as a heading. For example, it may be used as the primary text in a
GtkMessageDialog.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user.
Passed: a s32vector.
an array of GPid for processes blocking the operation.
Passed: a vector, each a string.
an array of strings for each possible choice.
Connect a handler with (connect object
mount-operation:show-unmount-progress handler). It is called as
(handler self message time-left bytes-left).
Emitted when an unmount operation has been busy for more than some time (typically 1.5 seconds).
When unmounting or ejecting a volume, the kernel might need to flush pending data in its buffers to the volume stable storage, and this operation can take a considerable amount of time. This signal may be emitted several times as long as the unmount operation is outstanding, and then one last time when the operation is completed, with bytes-left set to zero.
Implementations of GMountOperation should handle this signal by showing an UI notification, and then dismiss it, or show another notification of completion, when bytes-left reaches zero.
If the message contains a line break, the first line should be presented
as a heading. For example, it may be used as the primary text in a
GtkMessageDialog.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user
Passed: a 64-bit integer.
the estimated time left before the operation completes, in microseconds, or -1
Passed: a 64-bit integer.
the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed
To override it in a new class, give register-type #:vfuncs
`((aborted . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
To override it in a new class, give register-type #:vfuncs
`((ask-password . ,procedure)). The procedure is called as
(procedure self message default-user default-domain flags).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
Passed: a string.
Passed: a string.
Passed: a string.
Passed: a <GAskPasswordFlags>, or a list
of its symbols, or one of them.
Virtual implementation of mount-operation:ask-question.
To override it in a new class, give register-type #:vfuncs
`((ask-question . ,procedure)). The procedure is called as
(procedure self message choices).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user
Passed: a list or vector, each a string.
an array of strings for each possible choice
Emits the mount-operation:reply signal.
To override it in a new class, give register-type #:vfuncs
`((reply . ,procedure)). The procedure is called as (procedure
self result).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
Passed: a <GMountOperationResult>, or
one of its symbols.
Virtual implementation of mount-operation:show-processes.
To override it in a new class, give register-type #:vfuncs
`((show-processes . ,procedure)). The procedure is called as
(procedure self message processes choices).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
Passed: a string.
string containing a message to display to the user
Passed: a s32vector, or a list or vector, each a 32-bit integer.
an array of GPid for processes blocking the operation
Passed: a list or vector, each a string.
an array of strings for each possible choice
To override it in a new class, give register-type #:vfuncs
`((show-unmount-progress . ,procedure)). The procedure is called as
(procedure self message time-left bytes-left).
Passed: the class whose implementation to call:
<GMountOperation>, or a class that derives
from it, or its GType number.
Passed: a <GMountOperation>.
Passed: a string.
Passed: a 64-bit integer.
Passed: a 64-bit integer.