Secret.Prompt

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.DBusInterface Gio.DBusInterface GObject.GInterface->Gio.DBusInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Gio.DBusProxy Gio.DBusProxy GObject.Object->Gio.DBusProxy Gio.AsyncInitable->Gio.DBusProxy Gio.DBusInterface->Gio.DBusProxy Secret.Prompt Secret.Prompt Gio.DBusProxy->Secret.Prompt Gio.Initable->Gio.DBusProxy

Subclasses:

None

Methods

Inherited:

Gio.DBusProxy (25), GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusInterface (3), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

perform (window_id, return_type, cancellable, callback, *user_data)

perform_finish (result)

perform_sync (window_id, cancellable, return_type)

run (window_id, cancellable, return_type)

Virtual Methods

Inherited:

Gio.DBusProxy (2), GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusInterface (3), Gio.Initable (1)

Properties

Inherited:

Gio.DBusProxy (9)

Signals

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Fields

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gio.DBusProxy

r

Class Details

class Secret.Prompt(**kwargs)
Bases:

Gio.DBusProxy

Abstract:

No

Structure:

Secret.PromptClass

A prompt in the Service

A proxy object representing a prompt that the Secret Service will display to the user.

Certain actions on the Secret Service require user prompting to complete, such as creating a collection, or unlocking a collection. When such a prompt is necessary, then a Secret.Prompt object is created by this library, and passed to the [method`Service`.prompt] method. In this way it is handled automatically.

In order to customize prompt handling, override the [vfunc`Service`.prompt_async] and [vfunc`Service`.prompt_finish] virtual methods of the [class`Service`] class.

perform(window_id, return_type, cancellable, callback, *user_data)
Parameters:

Runs a prompt and performs the prompting.

Returns True if the prompt was completed and not dismissed.

If window_id is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the %d printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This method will return immediately and complete asynchronously.

perform_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

None if the prompt was dismissed or an error occurred, a variant result if the prompt was successful

Return type:

GLib.Variant

Complete asynchronous operation to run a prompt and perform the prompting.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

perform_sync(window_id, cancellable, return_type)
Parameters:
  • window_id (str or None) – string form of XWindow id for parent window to be transient for

  • cancellable (Gio.Cancellable or None) – optional cancellation object

  • return_type (GLib.VariantType) – the variant type of the prompt result

Raises:

GLib.Error

Returns:

None if the prompt was dismissed or an error occurred

Return type:

GLib.Variant

Runs a prompt and performs the prompting.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

If window_id is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the %d printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This method may block indefinitely and should not be used in user interface threads.

run(window_id, cancellable, return_type)
Parameters:
  • window_id (str or None) – string form of XWindow id for parent window to be transient for

  • cancellable (Gio.Cancellable or None) – optional cancellation object

  • return_type (GLib.VariantType) – the variant type of the prompt result

Raises:

GLib.Error

Returns:

None if the prompt was dismissed or an error occurred

Return type:

GLib.Variant

Runs a prompt and performs the prompting.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

If window_id is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the %d printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This runs the dialog in a recursive mainloop. When run from a user interface thread, this means the user interface will remain responsive. Care should be taken that appropriate user interface actions are disabled while running the prompt.