:right-sidebar: True MountOperation =================================================================== .. currentmodule:: gi.repository.Gio .. class:: MountOperation(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` ``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 :obj:`~gi.repository.Gio.Mount` objects – for example it is also used in :obj:`~gi.repository.Gio.Drive.start` and :obj:`~gi.repository.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 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. Constructors ------------ .. rst-class:: interim-class .. class:: MountOperation :no-index: .. classmethod:: new() -> ~gi.repository.Gio.MountOperation Creates a new mount operation. Methods ------- .. rst-class:: interim-class .. class:: MountOperation :no-index: .. method:: do_aborted(self) -> None .. method:: do_ask_password(self, message: str, default_user: str, default_domain: str, flags: ~gi.repository.Gio.AskPasswordFlags) -> None :param message: :param default_user: :param default_domain: :param flags: .. method:: do_ask_question(self, message: str, choices: list[str]) -> None :param message: :param choices: .. method:: do_reply(self, result: ~gi.repository.Gio.MountOperationResult) -> None :param result: .. method:: do_show_processes(self, message: str, processes: list[int], choices: list[str]) -> None :param message: :param processes: :param choices: .. method:: do_show_unmount_progress(self, message: str, time_left: int, bytes_left: int) -> None :param message: :param time_left: :param bytes_left: .. method:: get_anonymous() -> bool Check to see whether the mount operation is being used for an anonymous user. .. method:: get_choice() -> int Gets a choice from the mount operation. .. method:: get_domain() -> str | None Gets the domain of the mount operation. .. method:: get_is_tcrypt_hidden_volume() -> bool Check to see whether the mount operation is being used for a TCRYPT hidden volume. .. versionadded:: 2.58 .. method:: get_is_tcrypt_system_volume() -> bool Check to see whether the mount operation is being used for a TCRYPT system volume. .. versionadded:: 2.58 .. method:: get_password() -> str | None Gets a password from the mount operation. .. method:: get_password_save() -> ~gi.repository.Gio.PasswordSave Gets the state of saving passwords for the mount operation. .. method:: get_pim() -> int Gets a PIM from the mount operation. .. versionadded:: 2.58 .. method:: get_username() -> str | None Get the user name from the mount operation. .. method:: reply(result: ~gi.repository.Gio.MountOperationResult) -> None Emits the :obj:`~gi.repository.Gio.MountOperation`\::reply signal. :param result: a :obj:`~gi.repository.Gio.MountOperationResult` .. method:: set_anonymous(anonymous: bool) -> None Sets the mount operation to use an anonymous user if ``anonymous`` is :const:`True`. :param anonymous: boolean value. .. method:: set_choice(choice: int) -> None Sets a default choice for the mount operation. :param choice: an integer. .. method:: set_domain(domain: str | None = None) -> None Sets the mount operation's domain. :param domain: the domain to set. .. method:: set_is_tcrypt_hidden_volume(hidden_volume: bool) -> None Sets the mount operation to use a hidden volume if ``hidden_volume`` is :const:`True`. .. versionadded:: 2.58 :param hidden_volume: boolean value. .. method:: set_is_tcrypt_system_volume(system_volume: bool) -> None Sets the mount operation to use a system volume if ``system_volume`` is :const:`True`. .. versionadded:: 2.58 :param system_volume: boolean value. .. method:: set_password(password: str | None = None) -> None Sets the mount operation's password to ``password``\. :param password: password to set. .. method:: set_password_save(save: ~gi.repository.Gio.PasswordSave) -> None Sets the state of saving passwords for the mount operation. :param save: a set of :obj:`~gi.repository.Gio.PasswordSave` flags. .. method:: set_pim(pim: int) -> None Sets the mount operation's PIM to ``pim``\. .. versionadded:: 2.58 :param pim: an unsigned integer. .. method:: set_username(username: str | None = None) -> None Sets the user name within ``op`` to ``username``\. :param username: input username. Properties ---------- .. rst-class:: interim-class .. class:: MountOperation :no-index: .. attribute:: props.anonymous :type: bool The type of the None singleton. .. attribute:: props.choice :type: int The type of the None singleton. .. attribute:: props.domain :type: str The type of the None singleton. .. attribute:: props.is_tcrypt_hidden_volume :type: bool The type of the None singleton. .. versionadded:: 2.58 .. attribute:: props.is_tcrypt_system_volume :type: bool The type of the None singleton. .. versionadded:: 2.58 .. attribute:: props.password :type: str The type of the None singleton. .. attribute:: props.password_save :type: ~gi.repository.Gio.PasswordSave The type of the None singleton. .. attribute:: props.pim :type: int The type of the None singleton. .. versionadded:: 2.58 .. attribute:: props.username :type: str The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: MountOperation.signals :no-index: .. method:: aborted() -> None The type of the None singleton. .. versionadded:: 2.20 .. method:: ask_password(message: str, default_user: str, default_domain: str, flags: ~gi.repository.Gio.AskPasswordFlags) -> None The type of the None singleton. :param message: string containing a message to display to the user. :param default_user: string containing the default user name. :param default_domain: string containing the default domain. :param flags: a set of :obj:`~gi.repository.Gio.AskPasswordFlags`\. .. method:: ask_question(message: str, choices: list[str]) -> None The type of the None singleton. :param message: string containing a message to display to the user. :param choices: an array of strings for each possible choice. .. method:: reply(result: ~gi.repository.Gio.MountOperationResult) -> None Emitted when the user has replied to the mount operation. :param result: a :obj:`~gi.repository.Gio.MountOperationResult` indicating how the request was handled .. method:: show_processes(message: str, processes: list[int], choices: list[str]) -> None The type of the None singleton. .. versionadded:: 2.22 :param message: string containing a message to display to the user. :param processes: an array of :obj:`~gi.repository.GLib.Pid` for processes blocking the operation. :param choices: an array of strings for each possible choice. .. method:: show_unmount_progress(message: str, time_left: int, bytes_left: int) -> None The type of the None singleton. .. versionadded:: 2.34 :param message: string containing a message to display to the user :param time_left: the estimated time left before the operation completes, in microseconds, or -1 :param 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 --------------- .. rst-class:: interim-class .. class:: MountOperation :no-index: .. method:: do_aborted() -> None The type of the None singleton. .. method:: do_ask_password(message: str, default_user: str, default_domain: str, flags: ~gi.repository.Gio.AskPasswordFlags) -> None The type of the None singleton. :param message: :param default_user: :param default_domain: :param flags: .. method:: do_ask_question(message: str, choices: list[str]) -> None The type of the None singleton. :param message: string containing a message to display to the user :param choices: an array of strings for each possible choice .. method:: do_reply(result: ~gi.repository.Gio.MountOperationResult) -> None Emits the :obj:`~gi.repository.Gio.MountOperation`\::reply signal. :param result: a :obj:`~gi.repository.Gio.MountOperationResult` .. method:: do_show_processes(message: str, processes: list[int], choices: list[str]) -> None The type of the None singleton. .. versionadded:: 2.22 :param message: string containing a message to display to the user :param processes: an array of :obj:`~gi.repository.GLib.Pid` for processes blocking the operation :param choices: an array of strings for each possible choice .. method:: do_show_unmount_progress(message: str, time_left: int, bytes_left: int) -> None The type of the None singleton. :param message: :param time_left: :param bytes_left: Fields ------ .. rst-class:: interim-class .. class:: MountOperation :no-index: .. attribute:: parent_instance .. attribute:: priv