Gio.MountOperation¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted by the backend when e.g. |
|
Emitted when a mount operation asks the user for a password. |
|
Emitted when asking the user a question and gives a list of choices for the user to choose from. |
|
Emitted when the user has replied to the mount operation. |
|
Emitted when one or more processes are blocking an operation e.g. |
|
Emitted when an unmount operation has been busy for more than some time (typically 1.5 seconds). |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.MountOperation(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 [iface`Gio`.Mount] objects – for example it is also used in [method`Gio`.Drive.start] and [method`Gio`.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 aGMountOperation
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.
- get_anonymous()[source]¶
-
Check to see whether the mount operation is being used for an anonymous user.
- get_choice()[source]¶
- Returns:
an integer containing an index of the user’s choice from the choice’s list, or
0
.- Return type:
Gets a choice from the mount operation.
-
Check to see whether the mount operation is being used for a TCRYPT hidden volume.
New in version 2.58.
- get_is_tcrypt_system_volume()[source]¶
-
Check to see whether the mount operation is being used for a TCRYPT system volume.
New in version 2.58.
- get_password_save()[source]¶
- Returns:
a
Gio.PasswordSave
flag.- Return type:
Gets the state of saving passwords for the mount operation.
- get_pim()[source]¶
- Returns:
The VeraCrypt PIM within self.
- Return type:
Gets a PIM from the mount operation.
New in version 2.58.
- reply(result)[source]¶
- Parameters:
result (
Gio.MountOperationResult
) – aGio.MountOperationResult
Emits the
Gio.MountOperation
::reply
signal.
- set_anonymous(anonymous)[source]¶
- Parameters:
anonymous (
bool
) – boolean value.
Sets the mount operation to use an anonymous user if anonymous is
True
.
- set_choice(choice)[source]¶
- Parameters:
choice (
int
) – an integer.
Sets a default choice for the mount operation.
- Parameters:
hidden_volume (
bool
) – boolean value.
Sets the mount operation to use a hidden volume if hidden_volume is
True
.New in version 2.58.
- set_is_tcrypt_system_volume(system_volume)[source]¶
- Parameters:
system_volume (
bool
) – boolean value.
Sets the mount operation to use a system volume if system_volume is
True
.New in version 2.58.
- set_password_save(save)[source]¶
- Parameters:
save (
Gio.PasswordSave
) – a set ofGio.PasswordSave
flags.
Sets the state of saving passwords for the mount operation.
- set_pim(pim)[source]¶
- Parameters:
pim (
int
) – an unsigned integer.
Sets the mount operation’s PIM to pim.
New in version 2.58.
- do_aborted() virtual¶
- do_ask_password(message, default_user, default_domain, flags) virtual¶
- Parameters:
message (
str
) –default_user (
str
) –default_domain (
str
) –flags (
Gio.AskPasswordFlags
) –
- do_ask_question(message, choices) virtual¶
- Parameters:
Virtual implementation of
Gio.MountOperation
::ask-question
.
- do_reply(result) virtual¶
- Parameters:
result (
Gio.MountOperationResult
) – aGio.MountOperationResult
Emits the
Gio.MountOperation
::reply
signal.
- do_show_processes(message, processes, choices) virtual¶
- Parameters:
Virtual implementation of
Gio.MountOperation
::show-processes
.New in version 2.22.
Signal Details¶
- Gio.MountOperation.signals.aborted(mount_operation)¶
- Signal Name:
aborted
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signal
Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress.
Implementations of
Gio.MountOperation
should handle this signal by dismissing open password dialogs.New in version 2.20.
- Gio.MountOperation.signals.ask_password(mount_operation, message, default_user, default_domain, flags)¶
- Signal Name:
ask-password
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signalmessage (
str
) – string containing a message to display to the user.default_user (
str
) – string containing the default user name.default_domain (
str
) – string containing the default domain.flags (
Gio.AskPasswordFlags
) – a set ofGio.AskPasswordFlags
.
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.
- Gio.MountOperation.signals.ask_question(mount_operation, message, choices)¶
- Signal Name:
ask-question
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signalmessage (
str
) – string containing a message to display to the user.choices ([
str
]) – an array of strings for each possible choice.
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.
- Gio.MountOperation.signals.reply(mount_operation, result)¶
- Signal Name:
reply
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signalresult (
Gio.MountOperationResult
) – aGio.MountOperationResult
indicating how the request was handled
Emitted when the user has replied to the mount operation.
- Gio.MountOperation.signals.show_processes(mount_operation, message, processes, choices)¶
- Signal Name:
show-processes
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signalmessage (
str
) – string containing a message to display to the user.processes ([
int
]) – an array of #GPid for processes blocking the operation.choices ([
str
]) – an array of strings for each possible choice.
Emitted when one or more processes are blocking an operation e.g. unmounting/ejecting a
Gio.Mount
or stopping aGio.Drive
.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
Gio.MountOperation.reply
() to the latest signal (settingGio.MountOperation
: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.
New in version 2.22.
- Gio.MountOperation.signals.show_unmount_progress(mount_operation, message, time_left, bytes_left)¶
- Signal Name:
show-unmount-progress
- Flags:
- Parameters:
mount_operation (
Gio.MountOperation
) – The object which received the signalmessage (
str
) – string containing a message to display to the usertime_left (
int
) – the estimated time left before the operation completes, in microseconds, or -1bytes_left (
int
) – 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
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
Gio.MountOperation
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.
New in version 2.34.
Property Details¶
- Gio.MountOperation.props.anonymous¶
-
Whether to use an anonymous user when authenticating.
- Gio.MountOperation.props.choice¶
-
The index of the user’s choice when a question is asked during the mount operation. See the
Gio.MountOperation
::ask-question
signal.
- Gio.MountOperation.props.domain¶
-
The domain to use for the mount operation.
-
Whether the device to be unlocked is a TCRYPT hidden volume. See the VeraCrypt documentation.
New in version 2.58.
- Gio.MountOperation.props.is_tcrypt_system_volume¶
-
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.
New in version 2.58.
- Gio.MountOperation.props.password¶
-
The password that is used for authentication when carrying out the mount operation.
- Gio.MountOperation.props.password_save¶
- Name:
password-save
- Type:
- Default Value:
- Flags:
Determines if and how the password information should be saved.
- Gio.MountOperation.props.pim¶
-
The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See the VeraCrypt documentation.html).
New in version 2.58.