diff options
Diffstat (limited to 'deluge/ui/web/json_api.py')
-rw-r--r-- | deluge/ui/web/json_api.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index ea8105d..5f4b3dc 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -982,6 +982,16 @@ class WebApi(JSONComponent): """ return self.event_queue.get_events(__request__.session_id) + @export + def set_theme(self, theme): + """ + Sets a new Theme to the WebUI + + Args: + theme (str): the theme to apply + """ + component.get('DelugeWeb').set_theme(theme) + class WebUtils(JSONComponent): """ @@ -1000,3 +1010,13 @@ class WebUtils(JSONComponent): list: of tuples ``[(lang-id, language-name), ...]`` """ return get_languages() + + @export + def get_themes(self): + """ + Get the available themes + + Returns: + list: of themes ``[theme1, theme2, ...]`` + """ + return component.get('DelugeWeb').get_themes() |