forked from openlp/openlp
EventManager Removal part 2
This commit is contained in:
parent
7226d4a232
commit
9b826aab56
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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'))
|
||||
|
@ -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)
|
||||
|
@ -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'))
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user