From df0fd5b618079c69cb9ab551246caf6f6794b64f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 17 May 2009 09:25:15 +0100 Subject: [PATCH] hook up themes to combo boxes --- openlp/core/ui/thememanager.py | 3 ++- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8d04994da..a695c8d92 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -224,7 +224,8 @@ class ThemeManager(QWidget): self.themeData.addRow(os.path.join(self.path, name)) self.EventManager.post_event(Event(EventType.ThemeListChanged)) self.ServiceManager.updateThemeList(self.getThemes()) - #self.themeTab.updateThemeList(self.getThemes()) + self.parent.settings_form.ThemesTab.updateThemeList(self.getThemes()) + def getThemes(self): return self.themeData.getList() diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 08f4653fd..d279c6aab 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -85,7 +85,7 @@ class BiblePlugin(Plugin): log.debug(u'Handle event called with event %s with payload %s'%(event.event_type, event.payload)) if event.event_type == EventType.ThemeListChanged: log.debug(u'New Theme request received') - #self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) + self.bibles_tab.updateThemeList(self.theme_manager.getThemes()) if event.event_type == EventType.LoadServiceItem and event.payload == 'Bibles': log.debug(u'Load Service Item received') self.media_item.onBibleAddClick() diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index dc0918d92..e28139e45 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -205,3 +205,11 @@ class BiblesTab(SettingsTab): self.config.set_config("display brackets", str(self.display_style)) self.config.set_config("search as type", str(self.bible_search)) self.config.set_config("bible theme", str(self.bible_theme)) + + def updateThemeList(self, theme_list): + """ + Called from ThemeManager when the Themes have changed + """ + self.BibleThemeComboBox.clear() + for theme in theme_list: + self.BibleThemeComboBox.addItem(theme)