:right-sidebar: True SystemPrompter =================================================================== .. currentmodule:: gi.repository.Gcr .. class:: SystemPrompter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: SystemPrompter(**properties) new(mode:Gcr.SystemPrompterMode, prompt_type:GType) -> Gcr.SystemPrompter Constructors ------------ .. rst-class:: interim-class .. class:: SystemPrompter :no-index: .. classmethod:: new(mode: ~gi.repository.Gcr.SystemPrompterMode, prompt_type: type) -> ~gi.repository.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 :obj:`~gi.repository.Gcr.Prompt` interface. If ``prompt_type`` is non-zero then the :obj:`~gi.repository.GObject.Type` must implement the :obj:`~gi.repository.Gcr.Prompt` interface. :param mode: the mode for the prompt :param prompt_type: the gobject type for prompts created by this prompter Methods ------- .. rst-class:: interim-class .. class:: SystemPrompter :no-index: .. method:: get_mode() -> ~gi.repository.Gcr.SystemPrompterMode Get the mode for this prompter. Most system prompters only display one prompt at a time and therefore return :const:`~gi.repository.Gcr.SystemPrompterMode.SINGLE`. .. method:: get_prompt_type() -> type Get the :obj:`~gi.repository.GObject.Type` for prompts created by this prompter. The returned :obj:`~gi.repository.GObject.Type` will be a :obj:`~gi.repository.Gcr.Prompt` implementation. .. method:: get_prompting() -> bool Get whether prompting or not. .. method:: register(connection: ~gi.repository.Gio.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 :func:`~gi.repository.Gcr.SystemPrompter.unregister` is called, or the prompter is unreferenced. :param connection: a DBus connection .. method:: unregister(wait: bool) -> None Unregister this system prompter on the DBus ``connection``. The prompter must have previously been registered with :func:`~gi.repository.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. :param wait: whether to wait for closing prompts Properties ---------- .. rst-class:: interim-class .. class:: SystemPrompter :no-index: .. attribute:: props.prompt_type :type: type The :obj:`~gi.repository.GObject.Type` for prompts created by this prompter. This must be a :obj:`~gi.repository.Gcr.Prompt` implementation. .. attribute:: props.prompting :type: bool Whether the prompter is prompting or not. Signals ------- .. rst-class:: interim-class .. class:: SystemPrompter.signals :no-index: .. method:: new_prompt() -> ~gi.repository.Gcr.Prompt Signal emitted to create a new prompt when needed. The default implementation of this signal creates a prompt of the type :func:`~gi.repository.Gcr.SystemPrompter.get_prompt_type`. Fields ------ .. rst-class:: interim-class .. class:: SystemPrompter :no-index: .. attribute:: parent .. attribute:: pv