← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #788231 in OpenLP: "Theme wizard does not show correct line count (max lines/slide)"
  https://bugs.launchpad.net/openlp/+bug/788231

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug_788231/+merge/63589

Try to improve the number of lines calculation.
As stated in the bug report the number of lines is not an exact science and things like super and sub script mess things up.
I have tested with a text only slide and the numbers now match! 

Updated UI to add vagueness but may be the documentation needs to be changed as well 
-- 
https://code.launchpad.net/~trb143/openlp/bug_788231/+merge/63589
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug_788231 into lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2011-06-01 07:38:19 +0000
+++ openlp/core/lib/renderer.py	2011-06-06 17:41:16 +0000
@@ -241,7 +241,7 @@
         ``screen``
             The QSize of the screen.
         """
-        log.debug(u'calculate default %s', screen)
+        log.debug(u'_calculate default %s', screen)
         self.width = screen.width()
         self.height = screen.height()
         self.screen_ratio = float(self.height) / float(self.width)
@@ -286,7 +286,7 @@
         ``rect_footer``
             The footer text block.
         """
-        log.debug(u'set_text_rectangle %s , %s' % (rect_main, rect_footer))
+        log.debug(u'_set_text_rectangle %s , %s' % (rect_main, rect_footer))
         self._rect = rect_main
         self._rect_footer = rect_footer
         self.page_width = self._rect.width()
@@ -339,7 +339,7 @@
             # Text too long so go to next page.
             if self.web_frame.contentsSize().height() > self.page_height:
                 if force_page and line_count > 0:
-                    Receiver.send_message(u'theme_line_count', line_count)
+                    Receiver.send_message(u'theme_line_count', line_count - 1)
                 line_count = -1
                 while html_text.endswith(u'<br>'):
                     html_text = html_text[:-4]

=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py	2011-05-26 17:11:22 +0000
+++ openlp/core/ui/themeform.py	2011-06-06 17:41:16 +0000
@@ -202,7 +202,7 @@
         Updates the lines on a page on the wizard
         """
         self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm',
-            '(%d lines per slide)')) % int(lines))
+            '(approximately %d lines per slide)')) % int(lines))
 
     def resizeEvent(self, event=None):
         """


Follow ups