Merge lp:~mahfiaz/openlp/song_import_order into lp:openlp

Proposed by mahfiaz
Status: Merged
Approved by: Tim Bentley
Approved revision: 1840
Merged at revision: 1837
Proposed branch: lp:~mahfiaz/openlp/song_import_order
Merge into: lp:openlp
Diff against target: 178 lines (+52/-45)
2 files modified
openlp/plugins/songs/forms/songimportform.py (+32/-25)
openlp/plugins/songs/lib/importer.py (+20/-20)
To merge this branch: bzr merge lp:~mahfiaz/openlp/song_import_order
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+85555@code.launchpad.net

This proposal supersedes a proposal from 2011-12-13.

Description of the change

Fix for bug #828385, song import plugins order more alphabetical, but OpenLP related ones in front. It saves last used item's index. Saving of last used simply saves item's index in list, so if the order of import types changes (or one is added before the one), wrong item is selected for once.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Assuming the numbers do not mess things up.
If it goes in today I am happy with a string changed.

review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

We're past string freeze, I'm afraid I can't let this through with the changed string.

review: Needs Fixing
Revision history for this message
John Cegalis (jseagull1) wrote : Posted in a previous version of this proposal

Shouldn't CCLI be number one in alphabetical order?

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

You also can't just arbitrarily change the numbers of the import sources without changing the order of the import sources in the combobox.

review: Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

apologies, I spotted one last thing... you can use QVariant's toInt() method, instead of toString() -> http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html#toInt (line 107)

review: Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Meinert Jordan (m2j) wrote : Posted in a previous version of this proposal

