← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~rafaellerm/openlp/media_import_fix into lp:openlp

 

Rafael Lerm has proposed merging lp:~rafaellerm/openlp/media_import_fix into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~rafaellerm/openlp/media_import_fix/+merge/210113

This fixes the adding of images and media to the media manager.

As this consists only of bugfixes, I did not know if it was necessary to write any new tests. Please advise if there is any functionality that should be tested. I am still an openlp developmnt rookie, so please be patient...

Background: I recently proposed in the forums a new feature to the media plugin (http://forums.openlp.org/discussion/comment/6509). When I tried to implement the feature, I saw that the media plugin was broken (could not add items), so I decided to investigate. A also saw there was a similar problem with the image plugin. I did not see any in any of the branches a fix, and so was born this merge request. Please disconsider if this is already done elsewere.
-- 
https://code.launchpad.net/~rafaellerm/openlp/media_import_fix/+merge/210113
Your team OpenLP Core is requested to review the proposed merge of lp:~rafaellerm/openlp/media_import_fix into lp:openlp.
=== modified file 'openlp/core/lib/listwidgetwithdnd.py'
--- openlp/core/lib/listwidgetwithdnd.py	2013-12-28 21:33:38 +0000
+++ openlp/core/lib/listwidgetwithdnd.py	2014-03-10 02:50:35 +0000
@@ -110,6 +110,6 @@
                     listing = os.listdir(local_file)
                     for file in listing:
                         files.append(os.path.join(local_file, file))
-            Registry().execute('%s_dnd' % self.mime_data_text, files)
+            Registry().execute('%s_dnd' % self.mime_data_text, {'files': files, 'target': self.itemAt(event.pos())})
         else:
             event.ignore()

=== modified file 'openlp/core/lib/treewidgetwithdnd.py'
--- openlp/core/lib/treewidgetwithdnd.py	2013-12-28 21:33:38 +0000
+++ openlp/core/lib/treewidgetwithdnd.py	2014-03-10 02:50:35 +0000
@@ -131,7 +131,7 @@
                     listing = os.listdir(local_file)
                     for file_name in listing:
                         files.append(os.path.join(local_file, file_name))
-            Registry().execute('%s_dnd' % self.mime_Data_Text, {'files': files, 'target': self.itemAt(event.pos())})
+            Registry().execute('%s_dnd' % self.mime_data_text, {'files': files, 'target': self.itemAt(event.pos())})
         elif self.allow_internal_dnd:
             event.setDropAction(QtCore.Qt.CopyAction)
             event.accept()

=== modified file 'openlp/core/ui/media/mediacontroller.py'
--- openlp/core/ui/media/mediacontroller.py	2013-12-31 20:29:03 +0000
+++ openlp/core/ui/media/mediacontroller.py	2014-03-10 02:50:35 +0000
@@ -147,7 +147,7 @@
             if player.is_active:
                 for item in player.video_extensions_list:
                     if item not in self.video_extensions_list:
-                        self.video_extensions_list.extend(item)
+                        self.video_extensions_list.append(item)
                         suffix_list.append(item[2:])
         self.service_manager.supported_suffixes(suffix_list)
 

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2014-01-11 17:52:01 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2014-03-10 02:50:35 +0000
@@ -217,11 +217,11 @@
         self.service_path = os.path.join(AppLocation.get_section_data_path(self.settings_section), 'thumbnails')
         check_directory_exists(self.service_path)
         self.load_list(Settings().value(self.settings_section + '/media files'))
-        self.populate_display_types()
+        self.rebuild_players()
 
     def rebuild_players(self):
         """
-        Rebuild the tab in the media manager when changes are made in the settings.
+        Rebuild the tab in the media manager at initialization, or when changes are made in the settings.
         """
         self.populate_display_types()
         self.on_new_file_masks = translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)') % (


Follow ups