EBackend.UserPrompter

g EBackend.UserPrompter EBackend.UserPrompter GObject.Object GObject.Object GObject.Object->EBackend.UserPrompter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

extension_prompt (dialog_name, in_parameters, cancellable, callback, *user_data)

extension_prompt_finish (result, out_values)

extension_prompt_sync (dialog_name, in_parameters, out_values, cancellable)

prompt (type, title, primary_text, secondary_text, use_markup, button_captions, cancellable, callback, *user_data)

prompt_finish (result)

prompt_sync (type, title, primary_text, secondary_text, use_markup, button_captions, cancellable)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class EBackend.UserPrompter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

EBackend.UserPrompterClass

Contains only private data that should be read and manipulated using the functions below.

New in version 3.8.

classmethod new()
Returns:

a new instance of EBackend.UserPrompter

Return type:

EBackend.UserPrompter

Creates a new instance of EBackend.UserPrompter.

New in version 3.8.

extension_prompt(dialog_name, in_parameters, cancellable, callback, *user_data)
Parameters:

Asynchronously prompt a user for a decision on an extension-provided dialog. The caller usually provides an extension for EBackend.UserPrompterServer, a descendant of EBackend.UserPrompterServerExtension, which registers itself as a dialog provider. The extension defines dialog_name, same as meaning of in_parameters; only the extension and the caller know about meaning of these.

When the operation is finished, callback will be called. You can then call EBackend.UserPrompter.extension_prompt_finish() to get the result of the operation. If there is no extension providing given dialog name, the operation finishes with a G_IO_ERROR, Gio.IOErrorEnum.NOT_FOUND GLib.Error.

New in version 3.8.

extension_prompt_finish(result, out_values)
Parameters:
Raises:

GLib.Error

Returns:

Result code of the prompt, as defined by the extension, or -1 on error.

Return type:

int

Finishes the operation started with EBackend.UserPrompter.extension_prompt(). Caller can provide out_values to get additional values provided by the extension. In case the caller is not interested in additional values, it can pass None out_values. The out_values will be cleared first, then any values will be added there. Only the caller and the extension know about meaning of the result code and additional values.

If an error occurred, the function sets error and returns -1. If there is no extension providing given dialog name, the operation finishes with a G_IO_ERROR, Gio.IOErrorEnum.NOT_FOUND error.

New in version 3.8.

extension_prompt_sync(dialog_name, in_parameters, out_values, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Result code of the prompt, as defined by the extension, or -1 on error.

Return type:

int

Synchronously prompt a user for a decision on an extension-provided dialog. The caller usually provides an extension for EBackend.UserPrompterServer, a descendant of EBackend.UserPrompterServerExtension, which registers itself as a dialog provider. The extension defines dialog_name, same as meaning of in_parameters; only the extension and the caller know about meaning of these.

Caller can provide out_values to get additional values provided by the extension. In case the caller is not interested in additional values, it can pass None out_values. The out_values will be cleared first, then any values will be added there. Only the caller and the extension know about meaning of the result code and additional values.

If an error occurred, the function sets error and returns -1. If there is no extension providing given dialog name, the operation finishes with a G_IO_ERROR, Gio.IOErrorEnum.NOT_FOUND error.

New in version 3.8.

prompt(type, title, primary_text, secondary_text, use_markup, button_captions, cancellable, callback, *user_data)
Parameters:

Asynchronously prompt a user for a decision.

The type can be one of “info”, “warning”, “question” or “error”, to include an icon in the message prompt; anything else results in no icon in the message.

If button_captions is None or empty list, then only one button is shown in the prompt, a “Dismiss” button.

When the operation is finished, callback will be called. You can then call EBackend.UserPrompter.prompt_finish() to get the result of the operation.

New in version 3.8.

prompt_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

0-based index of a button being used by a user as a response, corresponding to ‘button_captions’ from EBackend.UserPrompter.prompt() call.

Return type:

int

Finishes the operation started with EBackend.UserPrompter.prompt().

If an error occurred, the function sets error and returns -1.

New in version 3.8.

prompt_sync(type, title, primary_text, secondary_text, use_markup, button_captions, cancellable)
Parameters:
  • type (str or None) – type of the prompt; can be None

  • title (str or None) – window title of the prompt; can be None

  • primary_text (str or None) – primary text of the prompt; can be None

  • secondary_text (str or None) – secondary text of the prompt; can be None

  • use_markup (bool) – whether both texts are with markup

  • button_captions ([str] or None) – captions of buttons to use in the message; can be None

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

Raises:

GLib.Error

Returns:

0-based index of a button being used by a user as a response, corresponding to button_captions list.

Return type:

int

Prompts a user for a decision.

The type can be one of “info”, “warning”, “question” or “error”, to include an icon in the message prompt; anything else results in no icon in the message.

If button_captions is None or empty list, then only one button is shown in the prompt, a “Dismiss” button.

If an error occurred, the function sets error and returns -1.

New in version 3.8.