:right-sidebar: True SystemPrompt =================================================================== .. currentmodule:: gi.repository.Gcr .. class:: SystemPrompt(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gcr.Prompt`, :class:`~gi.repository.Gio.AsyncInitable`, :class:`~gi.repository.Gio.Initable` A :obj:`~gi.repository.Gcr.Prompt` implementation which calls to the system prompter to display prompts in a system modal fashion. Since the system prompter usually only displays one prompt at a time, you may have to wait for the prompt to be displayed. Use :obj:`~gi.repository.SystemPrompt.open` or a related function to open a prompt. Since this can take a long time, you should always check that the prompt is still needed after it is opened. A previous prompt may have already provided the information needed and you may no longer need to prompt. Use :obj:`~gi.repository.SystemPrompt.close` to close the prompt when you're done with it. Methods ------- .. rst-class:: interim-class .. class:: SystemPrompt :no-index: .. method:: close(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool Close this prompt. After calling this function, no further prompts will succeed on this object. The prompt object is not unreferenced by this function, and you must unreference it once done. This call may block, use the :func:`~gi.repository.Gcr.SystemPrompt.close_async` to perform this action indefinitely. Whether or not this function returns :const:`True`, the system prompt object is still closed and may not be further used. :param cancellable: an optional cancellation object .. method:: close_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Close this prompt asynchronously. After calling this function, no further methods may be called on this object. The prompt object is not unreferenced by this function, and you must unreference it once done. This call returns immediately and completes asynchronously. :param cancellable: an optional cancellation object :param callback: called when the operation completes :param user_data: data to pass to the callback .. method:: close_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Complete operation to close this prompt. Whether or not this function returns :const:`True`, the system prompt object is still closed and may not be further used. :param result: asynchronous operation result .. classmethod:: error_get_domain() -> int .. method:: get_secret_exchange() -> ~gi.repository.Gcr.SecretExchange Get the current :obj:`~gi.repository.Gcr.SecretExchange` used to transfer secrets in this prompt. .. classmethod:: open(cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gcr.SystemPrompt Opens a system prompt with the default prompter. Most system prompters only allow showing one prompt at a time, and if another prompt is shown then this method will block for up to ``timeout_seconds`` seconds. If ``timeout_seconds`` is equal to -1, then this will block indefinitely until the prompt can be opened. If ``timeout_seconds`` expires, then this function will fail with a :const:`~gi.repository.Gcr.SystemPromptError.SYSTEM_PROMPT_IN_PROGRESS` error. :param cancellable: optional cancellation object .. classmethod:: open_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronously open a system prompt with the default system prompter. Most system prompters only allow showing one prompt at a time, and if another prompt is shown then this method will block for up to ``timeout_seconds`` seconds. If ``timeout_seconds`` is equal to -1, then this will block indefinitely until the prompt can be opened. If ``timeout_seconds`` expires, then this operation will fail with a :const:`~gi.repository.Gcr.SystemPromptError.SYSTEM_PROMPT_IN_PROGRESS` error. :param cancellable: optional cancellation object :param callback: called when the operation completes :param user_data: data to pass the callback .. classmethod:: open_finish() -> ~gi.repository.Gcr.SystemPrompt Complete an operation to asynchronously open a system prompt. .. classmethod:: open_for_prompter(timeout_seconds: int, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gcr.SystemPrompt Opens a system prompt. If prompter_name is :const:`None`, then the default system prompter is used. Most system prompters only allow showing one prompt at a time, and if another prompt is shown then this method will block for up to ``timeout_seconds`` seconds. If ``timeout_seconds`` is equal to -1, then this will block indefinitely until the prompt can be opened. If ``timeout_seconds`` expires, then this function will fail with a :const:`~gi.repository.Gcr.SystemPromptError.SYSTEM_PROMPT_IN_PROGRESS` error. :param timeout_seconds: the number of seconds to wait to access the prompt, or -1 :param cancellable: optional cancellation object .. classmethod:: open_for_prompter_async(timeout_seconds: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Opens a system prompt asynchronously. If prompter_name is :const:`None`, then the default system prompter is used. Most system prompters only allow showing one prompt at a time, and if another prompt is shown then this method will block for up to ``timeout_seconds`` seconds. If ``timeout_seconds`` is equal to -1, then this will block indefinitely until the prompt can be opened. If ``timeout_seconds`` expires, then this operation will fail with a :const:`~gi.repository.Gcr.SystemPromptError.SYSTEM_PROMPT_IN_PROGRESS` error. :param timeout_seconds: the number of seconds to wait to access the prompt, or -1 :param cancellable: optional cancellation object :param callback: called when the operation completes :param user_data: data to pass the callback Properties ---------- .. rst-class:: interim-class .. class:: SystemPrompt :no-index: .. attribute:: props.bus_name :type: str The type of the None singleton. .. attribute:: props.secret_exchange :type: ~gi.repository.Gcr.SecretExchange The type of the None singleton. .. attribute:: props.timeout_seconds :type: int The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: SystemPrompt :no-index: .. attribute:: parent .. attribute:: pv