From aaba9838050eefea1a9f7cd3446a4fc642fc0140 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 11 Dec 2009 17:40:18 +0000 Subject: [PATCH 1/2] Fix up Bible plugin and Theme manager --- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/bibles/forms/bibleimportform.py | 6 +++--- openlp/plugins/bibles/lib/bibleOSISimpl.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index c3277637b..b5c07195b 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -473,7 +473,7 @@ class ThemeManager(QtGui.QWidget): newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer') newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', - unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0)) + unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0), u'False') return newtheme.extract_xml() def createThemeFromXml(self, theme_xml, path): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 757638a7c..d09c6c79d 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -232,11 +232,11 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): def incrementProgressBar(self, text ): log.debug(u'IncrementBar %s', text) - self.MessageLabel.setText(self.trUtf8('Import processing %s') % text) + self.MessageLabel.setText(self.trUtf8(unicode(u'Import processing - %s' % text))) self.ProgressBar.setValue(self.ProgressBar.value() + 1) def importBible(self): - log.debug(u'Import Bible') + log.debug(u'Import Bible %s' % self.bible_type) message = None if self.bible_type == u'OSIS': loaded = self.biblemanager.register_osis_file_bible( @@ -269,7 +269,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): unicode(self.CopyrightEdit.displayText()), unicode(self.PermisionEdit.displayText())) else: - message = self.trUtf8('Bible import failed') + message = self.trUtf8('Bible import failed as name is already in use') self.bible_type = None # free the screen state restrictions self.resetScreenFieldStates() diff --git a/openlp/plugins/bibles/lib/bibleOSISimpl.py b/openlp/plugins/bibles/lib/bibleOSISimpl.py index 32e4db5e6..d0c1433ce 100644 --- a/openlp/plugins/bibles/lib/bibleOSISimpl.py +++ b/openlp/plugins/bibles/lib/bibleOSISimpl.py @@ -62,17 +62,16 @@ class BibleOSISImpl(): filepath = os.path.abspath(os.path.join( filepath, u'..', u'resources',u'osisbooks.csv')) fbibles = None + self.loadbible = True try: fbibles = open(filepath, u'r') for line in fbibles: p = line.split(u',') self.booksOfBible[p[0]] = p[1].replace(u'\n', u'') self.abbrevOfBible[p[0]] = p[2].replace(u'\n', u'') - self.loadbible = True except: log.exception(u'OSIS bible import failed') finally: - self.loadbible = False if fbibles: fbibles.close() QtCore.QObject.connect(Receiver.get_receiver(), @@ -95,6 +94,7 @@ class BibleOSISImpl(): The Import dialog, so that we can increase the counter on the progress bar. """ + log.info(u'Load data for %s' % osisfile_record) detect_file = None try: detect_file = open(osisfile_record, u'r') @@ -106,6 +106,7 @@ class BibleOSISImpl(): if detect_file: detect_file.close() osis = None + x = 0 try: osis = codecs.open(osisfile_record, u'r', details['encoding']) book_ptr = None @@ -116,6 +117,7 @@ class BibleOSISImpl(): # cancel pressed on UI if not self.loadbible: break + x += 1 pos = file_record.find(verseText) # we have a verse if pos > -1: From 231a2fa9339def81051b7a656920e0063b4f9412 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 11 Dec 2009 19:02:45 +0000 Subject: [PATCH 2/2] More fixes for bibles --- openlp/core/ui/slidecontroller.py | 3 ++- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/bibles/lib/bibleOSISimpl.py | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e306cea74..21c0e4d2a 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -289,6 +289,7 @@ class SlideController(QtGui.QWidget): width = self.parent.ControlSplitter.sizes()[self.split] height = width * self.parent.RenderManager.screen_ratio self.PreviewListWidget.setColumnWidth(0, width) + #Sort out image hights (Songs , bibles excluded) if self.serviceItem and not self.serviceItem.is_text(): for framenumber, frame in enumerate(self.serviceItem.get_frames()): self.PreviewListWidget.setRowHeight(framenumber, height) @@ -301,7 +302,6 @@ class SlideController(QtGui.QWidget): def onSongBarHandler(self): request = unicode(self.sender().text()) - #Remember list is 1 out! slideno = self.slideList[request] if slideno > self.PreviewListWidget.rowCount(): self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) @@ -428,6 +428,7 @@ class SlideController(QtGui.QWidget): #only load the slot once bits = frame[u'verseTag'].split(u':') tag = None + #If verse handle verse number else tag only if bits[0] == self.trUtf8('Verse'): tag = u'%s%s' % (bits[0][0], bits[1][0] ) else: diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index d09c6c79d..af2a61daa 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -232,7 +232,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): def incrementProgressBar(self, text ): log.debug(u'IncrementBar %s', text) - self.MessageLabel.setText(self.trUtf8(unicode(u'Import processing - %s' % text))) + self.MessageLabel.setText(unicode(self.trUtf8('Import processing')) + ' - %s' % text) self.ProgressBar.setValue(self.ProgressBar.value() + 1) def importBible(self): diff --git a/openlp/plugins/bibles/lib/bibleOSISimpl.py b/openlp/plugins/bibles/lib/bibleOSISimpl.py index d0c1433ce..089649b89 100644 --- a/openlp/plugins/bibles/lib/bibleOSISimpl.py +++ b/openlp/plugins/bibles/lib/bibleOSISimpl.py @@ -106,7 +106,6 @@ class BibleOSISImpl(): if detect_file: detect_file.close() osis = None - x = 0 try: osis = codecs.open(osisfile_record, u'r', details['encoding']) book_ptr = None @@ -117,7 +116,6 @@ class BibleOSISImpl(): # cancel pressed on UI if not self.loadbible: break - x += 1 pos = file_record.find(verseText) # we have a verse if pos > -1: @@ -176,7 +174,6 @@ class BibleOSISImpl(): testament) dialogobject.incrementProgressBar( self.booksOfBible[p[0]]) - Receiver.send_message(u'process_events') count = 0 self.bibledb.add_verse(book.id, p[1], p[2], text) count += 1