From 4c2b9fe426aa7f16fa36852b692109d45544b3d8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 31 Aug 2009 15:04:00 +0100 Subject: [PATCH] Presentation changes - Items to service Manager --- openlp.pyw | 2 +- openlp/core/lib/serviceitem.py | 3 ++- openlp/core/ui/slidecontroller.py | 5 ++++- openlp/plugins/presentations/lib/mediaitem.py | 7 ++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 27d2e05e0..f3bd74d5f 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -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) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index a1985b427..7a41f8986 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -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): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4b6da2caf..1005a568a 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -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): diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index d65516e37..6ab7f7ac4 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -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)