gio.mount_operation
Module for [MountOperation] class
Types 3
[gio.mount_operation.MountOperation] 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 [gio.mount_operation.MountOperation] is used for more than just [gio.mount.Mount] objects – for example it is also used in [gio.drive.Drive.start] and [gio.drive.Drive.stop].
Users should instantiate a subclass of this that implements all the various callbacks to show the required dialogs, such as [[gtk.mount_operation.MountOperation]](https://docs.gtk.org/gtk4/class.MountOperation.html). If no user interaction is desired (for example when automounting filesystems at login time), usually NULL can be passed, see each method taking a [gio.mount_operation.MountOperation] for details.
Throughout the API, the term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’.
TrueCrypt is a discontinued system forencrypting file containers, partitions or whole disks, typically used with Windows.
VeraCrypt is a maintained fork of TrueCrypt with variousimprovements and auditing fixes.
MountOperation self()Returns `this`, for use in `with` statements.MountOperationGidBuilder builder()Get builder for [gio.mount_operation.MountOperation] Returns: New builder objectbool anonymous() @propertyGet `anonymous` property. Returns: Whether to use an anonymous user when authenticating.void anonymous(bool propval) @propertySet `anonymous` property. Params: propval = Whether to use an anonymous user when authenticating.int choice() @propertyGet `choice` property. Returns: The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal.void choice(int propval) @propertySet `choice` property. Params: propval = The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal.void domain(string propval) @propertySet `domain` property. Params: propval = The domain to use for the mount operation.bool isTcryptHiddenVolume() @propertyGet `isTcryptHiddenVolume` property. Returns: Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.html).void isTcryptHiddenVolume(bool propval) @propertySet `isTcryptHiddenVolume` property. Params: propval = Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.ht...bool isTcryptSystemVolume() @propertyGet `isTcryptSystemVolume` property. Returns: 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 instal...void isTcryptSystemVolume(bool propval) @propertySet `isTcryptSystemVolume` property. Params: propval = 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 syst...string password() @propertyGet `password` property. Returns: The password that is used for authentication when carrying out the mount operation.void password(string propval) @propertySet `password` property. Params: propval = The password that is used for authentication when carrying out the mount operation.gio.types.PasswordSave passwordSave() @propertyGet `passwordSave` property. Returns: Determines if and how the password information should be saved.void passwordSave(gio.types.PasswordSave propval) @propertySet `passwordSave` property. Params: propval = Determines if and how the password information should be saved.uint pim() @propertyGet `pim` property. Returns: The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``20`(PIM)....void pim(uint propval) @propertySet `pim` property. Params: propval = The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``...string username() @propertyGet `username` property. Returns: The user name that is used for authentication when carrying out the mount operation.void username(string propval) @propertySet `username` property. Params: propval = The user name that is used for authentication when carrying out the mount operation.bool getAnonymous()Check to see whether the mount operation is being used for an anonymous user. Returns: true if mount operation is anonymous.int getChoice()Gets a choice from the mount operation. Returns: an integer containing an index of the user's choice from the choice's list, or `0`.string getDomain()Gets the domain of the mount operation. Returns: a string set to the domain.bool getIsTcryptHiddenVolume()Check to see whether the mount operation is being used for a TCRYPT hidden volume. Returns: true if mount operation is for hidden volume.bool getIsTcryptSystemVolume()Check to see whether the mount operation is being used for a TCRYPT system volume. Returns: true if mount operation is for system volume.string getPassword()Gets a password from the mount operation. Returns: a string containing the password within op.gio.types.PasswordSave getPasswordSave()Gets the state of saving passwords for the mount operation. Returns: a #GPasswordSave flag.uint getPim()Gets a PIM from the mount operation. Returns: The VeraCrypt PIM within op.string getUsername()Get the user name from the mount operation. Returns: a string containing the user name.void reply(gio.types.MountOperationResult result)Emits the #GMountOperation::reply signal.void setAnonymous(bool anonymous)Sets the mount operation to use an anonymous user if anonymous is true.void setChoice(int choice)Sets a default choice for the mount operation.void setDomain(string domain = null)Sets the mount operation's domain.void setIsTcryptHiddenVolume(bool hiddenVolume)Sets the mount operation to use a hidden volume if hidden_volume is true.void setIsTcryptSystemVolume(bool systemVolume)Sets the mount operation to use a system volume if system_volume is true.void setPassword(string password = null)Sets the mount operation's password to password.void setPasswordSave(gio.types.PasswordSave save)Sets the state of saving passwords for the mount operation.void setPim(uint pim)Sets the mount operation's PIM to pim.void setUsername(string username = null)Sets the user name within op to username.gulong connectAborted(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 2)Connect to `Aborted` signal.gulong connectAskPassword(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == string)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == string)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == gio.types.AskPasswordFlags)))
&& (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 6)Connect to `AskPassword` signal.gulong connectAskQuestion(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == string[])))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 4)Connect to `AskQuestion` signal.gulong connectReply(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gio.types.MountOperationResult)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 3)Connect to `Reply` signal.gulong connectShowProcesses(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == glib.types.Pid[])))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == string[])))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 5)Connect to `ShowProcesses` signal.gulong connectShowUnmountProgress(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == long)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == long)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gio.mount_operation.MountOperation)))
&& Parameters!T.length < 5)Connect to `ShowUnmountProgress` signal.T anonymous(bool propval)Set `anonymous` property. Params: propval = Whether to use an anonymous user when authenticating. Returns: Builder instance for fluent chainingT choice(int propval)Set `choice` property. Params: propval = The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal. Returns: Builder instance...T domain(string propval)Set `domain` property. Params: propval = The domain to use for the mount operation. Returns: Builder instance for fluent chainingT isTcryptHiddenVolume(bool propval)Set `isTcryptHiddenVolume` property. Params: propval = Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.ht...T isTcryptSystemVolume(bool propval)Set `isTcryptSystemVolume` property. Params: propval = 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 syst...T password(string propval)Set `password` property. Params: propval = The password that is used for authentication when carrying out the mount operation. Returns: Builder instance for fluent chainingT passwordSave(gio.types.PasswordSave propval)Set `passwordSave` property. Params: propval = Determines if and how the password information should be saved. Returns: Builder instance for fluent chainingT pim(uint propval)Set `pim` property. Params: propval = The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``...T username(string propval)Set `username` property. Params: propval = The user name that is used for authentication when carrying out the mount operation. Returns: Builder instance for fluent chainingFluent builder for [gio.mount_operation.MountOperation]