EBackend.UserPrompter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class EBackend.UserPrompter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
Creates a new instance of
EBackend.UserPrompter
.New in version 3.8.
- extension_prompt(dialog_name, in_parameters, cancellable, callback, *user_data)¶
- Parameters:
dialog_name (
str
) – name of a dialog to invokein_parameters (
EDataServer.NamedParameters
orNone
) – optional parameters to pass to extension; can beNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
Asynchronously prompt a user for a decision on an extension-provided dialog. The caller usually provides an extension for
EBackend.UserPrompterServer
, a descendant ofEBackend.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:
result (
Gio.AsyncResult
) – aGio.AsyncResult
out_values (
EDataServer.NamedParameters
orNone
) – Where to store values from the extension, orNone
- Raises:
- Returns:
Result code of the prompt, as defined by the extension, or -1 on error.
- Return type:
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 passNone
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:
dialog_name (
str
) – name of a dialog to invokein_parameters (
EDataServer.NamedParameters
orNone
) – optional parameters to pass to extension; can beNone
out_values (
EDataServer.NamedParameters
orNone
) – Where to store values from the extension, orNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
Result code of the prompt, as defined by the extension, or -1 on error.
- Return type:
Synchronously prompt a user for a decision on an extension-provided dialog. The caller usually provides an extension for
EBackend.UserPrompterServer
, a descendant ofEBackend.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:
title (
str
orNone
) – window title of the prompt; can beNone
primary_text (
str
orNone
) – primary text of the prompt; can beNone
secondary_text (
str
orNone
) – secondary text of the prompt; can beNone
use_markup (
bool
) – whether both texts are with markupbutton_captions ([
str
] orNone
) – captions of buttons to use in the message; can beNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
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
) – aGio.AsyncResult
- Raises:
- 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:
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:
title (
str
orNone
) – window title of the prompt; can beNone
primary_text (
str
orNone
) – primary text of the prompt; can beNone
secondary_text (
str
orNone
) – secondary text of the prompt; can beNone
use_markup (
bool
) – whether both texts are with markupbutton_captions ([
str
] orNone
) – captions of buttons to use in the message; can beNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
0-based index of a button being used by a user as a response, corresponding to button_captions list.
- Return type:
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.