← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/bug-794297 into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/bug-794297 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #794297 in OpenLP: "Disabled song imports are enabled if go next then back in import wizard"
  https://bugs.launchpad.net/openlp/+bug/794297
  Bug #799915 in OpenLP: "Missing attribute error in Easislides Importer"
  https://bugs.launchpad.net/openlp/+bug/799915

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/bug-794297/+merge/65278

1. In the import wizard, if user goes back and next again, ensure a disabled button stays disabled.
2. Check for missing attributes in the easislides import XML
-- 
https://code.launchpad.net/~j-corwin/openlp/bug-794297/+merge/65278
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/bug-794297 into lp:openlp.
=== modified file 'openlp/core/ui/wizard.py'
--- openlp/core/ui/wizard.py	2011-06-12 16:02:52 +0000
+++ openlp/core/ui/wizard.py	2011-06-20 22:13:59 +0000
@@ -190,6 +190,14 @@
             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):
         """

=== modified file 'openlp/plugins/songs/forms/songimportform.py'
--- openlp/plugins/songs/forms/songimportform.py	2011-06-12 16:02:52 +0000
+++ openlp/plugins/songs/forms/songimportform.py	2011-06-20 22:13:59 +0000
@@ -343,6 +343,13 @@
         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.

=== modified file 'openlp/plugins/songs/lib/easislidesimport.py'
--- openlp/plugins/songs/lib/easislidesimport.py	2011-06-12 16:02:52 +0000
+++ openlp/plugins/songs/lib/easislidesimport.py	2011-06-20 22:13:59 +0000
@@ -73,15 +73,21 @@
     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():


Follow ups