Skip to content

Gtk.MountOperation

class — extends Gio.MountOperation

Asks the user for passwords and other information required to mount a volume.

GtkMountOperation is needed when mounting volumes: It is an implementation of GMountOperation that can be used with GIO functions for mounting volumes such as Gio.File.mount_enclosing_volume, Gio.File.mount_mountable, Gio.Volume.mount, Gio.Mount.unmount_with_operation and others.

When necessary, GtkMountOperation shows dialogs to let the user enter passwords, ask questions or show processes blocking unmount.

Constructors

new

@classmethod
def new(cls, parent: Window | None = ...) -> Gio.MountOperation

Creates a new GtkMountOperation.

Parameters:

  • parent — transient parent of the window

Methods

get_display

def get_display(self) -> Gdk.Display

Gets the display on which windows of the GtkMountOperation will be shown.

get_parent

def get_parent(self) -> Window | None

Gets the transient parent used by the GtkMountOperation.

is_showing

def is_showing(self) -> bool

Returns whether the GtkMountOperation is currently displaying a window.

set_display

def set_display(self, display: Gdk.Display) -> None

Sets the display to show windows of the GtkMountOperation on.

Parameters:

  • display — a GdkDisplay

set_parent

def set_parent(self, parent: Window | None = ...) -> None

Sets the transient parent for windows shown by the GtkMountOperation.

Parameters:

  • parent — transient parent of the window

Properties

display

display: Gdk.Display  # read/write

The display where dialogs will be shown.

is_showing

is_showing: bool  # read-only

Whether a dialog is currently shown.

parent

parent: Window  # read/write

The parent window.