Merge lp:~raoul-snyman/openlp/bug-802146 into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Approved by: Tim Bentley
Approved revision: 1711
Merged at revision: 1711
Proposed branch: lp:~raoul-snyman/openlp/bug-802146
Merge into: lp:openlp
Diff against target: 57 lines (+7/-7)
2 files modified
openlp/core/ui/mainwindow.py (+4/-4)
openlp/plugins/songs/lib/songshowplusimport.py (+3/-3)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bug-802146
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Andreas Preikschat (community) Approve
Review via email: mp+71780@code.launchpad.net

Commit message

Fixed bug #802146: Couldn't import some SongShowPlus files. Rearranged the file menu as well to be in a more logical order, and to look a little nicer.

Description of the change

Fixed bug #802146: Couldn't import some SongShowPlus files.
Rearranged the file menu as well to be in a more logical order, and to look a little nicer.

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) :
review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-08-11 09:01:25 +0000
+++ openlp/core/ui/mainwindow.py 2011-08-16 21:24:24 +0000
@@ -305,10 +305,10 @@
305 add_actions(self.fileExportMenu,305 add_actions(self.fileExportMenu,
306 (self.exportThemeItem, self.exportLanguageItem))306 (self.exportThemeItem, self.exportLanguageItem))
307 add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,307 add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
308 self.fileSaveItem, self.fileSaveAsItem, None,308 self.fileSaveItem, self.fileSaveAsItem,
309 self.recentFilesMenu.menuAction(), None, self.printServiceOrderItem,309 self.recentFilesMenu.menuAction(), None,
310 None, self.fileImportMenu.menuAction(),310 self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(),
311 self.fileExportMenu.menuAction(), self.fileExitItem))311 None, self.printServiceOrderItem, self.fileExitItem))
312 add_actions(self.viewModeMenu, (self.modeDefaultItem,312 add_actions(self.viewModeMenu, (self.modeDefaultItem,
313 self.modeSetupItem, self.modeLiveItem))313 self.modeSetupItem, self.modeLiveItem))
314 add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),314 add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
315315
=== modified file 'openlp/plugins/songs/lib/songshowplusimport.py'
--- openlp/plugins/songs/lib/songshowplusimport.py 2011-06-14 05:45:23 +0000
+++ openlp/plugins/songs/lib/songshowplusimport.py 2011-08-16 21:24:24 +0000
@@ -102,7 +102,6 @@
102 if not isinstance(self.import_source, list):102 if not isinstance(self.import_source, list):
103 return103 return
104 self.import_wizard.progressBar.setMaximum(len(self.import_source))104 self.import_wizard.progressBar.setMaximum(len(self.import_source))
105
106 for file in self.import_source:105 for file in self.import_source:
107 self.sspVerseOrderList = []106 self.sspVerseOrderList = []
108 otherCount = 0107 otherCount = 0
@@ -111,7 +110,6 @@
111 self.import_wizard.incrementProgressBar(110 self.import_wizard.incrementProgressBar(
112 WizardStrings.ImportingType % file_name, 0)111 WizardStrings.ImportingType % file_name, 0)
113 songData = open(file, 'rb')112 songData = open(file, 'rb')
114
115 while True:113 while True:
116 blockKey, = struct.unpack("I", songData.read(4))114 blockKey, = struct.unpack("I", songData.read(4))
117 # The file ends with 4 NUL's115 # The file ends with 4 NUL's
@@ -126,8 +124,9 @@
126 songData.read(2))124 songData.read(2))
127 verseName = songData.read(verseNameLength)125 verseName = songData.read(verseNameLength)
128 lengthDescriptorSize, = struct.unpack("B", songData.read(1))126 lengthDescriptorSize, = struct.unpack("B", songData.read(1))
127 log.debug(lengthDescriptorSize)
129 # Detect if/how long the length descriptor is128 # Detect if/how long the length descriptor is
130 if lengthDescriptorSize == 12:129 if lengthDescriptorSize == 12 or lengthDescriptorSize == 20:
131 lengthDescriptor, = struct.unpack("I", songData.read(4))130 lengthDescriptor, = struct.unpack("I", songData.read(4))
132 elif lengthDescriptorSize == 2:131 elif lengthDescriptorSize == 2:
133 lengthDescriptor = 1132 lengthDescriptor = 1
@@ -135,6 +134,7 @@
135 lengthDescriptor = 0134 lengthDescriptor = 0
136 else:135 else:
137 lengthDescriptor, = struct.unpack("B", songData.read(1))136 lengthDescriptor, = struct.unpack("B", songData.read(1))
137 log.debug(lengthDescriptorSize)
138 data = songData.read(lengthDescriptor)138 data = songData.read(lengthDescriptor)
139 if blockKey == TITLE:139 if blockKey == TITLE:
140 self.title = unicode(data, u'cp1252')140 self.title = unicode(data, u'cp1252')