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.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)

View File

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

View File

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

View File

@ -43,7 +43,7 @@ class PresentationMediaItem(MediaManagerItem):
self.controllers = controllers
self.TranslationContext = u'PresentationPlugin'
self.PluginTextShort = u'Presentation'
self.ConfigSection = u'presentation'
self.ConfigSection = u'presentations'
self.hasFileIcon = True
self.hasNewIcon = False
self.hasEditIcon = False
@ -81,9 +81,6 @@ class PresentationMediaItem(MediaManagerItem):
for item in self.controllers:
#load the drop down selection
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):
for file in list:
@ -109,4 +106,4 @@ class PresentationMediaItem(MediaManagerItem):
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
frame = QtGui.QImage(unicode(filename))
(path, name) = os.path.split(filename)
service_item.add_using_toolbar(path, name)
service_item.add_from_command(path, name, frame)