:right-sidebar: True MapSourceRegistry =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: MapSourceRegistry(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel` This object allows you to hold :obj:`~gi.repository.Shumate.MapSource` instances, you can access a default set of sources with :obj:`~gi.repository.MapSourceRegistry.populate_defaults`\. It conveniently implements :obj:`~gi.repository.Gio.ListModel` to easily integrate with it. Constructors ------------ .. rst-class:: interim-class .. class:: MapSourceRegistry :no-index: .. classmethod:: new() -> ~gi.repository.Shumate.MapSourceRegistry Create a new :obj:`~gi.repository.Shumate.MapSourceRegistry`\. .. classmethod:: new_with_defaults() -> ~gi.repository.Shumate.MapSourceRegistry Create a new :obj:`~gi.repository.Shumate.MapSourceRegistry` with defaults map sources. This is identical to calling :obj:`~gi.repository.MapSourceRegistry.populate_defaults` after :func:`~gi.repository.Shumate.MapSourceRegistry.new`. Methods ------- .. rst-class:: interim-class .. class:: MapSourceRegistry :no-index: .. method:: add(map_source: ~gi.repository.Shumate.MapSource) -> None Adds the :obj:`~gi.repository.Shumate.MapSource` to the :obj:`~gi.repository.Shumate.MapSourceRegistry` :param map_source: a :obj:`~gi.repository.Shumate.MapSource` .. method:: get_by_id(id: str) -> ~gi.repository.Shumate.MapSource | None Find the :obj:`~gi.repository.Shumate.MapSource` with the corresponding id :param id: the id of the :obj:`~gi.repository.Shumate.MapSource` .. method:: populate_defaults() -> None Populates the :obj:`~gi.repository.Shumate.MapSourceRegistry` with a default set of sources. .. method:: remove(id: str) -> None Removes the corresponding :obj:`~gi.repository.Shumate.MapSource` from the registry. If the source doesn't exist in the registry, this function does nothing. :param id: a :obj:`~gi.repository.Shumate.MapSource` id