Fix bibles and themes

bzr-revno: 688
This commit is contained in:
Tim Bentley 2009-12-11 19:20:49 +00:00
commit 812a332182
5 changed files with 9 additions and 9 deletions

View File

@ -289,6 +289,7 @@ class SlideController(QtGui.QWidget):
width = self.parent.ControlSplitter.sizes()[self.split] width = self.parent.ControlSplitter.sizes()[self.split]
height = width * self.parent.RenderManager.screen_ratio height = width * self.parent.RenderManager.screen_ratio
self.PreviewListWidget.setColumnWidth(0, width) self.PreviewListWidget.setColumnWidth(0, width)
#Sort out image hights (Songs , bibles excluded)
if self.serviceItem and not self.serviceItem.is_text(): if self.serviceItem and not self.serviceItem.is_text():
for framenumber, frame in enumerate(self.serviceItem.get_frames()): for framenumber, frame in enumerate(self.serviceItem.get_frames()):
self.PreviewListWidget.setRowHeight(framenumber, height) self.PreviewListWidget.setRowHeight(framenumber, height)
@ -301,7 +302,6 @@ class SlideController(QtGui.QWidget):
def onSongBarHandler(self): def onSongBarHandler(self):
request = unicode(self.sender().text()) request = unicode(self.sender().text())
#Remember list is 1 out!
slideno = self.slideList[request] slideno = self.slideList[request]
if slideno > self.PreviewListWidget.rowCount(): if slideno > self.PreviewListWidget.rowCount():
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount()) self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount())
@ -428,6 +428,7 @@ class SlideController(QtGui.QWidget):
#only load the slot once #only load the slot once
bits = frame[u'verseTag'].split(u':') bits = frame[u'verseTag'].split(u':')
tag = None tag = None
#If verse handle verse number else tag only
if bits[0] == self.trUtf8('Verse'): if bits[0] == self.trUtf8('Verse'):
tag = u'%s%s' % (bits[0][0], bits[1][0] ) tag = u'%s%s' % (bits[0][0], bits[1][0] )
else: else:

View File

@ -473,7 +473,7 @@ class ThemeManager(QtGui.QWidget):
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
unicode(12), u'False', u'footer') unicode(12), u'False', u'footer')
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', 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() return newtheme.extract_xml()
def createThemeFromXml(self, theme_xml, path): def createThemeFromXml(self, theme_xml, path):

View File

@ -232,11 +232,11 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog):
def incrementProgressBar(self, text ): def incrementProgressBar(self, text ):
log.debug(u'IncrementBar %s', text) log.debug(u'IncrementBar %s', text)
self.MessageLabel.setText(self.trUtf8('Import processing %s') % text) self.MessageLabel.setText(unicode(self.trUtf8('Import processing')) + ' - %s' % text)
self.ProgressBar.setValue(self.ProgressBar.value() + 1) self.ProgressBar.setValue(self.ProgressBar.value() + 1)
def importBible(self): def importBible(self):
log.debug(u'Import Bible') log.debug(u'Import Bible %s' % self.bible_type)
message = None message = None
if self.bible_type == u'OSIS': if self.bible_type == u'OSIS':
loaded = self.biblemanager.register_osis_file_bible( loaded = self.biblemanager.register_osis_file_bible(
@ -269,7 +269,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog):
unicode(self.CopyrightEdit.displayText()), unicode(self.CopyrightEdit.displayText()),
unicode(self.PermisionEdit.displayText())) unicode(self.PermisionEdit.displayText()))
else: else:
message = self.trUtf8('Bible import failed') message = self.trUtf8('Bible import failed as name is already in use')
self.bible_type = None self.bible_type = None
# free the screen state restrictions # free the screen state restrictions
self.resetScreenFieldStates() self.resetScreenFieldStates()

View File

@ -62,17 +62,16 @@ class BibleOSISImpl():
filepath = os.path.abspath(os.path.join( filepath = os.path.abspath(os.path.join(
filepath, u'..', u'resources',u'osisbooks.csv')) filepath, u'..', u'resources',u'osisbooks.csv'))
fbibles = None fbibles = None
self.loadbible = True
try: try:
fbibles = open(filepath, u'r') fbibles = open(filepath, u'r')
for line in fbibles: for line in fbibles:
p = line.split(u',') p = line.split(u',')
self.booksOfBible[p[0]] = p[1].replace(u'\n', u'') self.booksOfBible[p[0]] = p[1].replace(u'\n', u'')
self.abbrevOfBible[p[0]] = p[2].replace(u'\n', u'') self.abbrevOfBible[p[0]] = p[2].replace(u'\n', u'')
self.loadbible = True
except: except:
log.exception(u'OSIS bible import failed') log.exception(u'OSIS bible import failed')
finally: finally:
self.loadbible = False
if fbibles: if fbibles:
fbibles.close() fbibles.close()
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
@ -95,6 +94,7 @@ class BibleOSISImpl():
The Import dialog, so that we can increase the counter on The Import dialog, so that we can increase the counter on
the progress bar. the progress bar.
""" """
log.info(u'Load data for %s' % osisfile_record)
detect_file = None detect_file = None
try: try:
detect_file = open(osisfile_record, u'r') detect_file = open(osisfile_record, u'r')
@ -174,7 +174,6 @@ class BibleOSISImpl():
testament) testament)
dialogobject.incrementProgressBar( dialogobject.incrementProgressBar(
self.booksOfBible[p[0]]) self.booksOfBible[p[0]])
Receiver.send_message(u'process_events')
count = 0 count = 0
self.bibledb.add_verse(book.id, p[1], p[2], text) self.bibledb.add_verse(book.id, p[1], p[2], text)
count += 1 count += 1

View File

@ -1 +1 @@
1.9.0-686 1.9.0-688