From 848eb601af248a8b4e74546b73ebdb1a3a304abd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 14:24:41 +0000 Subject: [PATCH 1/4] Fix NONE appearing as song verses Delay the hidden window display Fix missing add status for custom slides --- openlp/core/lib/songxmlhandler.py | 4 ++++ openlp/core/ui/mainwindow.py | 7 ++++++- openlp/plugins/custom/forms/editcustomform.py | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 7a532970d..076523545 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -147,9 +147,13 @@ class SongXMLParser(object): iter = self.song_xml.getiterator() verse_list = [] for element in iter: + print element.tag, element.text if element.tag == u'verse': + if element.text is None: + element.text = u'' verse_list.append([element.attrib, unicode(element.text).decode('unicode-escape')]) + print verse_list return verse_list def dump_xml(self): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ab2eaf7d8..30530669c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -67,7 +67,8 @@ class VersionThread(QtCore.QThread): """ Run the thread. """ - time.sleep(2) + time.sleep(1) + Receiver.send_message(u'blank_check') version = check_latest_version(self.generalConfig, self.app_version) #new version has arrived if version != self.app_version: @@ -493,6 +494,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'version_check'), self.versionCheck) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'blank_check'), self.blankCheck) QtCore.QObject.connect(self.FileNewItem, QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService) @@ -582,6 +585,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.activateWindow() if str_to_bool(self.generalConfig.get_config(u'auto open', False)): self.ServiceManagerContents.onLoadService(True) + + def blankCheck(self): if str_to_bool(self.generalConfig.get_config(u'screen blank', False)) \ and str_to_bool(self.generalConfig.get_config(u'blank warning', False)): self.LiveController.onBlankDisplay(True) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index b4402ceb3..bb2607a74 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -87,6 +87,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def initialise(self): self.editAll = False + self.AddButton.setEnabled(True) self.DeleteButton.setEnabled(False) self.EditButton.setEnabled(False) self.EditAllButton.setEnabled(True) From 8f692d13be2abe0e56f5342cfdbf768f3b0627e8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 14:30:18 +0000 Subject: [PATCH 2/4] Remove prints --- openlp/core/lib/songxmlhandler.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 076523545..12b0c2d47 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -147,13 +147,11 @@ class SongXMLParser(object): iter = self.song_xml.getiterator() verse_list = [] for element in iter: - print element.tag, element.text if element.tag == u'verse': if element.text is None: element.text = u'' verse_list.append([element.attrib, unicode(element.text).decode('unicode-escape')]) - print verse_list return verse_list def dump_xml(self): From 2d43cd2d8a19d9b1dd089b4af13a996f8342bf37 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 15:08:46 +0000 Subject: [PATCH 3/4] Stop double loading of service items --- openlp/core/ui/slidecontroller.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 08583cb54..b6392a4d7 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -419,6 +419,11 @@ class SlideController(QtGui.QWidget): Called by ServiceManager """ log.debug(u'addServiceManagerItem') + #If service item is the same as the current on only change slide + if item.__eq__(self.serviceItem): + self.PreviewListWidget.selectRow(slideno) + self.onSlideSelected() + return #If old item was a command tell it to stop if self.serviceItem and self.serviceItem.is_command(): self.onMediaStop() From 3e4683bd6dff627eb82ad492f4ea31c8fd545055 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 17:56:56 +0000 Subject: [PATCH 4/4] Fix up issues and confusion with service item edit --- openlp/core/ui/slidecontroller.py | 37 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index b6392a4d7..51ad5b6b9 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -403,14 +403,14 @@ class SlideController(QtGui.QWidget): if self.songEdit: slideno = self.selectedRow self.songEdit = False - self.addServiceManagerItem(item, slideno) + self._processItem(item, slideno) def replaceServiceManagerItem(self, item): """ Replacement item following a remote edit """ if item.__eq__(self.serviceItem): - self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) + self._processItem(item, self.PreviewListWidget.currentRow()) def addServiceManagerItem(self, item, slideno): """ @@ -424,27 +424,27 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.selectRow(slideno) self.onSlideSelected() return - #If old item was a command tell it to stop - if self.serviceItem and self.serviceItem.is_command(): - self.onMediaStop() - if item.is_media(): - self.onMediaStart(item) - elif item.is_command(): - if self.isLive: - blanked = self.blankButton.isChecked() - else: - blanked = False - Receiver.send_message(u'%s_start' % item.name.lower(), \ - [item.title, item.service_item_path, - item.get_frame_title(), slideno, self.isLive, blanked]) - self.displayServiceManagerItems(item, slideno) + self._processItem(item, slideno) - def displayServiceManagerItems(self, serviceItem, slideno): + def _processItem(self, serviceItem, slideno): """ Loads a ServiceItem into the system from ServiceManager Display the slide number passed """ - log.debug(u'displayServiceManagerItems Start') + log.debug(u'processsManagerItem') + #If old item was a command tell it to stop + if self.serviceItem and self.serviceItem.is_command(): + self.onMediaStop() + if serviceItem.is_media(): + self.onMediaStart(serviceItem) + elif serviceItem.is_command(): + if self.isLive: + blanked = self.blankButton.isChecked() + else: + blanked = False + Receiver.send_message(u'%s_start' % serviceItem.name.lower(), \ + [serviceItem.title, serviceItem.service_item_path, + serviceItem.get_frame_title(), slideno, self.isLive, blanked]) self.slideList = {} width = self.parent.ControlSplitter.sizes()[self.split] #Set pointing cursor when we have somthing to point at @@ -508,7 +508,6 @@ class SlideController(QtGui.QWidget): log.log(15, u'Display Rendering took %4s' % (time.time() - before)) if self.isLive: self.serviceItem.request_audit() - log.debug(u'displayServiceManagerItems End') #Screen event methods def onSlideSelectedFirst(self):