← 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:
  matysek (mzibricky)

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

Remove unnecessary platform specific code, 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, oszl, or otz.

Fix argument to pass correct type.
-- 
https://code.launchpad.net/~springermac/openlp/fix-ups/+merge/214015
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-03 12:57:35 +0000
@@ -322,14 +322,8 @@
         # i18n add Language Actions
         add_actions(self.settings_language_menu, (self.auto_language_item, None))
         add_actions(self.settings_language_menu, self.language_group.actions())
-        # Order things differently in OS X so that Preferences menu item in the
-        # app menu is correct (this gets picked up automatically by Qt).
-        if sys.platform == 'darwin':
-            add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(),
-                        None, self.settings_configure_item, self.settings_shortcuts_item, self.formatting_tag_item))
-        else:
-            add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(),
-                        None, self.formatting_tag_item, self.settings_shortcuts_item, self.settings_configure_item))
+        add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(),
+                    None, self.formatting_tag_item, self.settings_shortcuts_item, self.settings_configure_item))
         add_actions(self.tools_menu, (self.tools_add_tool_item, None))
         add_actions(self.tools_menu, (self.tools_open_data_folder, None))
         add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
@@ -393,8 +387,10 @@
         self.import_language_item.setText(translate('OpenLP.MainWindow', '&Language'))
         self.export_theme_item.setText(translate('OpenLP.MainWindow', '&Theme'))
         self.export_language_item.setText(translate('OpenLP.MainWindow', '&Language'))
-        self.settings_shortcuts_item.setText(translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
-        self.formatting_tag_item.setText(translate('OpenLP.MainWindow', 'Configure &Formatting Tags...'))
+        # Do not use config, options, setup, settings or preferences in menu item name unless it is OpenLP's preferences.
+        # Qt automatically detects the Preferences entry for the Mac OS X menu based on the name of the menu item.
+        self.settings_shortcuts_item.setText(translate('OpenLP.MainWindow', '&Shortcuts...'))
+        self.formatting_tag_item.setText(translate('OpenLP.MainWindow', '&Formatting Tags...'))
         self.settings_configure_item.setText(translate('OpenLP.MainWindow', '&Configure OpenLP...'))
         self.settings_export_item.setStatusTip(translate('OpenLP.MainWindow',
                                                'Export OpenLP settings to a specified *.config file'))
@@ -601,10 +597,12 @@
             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)
+            for arg in args:
+                filename = arg
+                if not isinstance(filename, str):
+                    filename = str(filename, sys.getfilesystemencoding())
+                if filename.endswith(('.osz', '.oszl', '.otz')):
+                    self.service_manager_contents.load_file(filename)
         elif Settings().value(self.general_settings_section + '/auto open'):
             self.service_manager_contents.load_Last_file()
         self.timer_version_id = self.startTimer(1000)

=== 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-03 12:57:35 +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-03 12:57:35 +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-03 12:57:35 +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-03-21 18:23:35 +0000
+++ openlp/plugins/bibles/lib/db.py	2014-04-03 12:57:35 +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