Fixes and cleanups following MediaManager Merge

This commit is contained in:
Tim Bentley 2009-06-26 18:51:43 +01:00
parent 46967d9ef9
commit b76790bc2f
6 changed files with 43 additions and 52 deletions

View File

@ -41,6 +41,9 @@ class BiblePlugin(Plugin):
QtGui.QIcon.Normal, QtGui.QIcon.Off)
#Register the bible Manager
self.biblemanager = BibleManager(self.config)
# passed with drag and drop messages
self.dnd_id = u'Bibles'
def get_settings_tab(self):
self.bibles_tab = BiblesTab()
@ -79,12 +82,4 @@ class BiblePlugin(Plugin):
if event.event_type == EventType.ThemeListChanged:
log.debug(u'New Theme request received')
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()
if event.event_type == EventType.PreviewShow and event.payload == 'Bibles':
log.debug(u'Load Preview Item received')
self.media_item.onBiblePreviewClick()
if event.event_type == EventType.LiveShow and event.payload == 'Bibles':
log.debug(u'Load Live Show Item received')
self.media_item.onBibleLiveClick()
Plugin.handle_event(self, event)

View File

@ -54,6 +54,11 @@ class BibleMediaItem(MediaManagerItem):
log.info(u'Bible Media Item loaded')
def __init__(self, parent, icon, title):
self.TranslationContext = u'BiblePlugin'
self.PluginTextShort = u'Bible'
self.ConfigSection = u'bibles'
# self.OnNewPrompt = u'Select Image(s)'
# self.OnNewFileMasks = u'Images (*.jpg *jpeg *.gif *.png *.bmp)'
MediaManagerItem.__init__(self, parent, icon, title)
self.search_results = {} # place to store the search results
QtCore.QObject.connect(Receiver().get_receiver(),
@ -74,18 +79,18 @@ class BibleMediaItem(MediaManagerItem):
self.addToolbarButton(
translate(u'BibleMediaItem',u'Preview Bible'),
translate(u'BibleMediaItem',u'Preview the selected Bible Verse'),
u':/system/system_preview.png', self.onBiblePreviewClick, u'BiblePreviewItem')
u':/system/system_preview.png', self.onPreviewClick, u'BiblePreviewItem')
## Live Bible Button ##
self.addToolbarButton(
translate(u'BibleMediaItem',u'Go Live'),
translate(u'BibleMediaItem',u'Send the selected Bible Verse(s) live'),
u':/system/system_live.png', self.onBibleLiveClick, u'BibleLiveItem')
u':/system/system_live.png', self.onLiveClick, u'BibleLiveItem')
## Add Bible Button ##
self.addToolbarButton(
translate(u'BibleMediaItem',u'Add Bible Verse(s) To Service'),
translate(u'BibleMediaItem',u'Add the selected Bible(s) to the service'),
u':/system/system_add.png',
self.onBibleAddClick, u'BibleAddItem')
self.onAddClick, u'BibleAddItem')
# Create the tab widget
self.SearchTabWidget = QtGui.QTabWidget(self)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
@ -209,18 +214,18 @@ class BibleMediaItem(MediaManagerItem):
QtCore.QObject.connect(self.QuickSearchButton,
QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton)
QtCore.QObject.connect(self.BibleListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onBiblePreviewClick)
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick)
# Context Menus
self.BibleListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.BibleListWidget.addAction(self.contextMenuAction(
self.BibleListWidget, u':/system/system_preview.png',
translate(u'BibleMediaItem',u'&Preview Verse'), self.onBiblePreviewClick))
translate(u'BibleMediaItem',u'&Preview Verse'), self.onPreviewClick))
self.BibleListWidget.addAction(self.contextMenuAction(
self.BibleListWidget, u':/system/system_live.png',
translate(u'BibleMediaItem',u'&Show Live'), self.onBibleLiveClick))
translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick))
self.BibleListWidget.addAction(self.contextMenuAction(
self.BibleListWidget, u':/system/system_add.png',
translate(u'BibleMediaItem',u'&Add to Service'), self.onBibleAddClick))
translate(u'BibleMediaItem',u'&Add to Service'), self.onAddClick))
def retranslateUi(self):
log.debug(u'retranslateUi')
@ -330,23 +335,23 @@ class BibleMediaItem(MediaManagerItem):
if self.search_results is not None:
self.displayResults(bible)
def onBibleLiveClick(self):
service_item = ServiceItem(self.parent)
service_item.addIcon( u':/media/media_verse.png')
self.generateSlideData(service_item)
self.parent.live_controller.addServiceItem(service_item)
def onBibleAddClick(self):
service_item = ServiceItem(self.parent)
service_item.addIcon(u':/media/media_verse.png')
self.generateSlideData(service_item)
self.parent.service_manager.addServiceItem(service_item)
def onBiblePreviewClick(self):
service_item = ServiceItem(self.parent)
service_item.addIcon(u':/media/media_verse.png')
self.generateSlideData(service_item)
self.parent.preview_controller.addServiceItem(service_item)
# def onLiveClick(self):
# service_item = ServiceItem(self.parent)
# service_item.addIcon( u':/media/media_verse.png')
# self.generateSlideData(service_item)
# self.parent.live_controller.addServiceItem(service_item)
#
# def onAddClick(self):
# service_item = ServiceItem(self.parent)
# service_item.addIcon(u':/media/media_verse.png')
# self.generateSlideData(service_item)
# self.parent.service_manager.addServiceItem(service_item)
#
# def onPreviewClick(self):
# service_item = ServiceItem(self.parent)
# service_item.addIcon(u':/media/media_verse.png')
# self.generateSlideData(service_item)
# self.parent.preview_controller.addServiceItem(service_item)
def generateSlideData(self, service_item):
log.debug(u'generating slide data')

