Shumate.MapSourceRegistry

g GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel GObject.Object GObject.Object Shumate.MapSourceRegistry Shumate.MapSourceRegistry GObject.Object->Shumate.MapSourceRegistry Gio.ListModel->Shumate.MapSourceRegistry

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_defaults ()

add (map_source)

get_by_id (id)

populate_defaults ()

remove (id)

Virtual Methods

Inherited:

GObject.Object (7), Gio.ListModel (3)

Properties

None

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1)

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1)

Class Details

class Shumate.MapSourceRegistry(**kwargs)
Bases:

GObject.Object, Gio.ListModel

Abstract:

No

Structure:

Shumate.MapSourceRegistryClass

This object allows you to hold [class`MapSource`] instances, you can access a default set of sources with [method`MapSourceRegistry`.populate_defaults].

It conveniently implements [iface`Gio`.ListModel] to easily integrate with it.

classmethod new()
Returns:

a newly created Shumate.MapSourceRegistry

Return type:

Shumate.MapSourceRegistry

Create a new Shumate.MapSourceRegistry.

classmethod new_with_defaults()
Returns:

a newly created Shumate.MapSourceRegistry

Return type:

Shumate.MapSourceRegistry

Create a new Shumate.MapSourceRegistry with defaults map sources. This is identical to calling [method`MapSourceRegistry`.populate_defaults] after Shumate.MapSourceRegistry.new().

add(map_source)
Parameters:

map_source (Shumate.MapSource) – a Shumate.MapSource

Adds the Shumate.MapSource to the Shumate.MapSourceRegistry

get_by_id(id)
Parameters:

id (str) – the id of the Shumate.MapSource

Returns:

the Shumate.MapSource or None if no map source has been found

Return type:

Shumate.MapSource or None

Find the Shumate.MapSource with the corresponding id

populate_defaults()

Populates the Shumate.MapSourceRegistry with a default set of sources.

remove(id)
Parameters:

id (str) – a Shumate.MapSource id

Removes the corresponding Shumate.MapSource from the registry. If the source doesn’t exist in the registry, this function does nothing.