Gcr.SystemPrompter

g GObject.Object GObject.Object Gcr.SystemPrompter Gcr.SystemPrompter GObject.Object->Gcr.SystemPrompter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (mode, prompt_type)

get_mode ()

get_prompt_type ()

get_prompting ()

register (connection)

unregister (wait)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

prompt-type

GObject.GType

r/w/co

GObject.Object type of prompts

prompting

bool

r

Whether prompting or not

Signals

Inherited:

GObject.Object (1)

Name

Short Description

new-prompt

Signal emitted to create a new prompt when needed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Gcr.SystemPrompter(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gcr.SystemPrompterClass

A prompter used by implementations of system prompts.

This is a D-Bus service which is rarely implemented. Use [class`SystemPrompt`] to display system prompts.

The system prompter service responds to D-Bus requests to create system prompts and creates Gcr.Prompt type objects to display those prompts.

Pass the GObject.GType of the implementation of [iface`Prompt`] to [ctor`SystemPrompter`.new].

classmethod new(mode, prompt_type)[source]
Parameters:
Returns:

a new prompter service

Return type:

Gcr.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 the Gcr.Prompt interface.

If prompt_type is non-zero then the GObject.GType must implement the Gcr.Prompt interface.

get_mode()[source]
Returns:

the prompter mode

Return type:

Gcr.SystemPrompterMode

Get the mode for this prompter.

Most system prompters only display one prompt at a time and therefore return Gcr.SystemPrompterMode.SINGLE.

get_prompt_type()[source]
Returns:

the prompt GObject.GType

Return type:

GObject.GType

Get the GObject.GType for prompts created by this prompter.

The returned GObject.GType will be a Gcr.Prompt implementation.

get_prompting()[source]
Returns:

whether prompting or not

Return type:

bool

Get whether prompting or not.

register(connection)[source]
Parameters:

connection (Gio.DBusConnection) – a DBus connection

Register this system prompter on the DBus connection.

This makes the prompter available for clients to call. The prompter will remain registered until Gcr.SystemPrompter.unregister() is called, or the prompter is unreferenced.

unregister(wait)[source]
Parameters:

wait (bool) – whether to wait for closing prompts

Unregister this system prompter on the DBus connection.

The prompter must have previously been registered with Gcr.SystemPrompter.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.

Signal Details

Gcr.SystemPrompter.signals.new_prompt(system_prompter)
Signal Name:

new-prompt

Flags:

RUN_LAST

Parameters:

system_prompter (Gcr.SystemPrompter) – The object which received the signal

Returns:

the new prompt

Return type:

Gcr.Prompt

Signal emitted to create a new prompt when needed.

The default implementation of this signal creates a prompt of the type Gcr.SystemPrompter.get_prompt_type().

Property Details

Gcr.SystemPrompter.props.prompt_type
Name:

prompt-type

Type:

GObject.GType

Default Value:

<GType GcrPrompt>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GObject.GType for prompts created by this prompter. This must be a Gcr.Prompt implementation.

Gcr.SystemPrompter.props.prompting
Name:

prompting

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the prompter is prompting or not.