Presentation changes - Items to service Manager

This commit is contained in:
Tim Bentley 2009-08-31 15:04:00 +01:00
parent c35c26b866
commit 4c2b9fe426
4 changed files with 9 additions and 8 deletions

View File

@ -35,7 +35,7 @@ log.setLevel(logging.INFO)
logfile = logging.handlers.TimedRotatingFileHandler(filename , 'midnight', 1, backupCount=5) logfile = logging.handlers.TimedRotatingFileHandler(filename , 'midnight', 1, backupCount=5)
logfile.setLevel(logging.DEBUG) logfile.setLevel(logging.DEBUG)
logfile.setFormatter(logging.Formatter(u'%(asctime)s:%(msecs)3d %(name)-15s %(levelname)-8s %(message)s')) logfile.setFormatter(logging.Formatter(u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))
log.addHandler(logfile) log.addHandler(logfile)

View File

@ -135,7 +135,7 @@ class ServiceItem(object):
frame_title = frame_title.split(u'\n')[0] frame_title = frame_title.split(u'\n')[0]
self.service_frames.append({u'title': frame_title, u'raw_slide': raw_slide}) self.service_frames.append({u'title': frame_title, u'raw_slide': raw_slide})
def add_from_command(self, frame_title, command): def add_from_command(self, path , frame_title, command):
""" """
Add a slide from a command. Add a slide from a command.
@ -146,6 +146,7 @@ class ServiceItem(object):
The command of/for the slide. The command of/for the slide.
""" """
self.service_item_type = ServiceType.Command self.service_item_type = ServiceType.Command
self.service_item_path = path
self.service_frames.append({u'title': frame_title, u'command': command}) self.service_frames.append({u'title': frame_title, u'command': command})
def get_oos_repr(self): def get_oos_repr(self):

View File

@ -228,6 +228,7 @@ class SlideController(QtGui.QWidget):
request the correct the toolbar of the plugin request the correct the toolbar of the plugin
Called by plugins Called by plugins
""" """
log.debug(u'addServiceItem')
item.render() item.render()
self.enableToolBar(item) self.enableToolBar(item)
self.displayServiceManagerItems(item, 0) self.displayServiceManagerItems(item, 0)
@ -238,6 +239,7 @@ class SlideController(QtGui.QWidget):
request the correct the toolbar of the plugin request the correct the toolbar of the plugin
Called by ServiceManager Called by ServiceManager
""" """
log.debug(u'addServiceItem')
self.enableToolBar(item) self.enableToolBar(item)
self.displayServiceManagerItems(item, slideno) self.displayServiceManagerItems(item, slideno)
@ -246,7 +248,7 @@ class SlideController(QtGui.QWidget):
Loads a ServiceItem into the system from ServiceManager Loads a ServiceItem into the system from ServiceManager
Display the slide number passed Display the slide number passed
""" """
log.debug(u'add Service Manager Item') log.debug(u'displayServiceManagerItems Start')
self.serviceitem = serviceitem self.serviceitem = serviceitem
slide_pixmap = QtGui.QPixmap.fromImage(self.serviceitem.frames[0][u'image']) slide_pixmap = QtGui.QPixmap.fromImage(self.serviceitem.frames[0][u'image'])
slide_width = 300 slide_width = 300
@ -273,6 +275,7 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.selectRow(slideno) self.PreviewListWidget.selectRow(slideno)
self.onSlideSelected() self.onSlideSelected()
self.PreviewListWidget.setFocus() self.PreviewListWidget.setFocus()
log.debug(u'displayServiceManagerItems End')
#Screen event methods #Screen event methods
def onSlideSelectedFirst(self): def onSlideSelectedFirst(self):

View File

@ -43,7 +43,7 @@ class PresentationMediaItem(MediaManagerItem):
self.controllers = controllers self.controllers = controllers
self.TranslationContext = u'PresentationPlugin' self.TranslationContext = u'PresentationPlugin'
self.PluginTextShort = u'Presentation' self.PluginTextShort = u'Presentation'
self.ConfigSection = u'presentation' self.ConfigSection = u'presentations'
self.hasFileIcon = True self.hasFileIcon = True
self.hasNewIcon = False self.hasNewIcon = False
self.hasEditIcon = False self.hasEditIcon = False
@ -81,9 +81,6 @@ class PresentationMediaItem(MediaManagerItem):
for item in self.controllers: for item in self.controllers:
#load the drop down selection #load the drop down selection
self.DisplayTypeComboBox.addItem(item) self.DisplayTypeComboBox.addItem(item)
#load the preview toolbars
#self.parent.preview_controller.registerToolbar(item, self.controllers[item])
#self.parent.live_controller.registerToolbar(item, self.controllers[item])
def loadList(self, list): def loadList(self, list):
for file in list: for file in list:
@ -109,4 +106,4 @@ class PresentationMediaItem(MediaManagerItem):
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
frame = QtGui.QImage(unicode(filename)) frame = QtGui.QImage(unicode(filename))
(path, name) = os.path.split(filename) (path, name) = os.path.split(filename)
service_item.add_using_toolbar(path, name) service_item.add_from_command(path, name, frame)