SystemPrompter
Superclasses: Object
- Constructors:
SystemPrompter(**properties)
new(mode:Gcr.SystemPrompterMode, prompt_type:GType) -> Gcr.SystemPrompter
Constructors
- class SystemPrompter
- classmethod new(mode: SystemPrompterMode, prompt_type: type) SystemPrompter
Create a new system prompter service. This prompter won’t do anything unless you connect to its signals and show appropriate prompts.
If
prompt_type
is zero, then the new-prompt signal must be handled and return a valid prompt object implementing thePrompt
interface.If
prompt_type
is non-zero then theType
must implement thePrompt
interface.- Parameters:
mode – the mode for the prompt
prompt_type – the gobject type for prompts created by this prompter
Methods
- class SystemPrompter
- get_mode() SystemPrompterMode
Get the mode for this prompter.
Most system prompters only display one prompt at a time and therefore return
SINGLE
.
- get_prompt_type() type
Get the
Type
for prompts created by this prompter.The returned
Type
will be aPrompt
implementation.
- register(connection: DBusConnection) None
Register this system prompter on the DBus
connection
.This makes the prompter available for clients to call. The prompter will remain registered until
unregister()
is called, or the prompter is unreferenced.- Parameters:
connection – a DBus connection
- unregister(wait: bool) None
Unregister this system prompter on the DBus
connection
.The prompter must have previously been registered with
register()
.If
wait
is set then this function will wait until all prompts have been closed or cancelled. This is usually only used by tests.- Parameters:
wait – whether to wait for closing prompts
Properties
Signals
- class SystemPrompter.signals
- new_prompt() Prompt
Signal emitted to create a new prompt when needed.
The default implementation of this signal creates a prompt of the type
get_prompt_type()
.