← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/alpha_fixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/alpha_fixes into lp:openlp.

Commit message:
Fixes all over the place.
* Migration from 2.4 to trunk now handles the screen definitions
* Custom generation from service manager works again
* Print service works
* Open last service works again.

Requested reviews:
  Phill (phill-ridout)
Related bugs:
  Bug #1837294 in OpenLP: "Alpha Test - Screen settings are not converted"
  https://bugs.launchpad.net/openlp/+bug/1837294

For more details, see:
https://code.launchpad.net/~trb143/openlp/alpha_fixes/+merge/370938
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2019-06-21 20:53:42 +0000
+++ openlp/core/common/settings.py	2019-08-04 15:58:13 +0000
@@ -90,12 +90,13 @@
         number: {
             'number': number,
             geometry_key: {
-                'x': x_position,
-                'y': y_position,
-                'height': height,
-                'width': width
+                'x': int(x_position),
+                'y': int(y_position),
+                'height': int(height),
+                'width': int(width)
             },
-            'is_display': is_display_screen
+            'is_display': is_display_screen,
+            'is_primary': can_override
         }
     }
 
@@ -309,7 +310,7 @@
         ('songuasge/db hostname', 'songusage/db hostname', []),
         ('songuasge/db database', 'songusage/db database', []),
         ('presentations / Powerpoint Viewer', '', []),
