forked from openlp/openlp
r1711
This commit is contained in:
commit
3fef17b9c7
@ -305,10 +305,10 @@ class Ui_MainWindow(object):
|
|||||||
add_actions(self.fileExportMenu,
|
add_actions(self.fileExportMenu,
|
||||||
(self.exportThemeItem, self.exportLanguageItem))
|
(self.exportThemeItem, self.exportLanguageItem))
|
||||||
add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
|
add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
|
||||||
self.fileSaveItem, self.fileSaveAsItem, None,
|
self.fileSaveItem, self.fileSaveAsItem,
|
||||||
self.recentFilesMenu.menuAction(), None, self.printServiceOrderItem,
|
self.recentFilesMenu.menuAction(), None,
|
||||||
None, self.fileImportMenu.menuAction(),
|
self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(),
|
||||||
self.fileExportMenu.menuAction(), self.fileExitItem))
|
None, self.printServiceOrderItem, self.fileExitItem))
|
||||||
add_actions(self.viewModeMenu, (self.modeDefaultItem,
|
add_actions(self.viewModeMenu, (self.modeDefaultItem,
|
||||||
self.modeSetupItem, self.modeLiveItem))
|
self.modeSetupItem, self.modeLiveItem))
|
||||||
add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
|
add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
|
||||||
|
@ -102,7 +102,6 @@ class SongShowPlusImport(SongImport):
|
|||||||
if not isinstance(self.import_source, list):
|
if not isinstance(self.import_source, list):
|
||||||
return
|
return
|
||||||
self.import_wizard.progressBar.setMaximum(len(self.import_source))
|
self.import_wizard.progressBar.setMaximum(len(self.import_source))
|
||||||
|
|
||||||
for file in self.import_source:
|
for file in self.import_source:
|
||||||
self.sspVerseOrderList = []
|
self.sspVerseOrderList = []
|
||||||
otherCount = 0
|
otherCount = 0
|
||||||
@ -111,7 +110,6 @@ class SongShowPlusImport(SongImport):
|
|||||||
self.import_wizard.incrementProgressBar(
|
self.import_wizard.incrementProgressBar(
|
||||||
WizardStrings.ImportingType % file_name, 0)
|
WizardStrings.ImportingType % file_name, 0)
|
||||||
songData = open(file, 'rb')
|
songData = open(file, 'rb')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
blockKey, = struct.unpack("I", songData.read(4))
|
blockKey, = struct.unpack("I", songData.read(4))
|
||||||
# The file ends with 4 NUL's
|
# The file ends with 4 NUL's
|
||||||
@ -126,8 +124,9 @@ class SongShowPlusImport(SongImport):
|
|||||||
songData.read(2))
|
songData.read(2))
|
||||||
verseName = songData.read(verseNameLength)
|
verseName = songData.read(verseNameLength)
|
||||||
lengthDescriptorSize, = struct.unpack("B", songData.read(1))
|
lengthDescriptorSize, = struct.unpack("B", songData.read(1))
|
||||||
|
log.debug(lengthDescriptorSize)
|
||||||
# Detect if/how long the length descriptor is
|
# Detect if/how long the length descriptor is
|
||||||
if lengthDescriptorSize == 12:
|
if lengthDescriptorSize == 12 or lengthDescriptorSize == 20:
|
||||||
lengthDescriptor, = struct.unpack("I", songData.read(4))
|
lengthDescriptor, = struct.unpack("I", songData.read(4))
|
||||||
elif lengthDescriptorSize == 2:
|
elif lengthDescriptorSize == 2:
|
||||||
lengthDescriptor = 1
|
lengthDescriptor = 1
|
||||||
@ -135,6 +134,7 @@ class SongShowPlusImport(SongImport):
|
|||||||
lengthDescriptor = 0
|
lengthDescriptor = 0
|
||||||
else:
|
else:
|
||||||
lengthDescriptor, = struct.unpack("B", songData.read(1))
|
lengthDescriptor, = struct.unpack("B", songData.read(1))
|
||||||
|
log.debug(lengthDescriptorSize)
|
||||||
data = songData.read(lengthDescriptor)
|
data = songData.read(lengthDescriptor)
|
||||||
if blockKey == TITLE:
|
if blockKey == TITLE:
|
||||||
self.title = unicode(data, u'cp1252')
|
self.title = unicode(data, u'cp1252')
|
||||||
|
Loading…
Reference in New Issue
Block a user