View File

@ -42,6 +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
@ -56,12 +58,4 @@ class CustomPlugin(Plugin):
if event.event_type == EventType.ThemeListChanged:
log.debug(u'New Theme request received')
self.edit_custom_form.loadThemes(self.theme_manager.getThemes())
if event.event_type == EventType.LoadServiceItem and event.payload == 'Custom':
log.debug(u'Load Service Item received')
self.media_item.onCustomAddClick()
if event.event_type == EventType.PreviewShow and event.payload == 'Custom':
log.debug(u'Load Preview Item received ')
self.media_item.onCustomPreviewClick()
if event.event_type == EventType.LiveShow and event.payload == 'Custom':
log.debug(u'Load Live Show Item received')
self.media_item.onCustomLiveClick()
Plugin.handle_event(self, event)

View File

@ -37,7 +37,8 @@ class ImagePlugin(Plugin):
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(u':/media/media_image.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.dnd_id = u'Image' # passed with drag and drop messages
# passed with drag and drop messages
self.dnd_id = u'Image'
def get_media_manager_item(self):
# Create the MediaManagerItem object

View File

@ -33,6 +33,8 @@ class MediaPlugin(Plugin):
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(u':/media/media_video.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
# passed with drag and drop messages
self.dnd_id=u'Media'
def get_settings_tab(self):
self.MediaTab = MediaTab()

View File

@ -45,6 +45,8 @@ class SongsPlugin(Plugin):
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(u':/media/media_song.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
# passed with drag and drop messages
self.dnd_id=u'Songs'
def get_media_manager_item(self):
# Create the MediaManagerItem object
@ -125,15 +127,7 @@ class SongsPlugin(Plugin):
if event.event_type == EventType.ThemeListChanged:
log.debug(u'New Theme request received')
self.media_item.edit_song_form.loadThemes(self.theme_manager.getThemes())
if event.event_type == EventType.LoadServiceItem and event.payload == 'Song':
log.debug(u'Load Service Item received')
self.media_item.onSongAddClick()
if event.event_type == EventType.PreviewShow and event.payload == 'Song':
log.debug(u'Load Preview Item received ')
self.media_item.onSongPreviewClick()
if event.event_type == EventType.LiveShow and event.payload == 'Song':
log.debug(u'Load Live Show Item received')
self.media_item.onSongLiveClick()
if event.event_type == EventType.LoadSongList :
log.debug(u'Load Load Song List Item received')
self.media_item.displayResultsSong(self.songmanager.get_songs())
Plugin.handle_event(self, event)