From d025d1ebf6935d717231369f7b65ebdc40965bc1 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 10 Apr 2009 07:06:41 +0100 Subject: [PATCH] Add New Theme Event Handlers to plugins --- openlp/plugins/bibles/bibleplugin.py | 14 ++++++++++++-- openlp/plugins/custom/customplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 12 +++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index d3ca64f81..01e90a40c 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -24,7 +24,8 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * from openlp.core.resources import * -from openlp.core.lib import Plugin +from openlp.core.lib import Plugin, Event +from openlp.core.lib import EventType from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem from openlp.plugins.bibles.lib.tables import * @@ -76,4 +77,13 @@ class BiblePlugin(Plugin): def onBibleNewClick(self): self.bibleimportform = BibleImportForm(self.config, self.biblemanager, self) self.bibleimportform.exec_() - pass + pass + + def handle_event(self, event): + """ + Handle the event contained in the event object. + """ + log.debug(u'Handle event called with event %s'%event.event_type) + if event.event_type == EventType.ThemeListChanged: + log.debug(u'New Theme request received') + #self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index f12b51cec..6fedff34e 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -56,7 +56,7 @@ class CustomPlugin(Plugin): """ Handle the event contained in the event object. """ - log.debug(u'Handle event called with event %s' %event.event_type) + log.debug(u'Handle event called with event %s'%event.event_type) if event.event_type == EventType.ThemeListChanged: log.debug(u'New Theme request received') self.edit_custom_form.loadThemes(self.theme_manager.getThemes()) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 715ec2c03..508b6480e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -22,7 +22,8 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.resources import * -from openlp.core.lib import Plugin +from openlp.core.lib import Plugin, Event +from openlp.core.lib import EventType from openlp.plugins.songs.lib import SongManager, SongsTab, SongMediaItem from openlp.plugins.songs.forms import OpenLPImportForm, OpenSongExportForm, \ OpenSongImportForm, OpenLPExportForm @@ -122,3 +123,12 @@ class SongsPlugin(Plugin): def onExportOpenSongItemClicked(self): self.opensong_export_form.show() + + def handle_event(self, event): + """ + Handle the event contained in the event object. + """ + log.debug(u'Handle event called with event %s'%event.event_type) + if event.event_type == EventType.ThemeListChanged: + log.debug(u'New Theme request received') + #self.edit_custom_form.loadThemes(self.theme_manager.getThemes())