Fix ServiceType -> ServiceItemType change

This commit is contained in:
Jon Tibble 2009-10-23 23:54:29 +01:00
parent 27d92e9202
commit fac8bb8dd3
3 changed files with 18 additions and 17 deletions

View File

@ -128,7 +128,7 @@ from settingstab import SettingsTab
from mediamanageritem import MediaManagerItem from mediamanageritem import MediaManagerItem
from xmlrootclass import XmlRootClass from xmlrootclass import XmlRootClass
from serviceitem import ServiceItem from serviceitem import ServiceItem
from serviceitem import ServiceType from serviceitem import ServiceItemType
from serviceitem import ServiceItem from serviceitem import ServiceItem
from toolbar import OpenLPToolbar from toolbar import OpenLPToolbar
from dockwidget import OpenLPDockWidget from dockwidget import OpenLPDockWidget

View File

@ -30,7 +30,8 @@ import zipfile
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
translate, ServiceType, contextMenuAction, contextMenuSeparator, Receiver translate, ServiceItemType, contextMenuAction, contextMenuSeparator, \
Receiver
class ServiceManagerList(QtGui.QTreeWidget): class ServiceManagerList(QtGui.QTreeWidget):
@ -398,8 +399,8 @@ class ServiceManager(QtGui.QWidget):
for item in self.serviceItems: for item in self.serviceItems:
service.append( service.append(
{u'serviceitem':item[u'data'].get_service_repr()}) {u'serviceitem':item[u'data'].get_service_repr()})
if item[u'data'].service_item_type == ServiceType.Image or \ if item[u'data'].service_item_type == ServiceItemType.Image or \
item[u'data'].service_item_type == ServiceType.Command: item[u'data'].service_item_type == ServiceItemType.Command:
for frame in item[u'data'].frames: for frame in item[u'data'].frames:
path_from = unicode(os.path.join( path_from = unicode(os.path.join(
item[u'data'].service_item_path, frame[u'title'])) item[u'data'].service_item_path, frame[u'title']))

View File

@ -26,7 +26,7 @@ import logging
import time import time
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceItemType
label_stylesheet = u""" label_stylesheet = u"""
QTableWidget::item:selected QTableWidget::item:selected
@ -244,9 +244,9 @@ class SlideController(QtGui.QWidget):
""" """
Allows the live toolbar to be customised Allows the live toolbar to be customised
""" """
if item.service_item_type == ServiceType.Text: if item.service_item_type == ServiceItemType.Text:
self.Toolbar.makeWidgetsInvisible(self.image_list) self.Toolbar.makeWidgetsInvisible(self.image_list)
elif item.service_item_type == ServiceType.Image: elif item.service_item_type == ServiceItemType.Image:
#Not sensible to allow loops with 1 frame #Not sensible to allow loops with 1 frame
if len(item.frames) > 1: if len(item.frames) > 1:
self.Toolbar.makeWidgetsVisible(self.image_list) self.Toolbar.makeWidgetsVisible(self.image_list)
@ -268,14 +268,14 @@ class SlideController(QtGui.QWidget):
log.debug(u'addServiceItem') log.debug(u'addServiceItem')
#If old item was a command tell it to stop #If old item was a command tell it to stop
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
self.commandItem = item self.commandItem = item
before = time.time() before = time.time()
item.render() item.render()
log.info(u'Rendering took %4s' % (time.time() - before)) log.info(u'Rendering took %4s' % (time.time() - before))
self.enableToolBar(item) self.enableToolBar(item)
if item.service_item_type == ServiceType.Command: if item.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_start' % item.name.lower(), \ Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path, [item.shortname, item.service_item_path,
item.service_frames[0][u'title']]) item.service_frames[0][u'title']])
@ -290,11 +290,11 @@ class SlideController(QtGui.QWidget):
log.debug(u'addServiceItem') log.debug(u'addServiceItem')
#If old item was a command tell it to stop #If old item was a command tell it to stop
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower()) Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
self.commandItem = item self.commandItem = item
self.enableToolBar(item) self.enableToolBar(item)
if item.service_item_type == ServiceType.Command: if item.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_start' % item.name.lower(), \ Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path, [item.shortname, item.service_item_path,
item.service_frames[0][u'title'], slideno]) item.service_frames[0][u'title'], slideno])
@ -351,7 +351,7 @@ class SlideController(QtGui.QWidget):
Go to the first slide. Go to the first slide.
""" """
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_first'% self.commandItem.name.lower()) Receiver().send_message(u'%s_first'% self.commandItem.name.lower())
else: else:
self.PreviewListWidget.selectRow(0) self.PreviewListWidget.selectRow(0)
@ -362,7 +362,7 @@ class SlideController(QtGui.QWidget):
Blank the screen. Blank the screen.
""" """
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
if blanked: if blanked:
Receiver().send_message(u'%s_blank'% self.commandItem.name.lower()) Receiver().send_message(u'%s_blank'% self.commandItem.name.lower())
else: else:
@ -377,7 +377,7 @@ class SlideController(QtGui.QWidget):
""" """
row = self.PreviewListWidget.currentRow() row = self.PreviewListWidget.currentRow()
if row > -1 and row < self.PreviewListWidget.rowCount(): if row > -1 and row < self.PreviewListWidget.rowCount():
if self.commandItem.service_item_type == ServiceType.Command: if self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row]) Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
else: else:
#label = self.PreviewListWidget.cellWidget(row, 0) #label = self.PreviewListWidget.cellWidget(row, 0)
@ -395,7 +395,7 @@ class SlideController(QtGui.QWidget):
Go to the next slide. Go to the next slide.
""" """
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_next'% self.commandItem.name.lower()) Receiver().send_message(u'%s_next'% self.commandItem.name.lower())
else: else:
row = self.PreviewListWidget.currentRow() + 1 row = self.PreviewListWidget.currentRow() + 1
@ -409,7 +409,7 @@ class SlideController(QtGui.QWidget):
Go to the previous slide. Go to the previous slide.
""" """
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message( Receiver().send_message(
u'%s_previous'% self.commandItem.name.lower()) u'%s_previous'% self.commandItem.name.lower())
else: else:
@ -424,7 +424,7 @@ class SlideController(QtGui.QWidget):
Go to the last slide. Go to the last slide.
""" """
if self.commandItem is not None and \ if self.commandItem is not None and \
self.commandItem.service_item_type == ServiceType.Command: self.commandItem.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_last'% self.commandItem.name.lower()) Receiver().send_message(u'%s_last'% self.commandItem.name.lower())
else: else:
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1) self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)