← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/fixes into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #598393 in OpenLP: "After adding a new image to a selected (image) item in the service manager it is not selected anymore"
  https://bugs.launchpad.net/openlp/+bug/598393
  Bug #719102 in OpenLP: "editing author after editing song causes traceback"
  https://bugs.launchpad.net/openlp/+bug/719102
  Bug #730979 in OpenLP: "Song export crashes"
  https://bugs.launchpad.net/openlp/+bug/730979
  Bug #747206 in OpenLP: "Missing dictionary for spell check prevents program start"
  https://bugs.launchpad.net/openlp/+bug/747206

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/64329

Hello,
- fixed crash attempting to add a non existent image to the service
- fixed display of full presentation path in remote search
- fixed names
- fixed use of 'settingsSection' (the second argument is not a sections, rather a value name <-> using settingsSection is misleading)
-- 
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/64329
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-06-11 08:32:36 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-06-12 13:06:06 +0000
@@ -984,7 +984,6 @@
         """
         bible = unicode(self.quickVersionComboBox.currentText())
         search_results = self.plugin.manager.get_verses(bible, string, False, False)
-        results = []
         if search_results:
             versetext = u' '.join([verse.text for verse in search_results])
             return [[string, versetext]]

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2011-05-28 09:53:37 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2011-06-12 13:06:06 +0000
@@ -80,7 +80,7 @@
             u'thumbnails')
         check_directory_exists(self.servicePath)
         self.loadList(SettingsManager.load_list(
-            self.settingsSection, self.settingsSection), True)
+            self.settingsSection, u'images'), True)
 
     def addListViewToToolBar(self):
         MediaManagerItem.addListViewToToolBar(self)
@@ -108,16 +108,16 @@
                         unicode(text.text())))
                 self.listView.takeItem(row)
             SettingsManager.set_list(self.settingsSection,
-                self.settingsSection, self.getFileList())
+                u'images', self.getFileList())
 
-    def loadList(self, list, initialLoad=False):
+    def loadList(self, images, initialLoad=False):
         if not initialLoad:
-            self.plugin.formparent.displayProgressBar(len(list))
+            self.plugin.formparent.displayProgressBar(len(images))
         # Sort the themes by its filename considering language specific
         # characters. lower() is needed for windows!
-        list.sort(cmp=locale.strcoll,
+        images.sort(cmp=locale.strcoll,
             key=lambda filename: os.path.split(unicode(filename))[1].lower())
-        for imageFile in list:
+        for imageFile in images:
             if not initialLoad:
                 self.plugin.formparent.incrementProgressBar()
             filename = os.path.split(unicode(imageFile))[1]
@@ -155,7 +155,7 @@
         for bitem in items:
             filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
             if not os.path.exists(filename):
-                missing_items.append(item)
+                missing_items.append(bitem)
                 missing_items_filenames.append(filename)
         for item in missing_items:
             items.remove(item)
@@ -217,11 +217,10 @@
                     'the image file "%s" no longer exists.')) % filename)
 
     def search(self, string):
-        list = SettingsManager.load_list(self.settingsSection,
-            self.settingsSection)
+        files = SettingsManager.load_list(self.settingsSection, u'images')
         results = []
         string = string.lower()
-        for file in list:
+        for file in files:
             filename = os.path.split(unicode(file))[1]
             if filename.lower().find(string) > -1:
                 results.append([file, filename])

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2011-05-28 09:53:37 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2011-06-12 13:06:06 +0000
@@ -139,8 +139,6 @@
         self.mediaObject.clearQueue()
         self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
         if not self.mediaStateWait(Phonon.StoppedState):
-            # Due to string freeze, borrow a message from presentations
-            # This will be corrected in 1.9.6
             critical_error_message_box(UiStrings().UnsupportedFile,
                     UiStrings().UnsupportedFile)
             return False
@@ -150,8 +148,6 @@
             if not self.mediaStateWait(Phonon.PlayingState) \
                 or self.mediaObject.currentSource().type() \
                 == Phonon.MediaSource.Invalid:
-                # Due to string freeze, borrow a message from presentations
-                # This will be corrected in 1.9.6
                 self.mediaObject.stop()
                 critical_error_message_box(UiStrings().UnsupportedFile,
                         UiStrings().UnsupportedFile)
@@ -186,8 +182,7 @@
     def initialise(self):
         self.listView.clear()
         self.listView.setIconSize(QtCore.QSize(88, 50))
-        self.loadList(SettingsManager.load_list(self.settingsSection,
-            self.settingsSection))
+        self.loadList(SettingsManager.load_list(self.settingsSection, u'media'))
 
     def onDeleteClick(self):
         """
@@ -200,14 +195,14 @@
             for row in row_list:
                 self.listView.takeItem(row)
             SettingsManager.set_list(self.settingsSection,
-                self.settingsSection, self.getFileList())
+                u'media', self.getFileList())
 
-    def loadList(self, list):
+    def loadList(self, files):
         # Sort the themes by its filename considering language specific
         # characters. lower() is needed for windows!
-        list.sort(cmp=locale.strcoll,
+        files.sort(cmp=locale.strcoll,
             key=lambda filename: os.path.split(unicode(filename))[1].lower())
-        for file in list:
+        for file in files:
             filename = os.path.split(unicode(file))[1]
             item_name = QtGui.QListWidgetItem(filename)
             img = QtGui.QPixmap(u':/media/media_video.png').toImage()
@@ -221,11 +216,10 @@
             self.mediaObject = Phonon.MediaObject(self)
 
     def search(self, string):
-        list = SettingsManager.load_list(self.settingsSection,
-            self.settingsSection)
+        files = SettingsManager.load_list(self.settingsSection, u'media')
         results = []
         string = string.lower()
-        for file in list:
+        for file in files:
             filename = os.path.split(unicode(file))[1]
             if filename.lower().find(string) > -1:
                 results.append([file, filename])

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2011-05-28 09:53:37 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2011-06-12 13:06:06 +0000
@@ -119,9 +119,9 @@
         Populate the media manager tab
         """
         self.listView.setIconSize(QtCore.QSize(88, 50))
-        list = SettingsManager.load_list(
+        files = SettingsManager.load_list(
             self.settingsSection, u'presentations')
-        self.loadList(list, True)
+        self.loadList(files, True)
         self.populateDisplayTypes()
 
     def rebuild(self):
@@ -228,7 +228,7 @@
             for row in row_list:
                 self.listView.takeItem(row)
             SettingsManager.set_list(self.settingsSection,
-                self.settingsSection, self.getFileList())
+                u'presentations', self.getFileList())
 
     def generateSlideData(self, service_item, item=None, xmlVersion=False):
         """
@@ -312,10 +312,12 @@
         return None
 
     def search(self, string):
-        list = SettingsManager.load_list(self.settingsSection, u'presentations')
+        files = SettingsManager.load_list(
+            self.settingsSection, u'presentations')
         results = []
         string = string.lower()
-        for file in list:
-            if file.lower().find(string) > -1:
-                results.append([file, file])
+        for file in files:
+            filename = os.path.split(unicode(file))[1]
+            if filename.lower().find(string) > -1:
+                results.append([file, filename])
         return results


Follow ups