From 59280d10b75cd944b6a9665aa1ce057722c3b936 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Mon, 20 Jun 2011 22:57:34 +0100 Subject: [PATCH 1/2] Preserve greyed out of next button in import wizard --- openlp/core/ui/wizard.py | 8 ++++++++ openlp/plugins/songs/forms/songimportform.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 6bc3e2df6..9d8a106ed 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -190,6 +190,14 @@ class OpenLPWizard(QtGui.QWizard): self.preWizard() self.performWizard() self.postWizard() + else: + self.customPageChanged(pageId) + + def customPageChanged(self, pageId): + """ + Called when changing to a page other than the progress page + """ + pass def onErrorCopyToButtonClicked(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index faaddd3eb..4ab60d360 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -343,6 +343,13 @@ class SongImportForm(OpenLPWizard): self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + def customPageChanged(self, pageId): + """ + Called when changing to a page other than the progress page + """ + if self.page(pageId) == self.sourcePage: + self.onCurrentIndexChanged(self.formatStack.currentIndex()) + def validateCurrentPage(self): """ Validate the current page before moving on to the next page. From 6c3190528d4a522d9a08447fae9562b8edc7e08d Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Mon, 20 Jun 2011 23:11:05 +0100 Subject: [PATCH 2/2] Fix easislides import when xml elements are missing --- openlp/plugins/songs/lib/easislidesimport.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index d941a1d45..b1eaceeaf 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -73,15 +73,21 @@ class EasiSlidesImport(SongImport): def _parse_song(self, song): self._success = True self._add_unicode_attribute(u'title', song.Title1, True) - self._add_unicode_attribute(u'alternate_title', song.Title2) - self._add_unicode_attribute(u'song_number', song.SongNumber) + if hasattr(song, u'Title2'): + self._add_unicode_attribute(u'alternate_title', song.Title2) + if hasattr(song, u'SongNumber'): + self._add_unicode_attribute(u'song_number', song.SongNumber) if self.song_number == u'0': self.song_number = u'' self._add_authors(song) - self._add_copyright(song.Copyright) - self._add_copyright(song.LicenceAdmin1) - self._add_copyright(song.LicenceAdmin2) - self._add_unicode_attribute(u'song_book_name', song.BookReference) + if hasattr(song, u'Copyright'): + self._add_copyright(song.Copyright) + if hasattr(song, u'LicenceAdmin1'): + self._add_copyright(song.LicenceAdmin1) + if hasattr(song, u'LicenceAdmin2'): + self._add_copyright(song.LicenceAdmin2) + if hasattr(song, u'BookReference'): + self._add_unicode_attribute(u'song_book_name', song.BookReference) self._parse_and_add_lyrics(song) if self._success: if not self.finish():