← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~springermac/openlp/fix-ups into lp:openlp

 

Jonathan Springer has proposed merging lp:~springermac/openlp/fix-ups into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  matysek (mzibricky)

For more details, see:
https://code.launchpad.net/~springermac/openlp/fix-ups/+merge/214464

Remove orphaned and unused registry execute, and fix two functions to register to the registry instead of executing.

Modify loading file from the command line to only load files ending with osz, or oszl.

Fix argument to pass correct type.
-- 
https://code.launchpad.net/~springermac/openlp/fix-ups/+merge/214464
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2014-03-28 20:38:38 +0000
+++ openlp/core/ui/mainwindow.py	2014-04-07 02:31:30 +0000
@@ -598,13 +598,7 @@
             self.live_controller.display.setFocus()
         self.activateWindow()
         if self.arguments:
-            args = []
-            for a in self.arguments:
-                args.extend([a])
-            filename = args[0]
-            if not isinstance(filename, str):
-                filename = str(filename, sys.getfilesystemencoding())
-            self.service_manager_contents.load_file(filename)
+            self.open_cmd_line_files()
         elif Settings().value(self.general_settings_section + '/auto open'):
             self.service_manager_contents.load_Last_file()
         self.timer_version_id = self.startTimer(1000)
@@ -1364,3 +1358,17 @@
         if self.new_data_path == AppLocation.get_directory(AppLocation.DataDir):
             settings.remove('advanced/data path')
         self.application.set_normal_cursor()
+
+    def open_cmd_line_files(self):
+        """
+        Open files passed in through command line arguments
+        """
+        args = []
+        for a in self.arguments:
+            args.extend([a])
+        for arg in args:
+            filename = arg
+            if not isinstance(filename, str):
+                filename = str(filename, sys.getfilesystemencoding())
+            if filename.endswith(('.osz', '.oszl')):
+                self.service_manager_contents.load_file(filename)

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2014-03-26 11:26:16 +0000
+++ openlp/core/ui/slidecontroller.py	2014-04-07 02:31:30 +0000
@@ -1039,7 +1039,6 @@
         """
         self.preview_widget.change_slide(row)
         self.update_preview()
-        Registry().execute('slidecontroller_%s_changed' % self.type_prefix, row)
 
     def update_preview(self):
         """

=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py	2014-03-20 19:10:31 +0000
+++ openlp/core/utils/languagemanager.py	2014-04-07 02:31:30 +0000
@@ -74,7 +74,7 @@
         log.debug('Translation files: %s', AppLocation.get_directory(
             AppLocation.LanguageDir))
         trans_dir = QtCore.QDir(AppLocation.get_directory(AppLocation.LanguageDir))
-        file_names = trans_dir.entryList('*.qm', QtCore.QDir.Files, QtCore.QDir.Name)
+        file_names = trans_dir.entryList(['*.qm'], QtCore.QDir.Files, QtCore.QDir.Name)
         # Remove qm files from the list which start with "qt_".
         file_names = [file_ for file_ in file_names if not file_.startswith('qt_')]
         return list(map(trans_dir.filePath, file_names))

=== modified file 'openlp/plugins/bibles/forms/bibleupgradeform.py'
--- openlp/plugins/bibles/forms/bibleupgradeform.py	2014-03-21 18:23:35 +0000
+++ openlp/plugins/bibles/forms/bibleupgradeform.py	2014-04-07 02:31:30 +0000
@@ -78,7 +78,7 @@
         Set up the UI for the bible wizard.
         """
         super(BibleUpgradeForm, self).setupUi(image)
-        Registry().execute('openlp_stop_wizard', self.stop_import)
+        Registry().register_function('openlp_stop_wizard', self.stop_import)
 
     def stop_import(self):
         """

=== modified file 'openlp/plugins/bibles/lib/db.py'
--- openlp/plugins/bibles/lib/db.py	2014-04-01 17:32:19 +0000
+++ openlp/plugins/bibles/lib/db.py	2014-04-07 02:31:30 +0000
@@ -154,7 +154,7 @@
         if 'path' in kwargs:
             self.path = kwargs['path']
         self.wizard = None
-        Registry().execute('openlp_stop_wizard', self.stop_import)
+        Registry().register_function('openlp_stop_wizard', self.stop_import)
 
     def stop_import(self):
         """


References