-        (['core/monitor', 'core/x position', 'core/y position', 'core/height', 'core/width', 'core/override',
+        (['core/monitor', 'core/x position', 'core/y position', 'core/height', 'core/width', 'core/override position',
           'core/display on monitor'], 'core/screens', [(upgrade_screens, [1, 0, 0, None, None, False, False])]),
         ('bibles/proxy name', '', []),  # Just remove these bible proxy settings. They weren't used in 2.4!
         ('bibles/proxy address', '', []),

=== modified file 'openlp/core/display/render.py'
--- openlp/core/display/render.py	2019-06-09 20:22:43 +0000
+++ openlp/core/display/render.py	2019-08-04 15:58:13 +0000
@@ -482,6 +482,7 @@
 
         :param theme_data:  The theme to generated a preview for.
         :param force_page: Flag to tell message lines per page need to be generated.
+        :param generate_screenshot: Do I need to generate a screen shot?
         :rtype: QtGui.QPixmap
         """
         # save value for use in format_slide

=== modified file 'openlp/core/display/screens.py'
--- openlp/core/display/screens.py	2019-04-13 13:00:22 +0000
+++ openlp/core/display/screens.py	2019-08-04 15:58:13 +0000
@@ -133,8 +133,13 @@
         self.number = int(screen_dict['number'])
         self.is_display = screen_dict['is_display']
         self.is_primary = screen_dict['is_primary']
-        self.geometry = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'],
-                                     screen_dict['geometry']['width'], screen_dict['geometry']['height'])
+        try:
+            self.geometry = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'],
+                                         screen_dict['geometry']['width'], screen_dict['geometry']['height'])
+        except KeyError:
+            # Preserve the current values as this has come from the settings update which does not have
+            # the geometry information
+            pass
         if 'custom_geometry' in screen_dict:
             self.custom_geometry = QtCore.QRect(screen_dict['custom_geometry']['x'],
                                                 screen_dict['custom_geometry']['y'],

=== modified file 'openlp/core/threading.py'
--- openlp/core/threading.py	2019-04-13 13:00:22 +0000
+++ openlp/core/threading.py	2019-08-04 15:58:13 +0000
@@ -24,10 +24,11 @@
 """
 from PyQt5 import QtCore
 
+from openlp.core.common.mixins import LogMixin
 from openlp.core.common.registry import Registry
 
 
-class ThreadWorker(QtCore.QObject):
+class ThreadWorker(QtCore.QObject, LogMixin):
     """
     The :class:`~openlp.core.threading.ThreadWorker` class provides a base class for all worker objects
     """

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2019-07-01 22:36:14 +0000
+++ openlp/core/ui/mainwindow.py	2019-08-04 15:58:13 +0000
@@ -635,7 +635,10 @@
         # if self.live_controller.display.isVisible():
         #     self.live_controller.display.setFocus()
         self.activateWindow()
-        if self.application.args:
+        # We have -disable-web-security added by our code.
+        # If a file is passed in we will have that as well so count of 2
+        # If not we need to see if we want to use the previous file.so count of 1
+        if self.application.args and len(self.application.args) > 1:
             self.open_cmd_line_files(self.application.args)
         elif Settings().value(self.general_settings_section + '/auto open'):
             self.service_manager_contents.load_last_file()

=== modified file 'openlp/core/ui/printserviceform.py'
--- openlp/core/ui/printserviceform.py	2019-04-28 19:21:23 +0000
+++ openlp/core/ui/printserviceform.py	2019-08-04 15:58:13 +0000
@@ -219,13 +219,13 @@
                 verse_def = None
                 verse_html = None
                 for slide in item.get_frames():
-                    if not verse_def or verse_def != slide['verseTag'] or verse_html == slide['printing_html']:
+                    if not verse_def or verse_def != slide['verse'] or verse_html == slide['text']:
                         text_div = self._add_element('div', parent=div, class_id='itemText')
-                    elif 'chordspacing' not in slide['printing_html']:
+                    elif 'chordspacing' not in slide['text']:
                         self._add_element('br', parent=text_div)
-                    self._add_element('span', slide['printing_html'], text_div)
-                    verse_def = slide['verseTag']
-                    verse_html = slide['printing_html']
+                    self._add_element('span', slide['text'], text_div)
+                    verse_def = slide['verse']
+                    verse_html = slide['text']
                 # Break the page before the div element.
                 if index != 0 and self.page_break_after_text.isChecked():
                     div.set('class', 'item newPage')

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2019-06-11 18:40:20 +0000
+++ openlp/core/ui/servicemanager.py	2019-08-04 15:58:13 +0000
@@ -34,6 +34,7 @@
 
 from PyQt5 import QtCore, QtGui, QtWidgets
 
+from openlp.core.state import State
 from openlp.core.common import ThemeLevel, delete_file
 from openlp.core.common.actions import ActionList, CategoryOrder
 from openlp.core.common.applocation import AppLocation
@@ -828,7 +829,7 @@
                 self.auto_start_action.setIcon(UiIcons().inactive)
                 self.auto_start_action.setText(translate('OpenLP.ServiceManager', '&Auto Start - inactive'))
         if service_item['service_item'].is_text():
-            for plugin in self.plugin_manager.plugins:
+            for plugin in State().list_plugins():
                 if plugin.name == 'custom' and plugin.status == PluginStatus.Active:
                     self.create_custom_action.setVisible(True)
                     break

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2019-06-11 19:11:54 +0000
+++ openlp/core/ui/thememanager.py	2019-08-04 15:58:13 +0000
@@ -30,6 +30,7 @@
 
 from PyQt5 import QtCore, QtWidgets
 
+from openlp.core.state import State
 from openlp.core.common import delete_file
 from openlp.core.common.applocation import AppLocation
 from openlp.core.common.i18n import UiStrings, get_locale_key, translate
@@ -293,7 +294,7 @@
                     old_theme_data = self.get_theme_data(old_theme_name)
                     self.clone_theme_data(old_theme_data, new_theme_name)
                     self.delete_theme(old_theme_name)
-                    for plugin in self.plugin_manager.plugins:
+                    for plugin in State().list_plugins():
                         if plugin.uses_theme(old_theme_name):
                             plugin.rename_theme(old_theme_name, new_theme_name)
                     self.renderer.set_theme(self.get_theme_data(new_theme_name))
@@ -771,7 +772,7 @@
             # check for use in the system else where.
             if test_plugin:
                 plugin_usage = ""
-                for plugin in self.plugin_manager.plugins:
+                for plugin in State().list_plugins():
                     used_count = plugin.uses_theme(theme)
                     if used_count:
                         plugin_usage = "{plug}{text}".format(plug=plugin_usage,

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2019-04-13 13:00:22 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2019-08-04 15:58:13 +0000
@@ -349,7 +349,7 @@
             custom.credits = ''
         custom_xml = CustomXMLBuilder()
         for (idx, slide) in enumerate(item.slides):
-            custom_xml.add_verse_to_lyrics('custom', str(idx + 1), slide['raw_slide'])
+            custom_xml.add_verse_to_lyrics('custom', str(idx + 1), slide['text'])
         custom.text = str(custom_xml.extract_xml(), 'utf-8')
         self.plugin.db_manager.save_object(custom)
         self.on_search_text_button_clicked()

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2019-05-22 06:47:00 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2019-08-04 15:58:13 +0000
@@ -29,6 +29,7 @@
 
 from PyQt5 import QtCore, QtWidgets
 
+from openlp.core.state import State
 from openlp.core.common.applocation import AppLocation
 from openlp.core.common.i18n import UiStrings, get_natural_key, translate
 from openlp.core.common.mixins import RegistryProperties
@@ -416,7 +417,7 @@
         Load the media files into a combobox.
         """
         self.from_media_button.setVisible(False)
-        for plugin in self.plugin_manager.plugins:
+        for plugin in State().list_plugins():
             if plugin.name == 'media' and plugin.status == PluginStatus.Active:
                 self.from_media_button.setVisible(True)
                 self.media_form.populate_files(plugin.media_item.get_list(MediaType.Audio))


Follow ups