diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 800af1d2a..dbdb70a96 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -593,9 +593,5 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): title = u'%s - %s*' % (self.mainTitle, service_name) self.setWindowTitle(title) - def handle_event(self, event): - if event.event_type == EventType.ThemeListChanged: - self.ServiceManagerContents.updateThemeList(event.payload) - self.settingsForm.ThemesTab.updateThemeList(event.payload) - self.DefaultThemeLabel.setText(self.defaultThemeText + \ - self.ThemeManagerContents.getDefault()) + def DefaultThemeChanged(self, theme): + self.DefaultThemeLabel.setText(self.defaultThemeText + theme) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c20a19bed..eaac4a3d2 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -159,6 +159,8 @@ class ServiceManager(QtGui.QWidget): QtCore.SIGNAL(u'itemCollapsed(QTreeWidgetItem*)'), self.collapsed) QtCore.QObject.connect(self.ServiceManagerList, QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'update_themes'), self.updateThemeList) # Last little bits of setting up self.config = PluginConfig(u'ServiceManager') self.servicePath = self.config.get_data_path() diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 7b18a9917..489749e94 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate, Receiver class ThemesTab(SettingsTab): """ @@ -98,6 +98,8 @@ class ThemesTab(SettingsTab): QtCore.QObject.connect(self.DefaultComboBox, QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'update_themes'), self.updateThemeList) def retranslateUi(self): self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme')) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 5eeabb514..b3ba5c94b 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -65,18 +65,6 @@ class BiblePlugin(Plugin): export_menu.addAction(self.ExportBibleItem) self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible')) - def initialise(self): - pass - def onBibleNewClick(self): self.media_item.onBibleNewClick() - def handle_event(self, event): - """ - Handle the event contained in the event object. - """ - 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.bibles_tab.updateThemeList(event.payload) - return Plugin.handle_event(self, event) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index a4bf46363..a9743abd5 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -21,7 +21,7 @@ import logging from PyQt4 import Qt, QtCore, QtGui -from openlp.core.lib import translate, str_to_bool +from openlp.core.lib import translate, str_to_bool, Receiver from openlp.core.lib import SettingsTab class BiblesTab(SettingsTab): @@ -146,6 +146,8 @@ class BiblesTab(SettingsTab): QtCore.SIGNAL(u'activated(int)'), self.onBibleThemeComboBoxChanged) QtCore.QObject.connect(self.LayoutStyleComboBox, QtCore.SIGNAL(u'activated(int)'), self.onLayoutStyleComboBoxChanged) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'update_themes'), self.updateThemeList) def retranslateUi(self): self.VerseDisplayGroupBox.setTitle(translate(u'SettingsForm', u'Verse Display')) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index fa2850a19..368bcbf07 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -42,20 +42,8 @@ class CustomPlugin(Plugin): self.icon = QtGui.QIcon() self.icon.addPixmap(QtGui.QPixmap(u':/media/media_custom.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) - # passed with drag and drop messages - self.dnd_id=u'Custom' def get_media_manager_item(self): # Create the CustomManagerItem object self.media_item = CustomMediaItem(self, self.icon, u'Custom Slides') return self.media_item - - def handle_event(self, event): - """ - Handle the event contained in the event object. - """ - 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(event.payload) - return Plugin.handle_event(self, event) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index a7b48bd12..fe9b24230 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA from PyQt4 import Qt, QtCore, QtGui from editcustomdialog import Ui_customEditDialog -from openlp.core.lib import SongXMLBuilder, SongXMLParser +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.plugins.custom.lib.models import CustomSlide class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): @@ -50,6 +50,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'), self.onVerseListViewSelected) QtCore.QObject.connect(self.VerseListView, QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), self.onVerseListViewPressed) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'update_themes'), self.loadThemest) # Create other objects and forms self.custommanager = custommanager self.initialise() diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 8a49b8c74..48471f826 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -37,8 +37,6 @@ class ImagePlugin(Plugin): self.icon = QtGui.QIcon() self.icon.addPixmap(QtGui.QPixmap(u':/media/media_image.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) - # passed with drag and drop messages - self.dnd_id = u'Image' def get_settings_tab(self): self.ImageTab = ImageTab() diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 443372b7a..560b23be5 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -28,7 +28,7 @@ from openlp.plugins.images.lib.imagetoolbar import ImageToolbar # in order for DnD to the Service manager to work correctly. class ImageListView(BaseListWithDnD): def __init__(self, parent=None): - self.PluginName = u'Image' + self.PluginName = u'Images' BaseListWithDnD.__init__(self, parent) class ImageMediaItem(MediaManagerItem): diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 6bfd06cf0..52f91b1e1 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -23,7 +23,7 @@ import logging from PyQt4 import Qt, QtCore, QtGui from openlp.core.lib import SongXMLBuilder, SongXMLParser, Event, \ - EventType, EventManager, translate + EventType, EventManager, translate, Receiver from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib.models import Song from editsongdialog import Ui_EditSongDialog @@ -71,6 +71,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.SIGNAL(u'activated(int)'), self.onThemeComboChanged) QtCore.QObject.connect(self.MaintenanceButton, QtCore.SIGNAL(u'clicked()'), self.onMaintenanceButtonClicked) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'update_themes'), self.loadThemes) # Create other objects and forms self.songmanager = songmanager self.eventmanager = eventmanager diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 48fe8fcdb..4413798db 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -132,9 +132,6 @@ class SongsPlugin(Plugin): 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.media_item.edit_song_form.loadThemes(event.payload) if event.event_type == EventType.LoadSongList : log.debug(u'Load Load Song List Item received') self.media_item.displayResultsSong(self.songmanager.get_songs())