Functions

  trust_prompt_describe_certificate_errors (flags)
  trust_prompt_run_for_source (parent, source, certificate_pem, certificate_errors, error_text, allow_source_save, cancellable, callback, *user_data)
  trust_prompt_run_for_source_finish (source, result, response)
  trust_prompt_run_modal (parent, source_extension, source_display_name, host, certificate_pem, certificate_errors, error_text)
  webdav_discover_content_get_base_url (content)
  webdav_discover_content_get_multiselect (content)
  webdav_discover_content_get_selected (content, index)
  webdav_discover_content_get_tree_selection (content)
  webdav_discover_content_get_user_address (content)
  webdav_discover_content_new (credentials_prompter, source, base_url, supports_filter)
  webdav_discover_content_refresh (content, display_name, cancellable, callback, *user_data)
  webdav_discover_content_refresh_finish (content, result)
  webdav_discover_content_set_base_url (content, base_url)
  webdav_discover_content_set_multiselect (content, multiselect)
  webdav_discover_content_show_error (content, error)
  webdav_discover_dialog_get_content (dialog)
  webdav_discover_dialog_new (parent, title, credentials_prompter, source, base_url, supports_filter)
  webdav_discover_dialog_refresh (dialog)

Details

EDataServerUI.trust_prompt_describe_certificate_errors(flags)
Parameters:flags (Gio.TlsCertificateFlags) – a Gio.TlsCertificateFlags to describe
Returns:A newly allocated string with text description of flags. Free the returned pointer with GLib.free() when no longer needed.
Return type:str

Converts flags into a localized text description of the set bits, one bit description per line. If no bit is set, then an empty string is returned.

New in version 3.16.

EDataServerUI.trust_prompt_run_for_source(parent, source, certificate_pem, certificate_errors, error_text, allow_source_save, cancellable, callback, *user_data)
Parameters:

Similar to EDataServerUI.trust_prompt_run_modal(), except it also manages all the necessary things around the source ‘s SSL/TLS trust properties when it also contains %E_SOURCE_EXTENSION_WEBDAV, thus the SSL/TLS trust on the WebDAV source is properly updated based on the user’s choice. The call is finished with EDataServerUI.trust_prompt_run_for_source_finish(), which also returns the user’s choice. The finish happens in the callback. This is necessary, because the source can be also saved.

The function fails, if the source doesn’t contain the EDataServer.SOURCE_EXTENSION_AUTHENTICATION.

Note: The dialog is not shown when the stored certificate trust in the WebDAV source matches the certificate_pem and the stored result is EDataServer.TrustPromptResponse.REJECT.

New in version 3.16.

EDataServerUI.trust_prompt_run_for_source_finish(source, result, response)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Finishes the operation started with EDataServerUI.trust_prompt_run_for_source(). The response will contain a code of the user’s choice. The EDataServer.TrustPromptResponse.UNKNOWN is used, when the user cancelled the trust prompt dialog and no changes are made with the source.

If an error occurs, the function sets error and returns False.

New in version 3.16.

EDataServerUI.trust_prompt_run_modal(parent, source_extension, source_display_name, host, certificate_pem, certificate_errors, error_text)
Parameters:
  • parent (Gtk.Window) – A Gtk.Window to use as a parent for the trust prompt dialog
  • source_extension (str or None) – an EDataServer.Source extension, to identify a kind of the source; or None
  • source_display_name (str or None) – an EDataServer.Source display name, to identify what prompts; or None
  • host (str) – a host name to which the certificate belongs
  • certificate_pem (str) – a PEM-encoded certificate for which to show the trust prompt
  • certificate_errors (Gio.TlsCertificateFlags) – errors of the certificate_pem
  • error_text (str or None) – an optional error text to show in the dialog; can be None
Returns:

A code of the user’s choice. The EDataServer.TrustPromptResponse.UNKNOWN is returned, when the user cancelled the trust prompt dialog.

Return type:

EDataServer.TrustPromptResponse

Runs modal (doesn’t return until the dialog is closed) a trust prompt dialog, it is a prompt whether a user wants to accept or reject the certificate_pem for the host due to the certificate_errors errors.

The pair source_extension and source_display_name influences the trust prompt message. If both are set, then the message also contains which source failed to connect according to these two arguments.

The dialog can contain a custom error text, passed in as error_text. The error might be a detailed error string returned by the server. If set, it is prefixed with “Detailed error:” string.

New in version 3.16.

EDataServerUI.webdav_discover_content_get_base_url(content)
Parameters:content (Gtk.Widget) – a WebDAV discovery content, created by EDataServerUI.webdav_discover_content_new()
Returns:currently set base URL for the content.
Return type:str

Returns currently set base URL for the content. This is used to overwrite the one set on the EDataServer.Source from the creation time. The URL can be either a full URL, a path or even a None.

New in version 3.18.

EDataServerUI.webdav_discover_content_get_multiselect(content)
Parameters:content (Gtk.Widget) – a WebDAV discovery content, created by EDataServerUI.webdav_discover_content_new()
Returns:whether multiselect is allowed for the content.
Return type:bool