EasiSlides has been renamed to EasySlides [ref http://easislides.com]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/songs/forms/songimportform.py'
--- openlp/plugins/songs/forms/songimportform.py 2011-10-05 22:17:57 +0000
+++ openlp/plugins/songs/forms/songimportform.py 2011-12-13 21:12:22 +0000
@@ -191,32 +191,32 @@
191 QtGui.QSizePolicy.Expanding)191 QtGui.QSizePolicy.Expanding)
192 self.formatStack = QtGui.QStackedLayout()192 self.formatStack = QtGui.QStackedLayout()
193 self.formatStack.setObjectName(u'FormatStack')193 self.formatStack.setObjectName(u'FormatStack')
194 # OpenLyrics
195 self.addFileSelectItem(u'openLyrics', u'OpenLyrics', True)
194 # OpenLP 2.0196 # OpenLP 2.0
195 self.addFileSelectItem(u'openLP2', single_select=True)197 self.addFileSelectItem(u'openLP2', single_select=True)
196 # openlp.org 1.x198 # openlp.org 1.x
197 self.addFileSelectItem(u'openLP1', None, True, True)199 self.addFileSelectItem(u'openLP1', None, True, True)
198 # OpenLyrics200 # Generic Document/Presentation import
199 self.addFileSelectItem(u'openLyrics', u'OpenLyrics', True)201 self.addFileSelectItem(u'generic', None, True)
200 # Open Song
201 self.addFileSelectItem(u'openSong', u'OpenSong')
202 # Words of Worship
203 self.addFileSelectItem(u'wordsOfWorship')
204 # CCLI File import202 # CCLI File import
205 self.addFileSelectItem(u'ccli')203 self.addFileSelectItem(u'ccli')
206 # Songs of Fellowship204 # EasiSlides
207 self.addFileSelectItem(u'songsOfFellowship', None, True)
208 # Generic Document/Presentation import
209 self.addFileSelectItem(u'generic', None, True)
210 # EasySlides
211 self.addFileSelectItem(u'easiSlides', single_select=True)205 self.addFileSelectItem(u'easiSlides', single_select=True)
212 # EasyWorship206 # EasyWorship
213 self.addFileSelectItem(u'ew', single_select=True)207 self.addFileSelectItem(u'ew', single_select=True)
214 # Words of Worship208 # Foilpresenter
209 self.addFileSelectItem(u'foilPresenter')
210 # Open Song
211 self.addFileSelectItem(u'openSong', u'OpenSong')
212 # SongBeamer
215 self.addFileSelectItem(u'songBeamer')213 self.addFileSelectItem(u'songBeamer')
216 # Song Show Plus214 # Song Show Plus
217 self.addFileSelectItem(u'songShowPlus')215 self.addFileSelectItem(u'songShowPlus')
218 # Foilpresenter216 # Songs of Fellowship
219 self.addFileSelectItem(u'foilPresenter')217 self.addFileSelectItem(u'songsOfFellowship', None, True)
218 # Words of Worship
219 self.addFileSelectItem(u'wordsOfWorship')
220# Commented out for future use.220# Commented out for future use.
221# self.addFileSelectItem(u'csv', u'CSV', single_select=True)221# self.addFileSelectItem(u'csv', u'CSV', single_select=True)
222 self.sourceLayout.addLayout(self.formatStack)222 self.sourceLayout.addLayout(self.formatStack)
@@ -238,30 +238,30 @@
238 self.sourcePage.setTitle(WizardStrings.ImportSelect)238 self.sourcePage.setTitle(WizardStrings.ImportSelect)
239 self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong)239 self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong)
240 self.formatLabel.setText(WizardStrings.FormatLabel)240 self.formatLabel.setText(WizardStrings.FormatLabel)
241 self.formatComboBox.setItemText(SongFormat.OpenLyrics,
242 translate('SongsPlugin.ImportWizardForm',
243 'OpenLyrics or OpenLP 2.0 Exported Song'))
241 self.formatComboBox.setItemText(SongFormat.OpenLP2, UiStrings().OLPV2)244 self.formatComboBox.setItemText(SongFormat.OpenLP2, UiStrings().OLPV2)
242 self.formatComboBox.setItemText(SongFormat.OpenLP1, UiStrings().OLPV1)245 self.formatComboBox.setItemText(SongFormat.OpenLP1, UiStrings().OLPV1)
243 self.formatComboBox.setItemText(SongFormat.OpenLyrics,
244 translate('SongsPlugin.ImportWizardForm',
245 'OpenLyrics or OpenLP 2.0 Exported Song'))
246 self.formatComboBox.setItemText(SongFormat.OpenSong, WizardStrings.OS)
247 self.formatComboBox.setItemText(
248 SongFormat.WordsOfWorship, WizardStrings.WoW)
249 self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI)
250 self.formatComboBox.setItemText(
251 SongFormat.SongsOfFellowship, WizardStrings.SoF)
252 self.formatComboBox.setItemText(SongFormat.Generic,246 self.formatComboBox.setItemText(SongFormat.Generic,
253 translate('SongsPlugin.ImportWizardForm',247 translate('SongsPlugin.ImportWizardForm',
254 'Generic Document/Presentation'))248 'Generic Document/Presentation'))
249 self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI)
255 self.formatComboBox.setItemText(250 self.formatComboBox.setItemText(
256 SongFormat.EasiSlides, WizardStrings.ES)251 SongFormat.EasiSlides, WizardStrings.ES)
257 self.formatComboBox.setItemText(252 self.formatComboBox.setItemText(
258 SongFormat.EasyWorship, WizardStrings.EW)253 SongFormat.EasyWorship, WizardStrings.EW)
259 self.formatComboBox.setItemText(254 self.formatComboBox.setItemText(
255 SongFormat.FoilPresenter, WizardStrings.FP)
256 self.formatComboBox.setItemText(SongFormat.OpenSong, WizardStrings.OS)
257 self.formatComboBox.setItemText(
260 SongFormat.SongBeamer, WizardStrings.SB)258 SongFormat.SongBeamer, WizardStrings.SB)
261 self.formatComboBox.setItemText(259 self.formatComboBox.setItemText(
262 SongFormat.SongShowPlus, WizardStrings.SSP)260 SongFormat.SongShowPlus, WizardStrings.SSP)
263 self.formatComboBox.setItemText(261 self.formatComboBox.setItemText(
264 SongFormat.FoilPresenter, WizardStrings.FP)262 SongFormat.SongsOfFellowship, WizardStrings.SoF)
263 self.formatComboBox.setItemText(
264 SongFormat.WordsOfWorship, WizardStrings.WoW)
265# self.formatComboBox.setItemText(SongFormat.CSV, WizardStrings.CSV)265# self.formatComboBox.setItemText(SongFormat.CSV, WizardStrings.CSV)
266 self.openLP2FilenameLabel.setText(266 self.openLP2FilenameLabel.setText(
267 translate('SongsPlugin.ImportWizardForm', 'Filename:'))267 translate('SongsPlugin.ImportWizardForm', 'Filename:'))
@@ -359,6 +359,8 @@
359 return True359 return True
360 elif self.currentPage() == self.sourcePage:360 elif self.currentPage() == self.sourcePage:
361 source_format = self.formatComboBox.currentIndex()361 source_format = self.formatComboBox.currentIndex()
362 QtCore.QSettings().setValue(u'songs/last import type',
363 source_format)
362 if source_format == SongFormat.OpenLP2:364 if source_format == SongFormat.OpenLP2:
363 if self.openLP2FilenameEdit.text().isEmpty():365 if self.openLP2FilenameEdit.text().isEmpty():
364 critical_error_message_box(UiStrings().NFSs,366 critical_error_message_box(UiStrings().NFSs,
@@ -657,7 +659,12 @@
657 self.restart()659 self.restart()
658 self.finishButton.setVisible(False)660 self.finishButton.setVisible(False)
659 self.cancelButton.setVisible(True)661 self.cancelButton.setVisible(True)
660 self.formatComboBox.setCurrentIndex(0)662 last_import_type = QtCore.QSettings().value(
663 u'songs/last import type').toInt()[0]
664 if last_import_type < 0 or \
665 last_import_type >= self.formatComboBox.count():
666 last_import_type = 0
667 self.formatComboBox.setCurrentIndex(last_import_type)
661 self.openLP2FilenameEdit.setText(u'')668 self.openLP2FilenameEdit.setText(u'')
662 self.openLP1FilenameEdit.setText(u'')669 self.openLP1FilenameEdit.setText(u'')
663 self.openLyricsFileListWidget.clear()670 self.openLyricsFileListWidget.clear()
664671
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py 2011-06-12 16:02:52 +0000
+++ openlp/plugins/songs/lib/importer.py 2011-12-13 21:12:22 +0000
@@ -68,19 +68,19 @@
68 """68 """
69 _format_availability = {}69 _format_availability = {}
70 Unknown = -170 Unknown = -1
71 OpenLP2 = 071 OpenLyrics = 0
72 OpenLP1 = 172 OpenLP2 = 1
73 OpenLyrics = 273 OpenLP1 = 2
74 OpenSong = 374 Generic = 3
75 WordsOfWorship = 475 CCLI = 4
76 CCLI = 576 EasiSlides = 5
77 SongsOfFellowship = 677 EasyWorship = 6
78 Generic = 778 FoilPresenter = 7
79 EasiSlides = 879 OpenSong = 8
80 EasyWorship = 980 SongBeamer = 9
81 SongBeamer = 1081 SongShowPlus = 10
82 SongShowPlus = 1182 SongsOfFellowship = 11
83 FoilPresenter = 1283 WordsOfWorship = 12
84 #CSV = 1384 #CSV = 13
8585
86 @staticmethod86 @staticmethod
@@ -125,19 +125,19 @@
125 Return a list of the supported song formats.125 Return a list of the supported song formats.
126 """126 """
127 return [127 return [
128 SongFormat.OpenLyrics,
128 SongFormat.OpenLP2,129 SongFormat.OpenLP2,
129 SongFormat.OpenLP1,130 SongFormat.OpenLP1,
130 SongFormat.OpenLyrics,131 SongFormat.Generic,
131 SongFormat.OpenSong,
132 SongFormat.WordsOfWorship,
133 SongFormat.CCLI,132 SongFormat.CCLI,
134 SongFormat.SongsOfFellowship,
135 SongFormat.Generic,
136 SongFormat.EasiSlides,133 SongFormat.EasiSlides,
137 SongFormat.EasyWorship,134 SongFormat.EasyWorship,
135 SongFormat.FoilPresenter,
136 SongFormat.OpenSong,
138 SongFormat.SongBeamer,137 SongFormat.SongBeamer,
139 SongFormat.SongShowPlus,138 SongFormat.SongShowPlus,
140 SongFormat.FoilPresenter139 SongFormat.SongsOfFellowship,
140 SongFormat.WordsOfWorship
141 ]141 ]
142142
143 @staticmethod143 @staticmethod