openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07642
[Merge] lp:~mahfiaz/openlp/some_fixes into lp:openlp
mahfiaz has proposed merging lp:~mahfiaz/openlp/some_fixes into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
Raoul Snyman (raoul-snyman)
For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/some_fixes/+merge/55699
Two fixes for errors on service file handling plus one bug fix.
--
https://code.launchpad.net/~mahfiaz/openlp/some_fixes/+merge/55699
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-03-26 19:00:47 +0000
+++ openlp/core/ui/servicemanager.py 2011-03-31 07:33:35 +0000
@@ -588,6 +588,21 @@
message=translate('OpenLP.ServiceManager',
'File could not be opened because it is corrupt.'))
log.exception(u'Problem loading service file %s' % fileName)
+ except zipfile.BadZipfile:
+ if os.path.getsize(fileName) == 0:
+ log.exception(u'Service file is zero sized: %s' % fileName)
+ QtGui.QMessageBox.information(self,
+ translate('OpenLP.ServiceManager', 'Empty File'),
+ translate('OpenLP.ServiceManager', 'This service file '
+ 'does not contain any data.'))
+ else:
+ log.exception(u'Service file is cannot be extracted as zip: '
+ u'%s' % fileName)
+ QtGui.QMessageBox.information(self,
+ translate('OpenLP.ServiceManager', 'Corrupt File'),
+ translate('OpenLP.ServiceManager', 'This file is either'
+ 'corrupt or not an OpenLP 2.0 service file.'))
+ return
finally:
if fileTo:
fileTo.close()
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2011-03-24 19:04:02 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2011-03-31 07:33:35 +0000
@@ -269,6 +269,8 @@
if index is None:
index = VerseType.Other
verse[0][u'type'] = VerseType.Tags[index]
+ if verse[0][u'label'] == u'':
+ verse[0][u'label'] = u'1'
verse_def = u'%s%s' % (verse[0][u'type'], verse[0][u'label'])
item = QtGui.QTableWidgetItem(verse[1])
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def))
Follow ups