New in version 3.18.

EDataServerUI.webdav_discover_content_get_selected(content, index)
Parameters:
Returns:

True, when a selected source of index index exists, False otherwise.

out_href:an output location for the URL of the selected source
out_supports:an output location of a bit-or of EDataServer.WebDAVDiscoverSupports, the set of source types this server source location supports
out_display_name:
 an output location of the sources display name
out_color:an output location of the string representation of the color for the source, as set on the server

Return type:

(bool, out_href: str, out_supports: int, out_display_name: str, out_color: str)

Returns information about selected source at index index. The function can be called multiple times, with the index starting at zero and as long as it doesn’t return False. If the content doesn’t have allowed multiselection, then the only valid index is 0.

All the out_href, out_display_name and out_color are newly allocated strings, which should be freed with GLib.free(), when no longer needed.

New in version 3.18.

EDataServerUI.webdav_discover_content_get_tree_selection(content)
Parameters:content (Gtk.Widget) – a WebDAV discovery content, created by EDataServerUI.webdav_discover_content_new()
Returns:inner #GtkTreeViewSelection
Return type:Gtk.TreeSelection

Returns inner #GtkTreeViewSelection. This is meant to be able to connect to its “changed” signal and update other parts of the parent widgets accordingly.

New in version 3.18.

EDataServerUI.webdav_discover_content_get_user_address(content)
Parameters:content (Gtk.Widget) – a WebDAV discovery content, created by EDataServerUI.webdav_discover_content_new()
Returns:currently selected user address. The returned string is newly allocated and should be freed with GLib.free() when no longer needed. If there are none addresses provided by the server, or no calendar sources were found, then None is returned instead.
Return type:str

Get currently selected user address in the content, if the server returned any. This value has meaning only with calendar sources.

New in version 3.18.

EDataServerUI.webdav_discover_content_new(credentials_prompter, source, base_url, supports_filter)
Parameters:
Returns:

a new WebDAV discovery content widget.

Return type:

Gtk.Widget

Creates a new WebDAV discovery content, which is a Gtk.Grid containing necessary widgets to provide a UI interface for a user to search and select for available WebDAV (CalDAV or CardDAV) sources provided by the given server. Do not pack anything into this content, its content can be changed dynamically.

New in version 3.18.

EDataServerUI.webdav_discover_content_refresh(content, display_name, cancellable, callback, *user_data)
Parameters:

Asynchronously starts refresh of the content. This means to access the server and search it for available sources. The content shows a feedback and a Cancel button during the operation.

The display_name is used only if the content wasn’t created with an EDataServer.Source and it’s shown in the password prompts, if there are required any.

When the operation is finished, callback will be called. You can then call EDataServerUI.webdav_discover_content_refresh_finish() to get the result of the operation.

New in version 3.18.

EDataServerUI.webdav_discover_content_refresh_finish(content, result)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

Finishes the operation started with EDataServerUI.webdav_discover_content_refresh(). If an error occurred, the function will set error and return False. There is available EDataServerUI.webdav_discover_content_show_error() for convenience, which shows the error within content and takes care of it when refreshing the content.

New in version 3.18.

EDataServerUI.webdav_discover_content_set_base_url(content, base_url)
Parameters:

Sets base URL for the content. This is used to overwrite the one set on the EDataServer.Source from the creation time. The URL can be either a full URL, a path or even a None.

New in version 3.18.

EDataServerUI.webdav_discover_content_set_multiselect(content, multiselect)
Parameters:

Sets whether the WebDAV discovery content allows multiselect.

New in version 3.18.

EDataServerUI.webdav_discover_content_show_error(content, error)
Parameters:

Shows the error within content, unless it’s a Gio.IOErrorEnum.CANCELLED, or None, which are safely ignored. The advantage of this function is that the error message is removed when the refresh operation is started.

New in version 3.18.

EDataServerUI.webdav_discover_dialog_get_content(dialog)
Parameters:dialog (Gtk.Dialog) – a Gtk.Dialog returned by EDataServerUI.webdav_discover_dialog_new()
Returns:inner WebDAV discovery content
Return type:Gtk.Widget

Returns inner WebDAV discovery content, which can be further manipulated.

New in version 3.18.

EDataServerUI.webdav_discover_dialog_new(parent, title, credentials_prompter, source, base_url, supports_filter)
Parameters:
Returns:

a newly created Gtk.Dialog, which should be freed with Gtk.Widget.destroy(), when no longer needed.

Return type:

Gtk.Dialog

Creates a new Gtk.Dialog which has as its content a WebDAV discovery widget, created with EDataServerUI.webdav_discover_content_new(). This dialog can be shown to a user and when its final response is Gtk.ResponseType.ACCEPT, then the inner content can be asked for currently selected source(s).

New in version 3.18.

EDataServerUI.webdav_discover_dialog_refresh(dialog)
Parameters:dialog (Gtk.Dialog) – a Gtk.Dialog returned by EDataServerUI.webdav_discover_dialog_new()

Invokes refresh of the inner content of the WebDAV discovery dialog.

New in version 3.18.