forked from openlp/openlp
Fix up Bible plugin and Theme manager
This commit is contained in:
parent
540f63c9de
commit
aaba983805
@ -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):
|
||||
|
@ -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()
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user