1.57 <GMountOperation>

Class: <GMountOperation>

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.

Fields

parent-instance
priv

Properties

Property: mount-operation:anonymous self

Whether to use an anonymous user when authenticating.

Its value is a boolean.

Set it with (set! (mount-operation:anonymous self) value).

Property: mount-operation:choice self

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).

Property: mount-operation:domain self

The domain to use for the mount operation.

Its value is a string, or #f.

Set it with (set! (mount-operation:domain self) value).

Property: mount-operation:is-tcrypt-hidden-volume self

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).

Property: mount-operation:is-tcrypt-system-volume self

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).

Property: mount-operation:password self

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).

Property: mount-operation:password-save self

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).

Property: mount-operation:pim self

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).

Property: mount-operation:username self

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).

Procedures

Method: mount-operation:get-anonymous? self ⇒ %return
Method: get-anonymous? self ⇒ %return

Check to see whether the mount operation is being used for an anonymous user.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a boolean.

#t if mount operation is anonymous.

Method: mount-operation:get-choice self ⇒ %return
Method: get-choice self ⇒ %return

Gets a choice from the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a 32-bit integer.

an integer containing an index of the user’s choice from the choice’s list, or 0.

Method: mount-operation:get-domain self ⇒ %return
Method: get-domain self ⇒ %return

Gets the domain of the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a string, or #f.

a string set to the domain.

Method: mount-operation:get-is-tcrypt-hidden-volume? self ⇒ %return
Method: get-is-tcrypt-hidden-volume? self ⇒ %return

Check to see whether the mount operation is being used for a TCRYPT hidden volume.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a boolean.

#t if mount operation is for hidden volume.

Method: mount-operation:get-is-tcrypt-system-volume? self ⇒ %return
Method: get-is-tcrypt-system-volume? self ⇒ %return

Check to see whether the mount operation is being used for a TCRYPT system volume.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a boolean.

#t if mount operation is for system volume.

Method: mount-operation:get-password self ⇒ %return
Method: get-password self ⇒ %return

Gets a password from the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a string, or #f.

a string containing the password within self.

Method: mount-operation:get-password-save self ⇒ %return
Method: get-password-save self ⇒ %return

Gets the state of saving passwords for the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a <GPasswordSave>.

a <GPasswordSave> flag.

Method: mount-operation:get-pim self ⇒ %return
Method: get-pim self ⇒ %return

Gets a PIM from the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: an unsigned 32-bit integer.

The VeraCrypt PIM within self.

Method: mount-operation:get-username self ⇒ %return
Method: get-username self ⇒ %return

Get the user name from the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

%return

Returned: a string, or #f.

a string containing the user name.

Procedure: mount-operation:new ⇒ %return

Creates a new mount operation.

%return

Returned: a <GMountOperation>.

a <GMountOperation>.

Method: mount-operation:reply self result
Method: reply self result

Emits the mount-operation:reply signal.

self

Passed: a <GMountOperation>.

a <GMountOperation>

result

Passed: a <GMountOperationResult>, or one of its symbols.

a <GMountOperationResult>

Method: mount-operation:set-anonymous self anonymous
Method: set-anonymous self anonymous

Sets the mount operation to use an anonymous user if anonymous is #t.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

anonymous

Passed: a boolean.

boolean value.

Method: mount-operation:set-choice self choice
Method: set-choice self choice

Sets a default choice for the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

choice

Passed: a 32-bit integer.

an integer.

Method: mount-operation:set-domain self [domain]
Method: set-domain self [domain]

Sets the mount operation’s domain.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

domain

Passed, or left out: a string, or #f.

the domain to set.

Method: mount-operation:set-is-tcrypt-hidden-volume self hidden-volume
Method: set-is-tcrypt-hidden-volume self hidden-volume

Sets the mount operation to use a hidden volume if hidden-volume is #t.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

hidden-volume

Passed: a boolean.

boolean value.

