forked from openlp/openlp
Differentiated error message for zero sized service.
This commit is contained in:
parent
18f9632dda
commit
b502ad549c
@ -557,11 +557,19 @@ class ServiceManager(QtGui.QWidget):
|
||||
except (IOError, NameError):
|
||||
log.exception(u'Problem loading service file %s' % fileName)
|
||||
except zipfile.BadZipfile:
|
||||
log.exception(u'Service file is corrupt: %s' % fileName)
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate('OpenLP.ServiceManager', 'File Is Corrupt'),
|
||||
translate('OpenLP.ServiceManager', 'This service file is '
|
||||
'either corrupt or is not an OpenLP 2 service file.'))
|
||||
if os.path.getsize(fileName) == 0:
|
||||
log.exception(u'Service file is zero sized: %s' % fileName)
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate('OpenLP.ServiceManager', 'File Is Empty'),
|
||||
translate('OpenLP.ServiceManager', 'This service file is '
|
||||
'zero size and 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', 'File Is Corrupt'),
|
||||
translate('OpenLP.ServiceManager', 'This service file is '
|
||||
'either corrupt or is not an OpenLP 2 service file.'))
|
||||
return
|
||||
finally:
|
||||
if fileTo:
|
||||
|
Loading…
Reference in New Issue
Block a user