Fixed a but in unicode conversions.

This commit is contained in:
Raoul Snyman 2010-03-21 22:33:57 +02:00
commit 12a7222eb1
4 changed files with 11 additions and 3 deletions

View File

@ -148,6 +148,8 @@ class SongXMLParser(object):
verse_list = []
for element in iter:
if element.tag == u'verse':
if element.text is None:
element.text = u''
verse_list.append([element.attrib,
unicode(element.text).decode('unicode-escape')])
return verse_list

View File

@ -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)

View File

@ -347,8 +347,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
self.BibleComboBox.currentText()]
importer = self.manager.import_bible(BibleFormat.WebDownload,
name=unicode(self.field(u'license_version').toString(), u'utf8'),
download_source=unicode(DownloadLocation.get_name(download_location)),
download_name=unicode(bible, u'utf8'),
download_source=DownloadLocation.get_name(download_location),
download_name=bible,
proxy_server=unicode(self.field(u'proxy_server').toString(), u'utf8'),
proxy_username=unicode(self.field(u'proxy_username').toString(), u'utf8'),
proxy_password=unicode(self.field(u'proxy_password').toString(), u'utf8')

View File

@ -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)