MountOperation
Superclasses: Object
- Constructors:
MountOperation(**properties)
new() -> Gio.MountOperation
Constructors
- class MountOperation
- classmethod new() MountOperation
Creates a new mount operation.
Methods
- class MountOperation
- get_anonymous() bool
Check to see whether the mount operation is being used for an anonymous user.
Check to see whether the mount operation is being used for a TCRYPT hidden volume.
Added in version 2.58.
- get_is_tcrypt_system_volume() bool
Check to see whether the mount operation is being used for a TCRYPT system volume.
Added in version 2.58.
- get_password_save() PasswordSave
Gets the state of saving passwords for the mount operation.
- reply(result: MountOperationResult) None
Emits the
MountOperation
::reply signal.- Parameters:
result – a
MountOperationResult
- set_anonymous(anonymous: bool) None
Sets the mount operation to use an anonymous user if
anonymous
isTrue
.- Parameters:
anonymous – boolean value.
- set_choice(choice: int) None
Sets a default choice for the mount operation.
- Parameters:
choice – an integer.
- set_domain(domain: str | None = None) None
Sets the mount operation’s domain.
- Parameters:
domain – the domain to set.
Sets the mount operation to use a hidden volume if
hidden_volume
isTrue
.Added in version 2.58.
- Parameters:
hidden_volume – boolean value.
- set_is_tcrypt_system_volume(system_volume: bool) None
Sets the mount operation to use a system volume if
system_volume
isTrue
.Added in version 2.58.
- Parameters:
system_volume – boolean value.
- set_password(password: str | None = None) None
Sets the mount operation’s password to
password
.- Parameters:
password – password to set.
- set_password_save(save: PasswordSave) None
Sets the state of saving passwords for the mount operation.
- Parameters:
save – a set of
PasswordSave
flags.
Properties
- class MountOperation
-
- props.choice: int
The index of the user’s choice when a question is asked during the mount operation. See the
MountOperation
::ask-question signal.
Whether the device to be unlocked is a TCRYPT hidden volume. See
the VeraCrypt documentation <https://www.veracrypt.fr/en/Hidden``%20Volume`
.html>`_.Added in version 2.58.
- props.is_tcrypt_system_volume: bool
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 <https://www.veracrypt.fr/en/System``%20Encryption`
.html>`_.Added in version 2.58.
- props.password: str
The password that is used for authentication when carrying out the mount operation.
- props.password_save: PasswordSave
Determines if and how the password information should be saved.
- props.pim: int
The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See the VeraCrypt documentation.html).
Added in version 2.58.
Signals
- class MountOperation.signals
- aborted() None
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.
Added in version 2.20.
- ask_password(message: str, default_user: str, default_domain: str, flags: AskPasswordFlags) None
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
.- Parameters:
message – string containing a message to display to the user.
default_user – string containing the default user name.
default_domain – string containing the default domain.
flags – a set of
AskPasswordFlags
.
- ask_question(message: str, choices: Sequence[str]) None
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
.- Parameters:
message – string containing a message to display to the user.
choices – an array of strings for each possible choice.
- reply(result: MountOperationResult) None
Emitted when the user has replied to the mount operation.
- Parameters:
result – a
MountOperationResult
indicating how the request was handled
- show_processes(message: str, processes: Sequence[int], choices: Sequence[str]) None
Emitted when one or more processes are blocking an operation e.g. unmounting/ejecting a
Mount
or stopping aDrive
.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
reply()
to the latest signal (settingMountOperation
: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
.Added in version 2.22.
- Parameters:
message – string containing a message to display to the user.
processes – an array of
Pid
for processes blocking the operation.choices – an array of strings for each possible choice.
- show_unmount_progress(message: str, time_left: int, bytes_left: int) None
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
.Added in version 2.34.
- Parameters:
message – string containing a message to display to the user
time_left – the estimated time left before the operation completes, in microseconds, or -1
bytes_left – 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
- class MountOperation
-
- do_ask_password(message: str, default_user: str, default_domain: str, flags: AskPasswordFlags) None
- Parameters:
message
default_user
default_domain
flags
- do_ask_question(message: str, choices: Sequence[str]) None
Virtual implementation of
MountOperation
::ask-question.- Parameters:
message – string containing a message to display to the user
choices – an array of strings for each possible choice
- do_reply(result: MountOperationResult) None
Emits the
MountOperation
::reply signal.- Parameters:
result – a
MountOperationResult
- do_show_processes(message: str, processes: Sequence[int], choices: Sequence[str]) None
Virtual implementation of
MountOperation
::show-processes.Added in version 2.22.
- Parameters:
message – string containing a message to display to the user
processes – an array of
Pid
for processes blocking the operationchoices – an array of strings for each possible choice