Method: mount-operation:set-is-tcrypt-system-volume self system-volume
Method: set-is-tcrypt-system-volume self system-volume

Sets the mount operation to use a system volume if system-volume is #t.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

system-volume

Passed: a boolean.

boolean value.

Method: mount-operation:set-password self [password]
Method: set-password self [password]

Sets the mount operation’s password to password.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

password

Passed, or left out: a string, or #f.

password to set.

Method: mount-operation:set-password-save self save
Method: set-password-save self save

Sets the state of saving passwords for the mount operation.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

save

Passed: a <GPasswordSave>, or one of its symbols.

a set of <GPasswordSave> flags.

Method: mount-operation:set-pim self pim
Method: set-pim self pim

Sets the mount operation’s PIM to pim.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

pim

Passed: an unsigned 32-bit integer.

an unsigned integer.

Method: mount-operation:set-username self [username]
Method: set-username self [username]

Sets the user name within self to username.

self

Passed: a <GMountOperation>.

a <GMountOperation>.

username

Passed, or left out: a string, or #f.

input username.

Signals

Signal: mount-operation:aborted

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.

self

Passed: a <GMountOperation>.

Signal: mount-operation:ask-password

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.

self

Passed: a <GMountOperation>.

message

Passed: a string.

string containing a message to display to the user.

default-user

Passed: a string.

string containing the default user name.

default-domain

Passed: a string.

string containing the default domain.

flags

Passed: a <GAskPasswordFlags>.

a set of <GAskPasswordFlags>.

Signal: mount-operation:ask-question

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.

self

Passed: a <GMountOperation>.

message

Passed: a string.

string containing a message to display to the user.

choices

Passed: a vector, each a string.

an array of strings for each possible choice.

Signal: mount-operation:reply

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.

self

Passed: a <GMountOperation>.

result

Passed: a <GMountOperationResult>.

a <GMountOperationResult> indicating how the request was handled

Signal: mount-operation:show-processes

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.

self

Passed: a <GMountOperation>.

message

Passed: a string.

string containing a message to display to the user.

processes

Passed: a s32vector.

an array of GPid for processes blocking the operation.

choices

Passed: a vector, each a string.

an array of strings for each possible choice.

Signal: mount-operation:show-unmount-progress

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.

self

Passed: a <GMountOperation>.

message

Passed: a string.

string containing a message to display to the user

time-left

Passed: a 64-bit integer.

the estimated time left before the operation completes, in microseconds, or -1

bytes-left

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

Virtual methods

Virtual method: mount-operation:do-aborted implementor self

To override it in a new class, give register-type #:vfuncs `((aborted . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

Virtual method: mount-operation:do-ask-password implementor self message default-user default-domain flags

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).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

message

Passed: a string.

default-user

Passed: a string.

default-domain

Passed: a string.

flags

Passed: a <GAskPasswordFlags>, or a list of its symbols, or one of them.

Virtual method: mount-operation:do-ask-question implementor self message choices

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).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

a <GMountOperation>

message

Passed: a string.

string containing a message to display to the user

choices

Passed: a list or vector, each a string.

an array of strings for each possible choice

Virtual method: mount-operation:do-reply implementor self result

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).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

a <GMountOperation>

result

Passed: a <GMountOperationResult>, or one of its symbols.

a <GMountOperationResult>

Virtual method: mount-operation:do-show-processes implementor self message processes choices

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).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

a <GMountOperation>

message

Passed: a string.

string containing a message to display to the user

processes

Passed: a s32vector, or a list or vector, each a 32-bit integer.

an array of GPid for processes blocking the operation

choices

Passed: a list or vector, each a string.

an array of strings for each possible choice

Virtual method: mount-operation:do-show-unmount-progress implementor self message time-left bytes-left

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).

implementor

Passed: the class whose implementation to call: <GMountOperation>, or a class that derives from it, or its GType number.

self

Passed: a <GMountOperation>.

message

Passed: a string.

time-left

Passed: a 64-bit integer.

bytes-left

Passed: a 64-bit integer.