EDataServerUI.WebDAVDiscoverContent

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget EDataServerUI.WebDAVDiscoverContent EDataServerUI.WebDAVDiscoverContent GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Grid Gtk.Grid Gtk.Container->Gtk.Grid Gtk.Grid->EDataServerUI.WebDAVDiscoverContent Gtk.Orientable->Gtk.Grid Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Grid (21), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (credentials_prompter, source, base_url, supports_filter)

get_base_url ()

get_multiselect ()

get_selected (index)

get_tree_selection ()

get_user_address ()

refresh (display_name, cancellable, callback, *user_data)

refresh_finish (result)

set_base_url (base_url)

set_multiselect (multiselect)

show_error (error)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Grid (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Child Properties

Inherited:

Gtk.Grid (4)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class EDataServerUI.WebDAVDiscoverContent(**kwargs)
Bases:

Gtk.Grid

Abstract:

No

Structure:

EDataServerUI.WebDAVDiscoverContentClass

classmethod new(credentials_prompter, source, base_url, supports_filter)
Parameters:
Returns:

a new EDataServerUI.WebDAVDiscoverContent.

Return type:

EDataServerUI.WebDAVDiscoverContent

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.

get_base_url()
Returns:

currently set base URL for the self.

Return type:

str

Returns currently set base URL for the self. 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.

get_multiselect()
Returns:

whether multiselect is allowed for the self.

Return type:

bool

New in version 3.18.

get_selected(index)
Parameters:

index (int) – an index of the selected source; counts from 0

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

out_order:

an output location of the preferred sorting order

Return type:

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

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 self 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.

get_tree_selection()
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.

get_user_address()
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 or None

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

New in version 3.18.

refresh(display_name, cancellable, callback, *user_data)
Parameters:

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

The display_name is used only if the self 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.WebDAVDiscoverContent.refresh_finish() to get the result of the operation.

New in version 3.18.

refresh_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

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

New in version 3.18.

set_base_url(base_url)
Parameters:

base_url (str) – a base URL

Sets base URL for the self. 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.

set_multiselect(multiselect)
Parameters:

multiselect (bool) – whether multiselect is allowed

Sets whether the WebDAV discovery content allows multiselect.

New in version 3.18.

show_error(error)
Parameters:

error (GLib.Error) – a GLib.Error to show in the UI, or None

Shows the error within self, 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.