Re: [Openlp-core] [Merge] lp:~trb143/openlp/fixes into lp:openlp

2009-11-21 Thread Jonathan Corwin
Out of curiosity, why have you made all the files executable? 
-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/15118
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~mgorven/openlp/get-strings into lp:openlp

2009-11-21 Thread Michael Gorven
Michael Gorven has proposed merging lp:~mgorven/openlp/get-strings into 
lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)

-- 
https://code.launchpad.net/~mgorven/openlp/get-strings/+merge/15120
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp-get-strings.py' (properties changed: -x to +x)
--- openlp-get-strings.py	2009-11-05 16:29:49 +
+++ openlp-get-strings.py	2009-11-21 13:20:25 +
@@ -42,7 +42,7 @@
   translation type=unfinished/translation
 /message
 
-find_trUtf8 = re.compile(rtrUtf8\(u'([\.:;\\\w]+)'\), re.UNICODE)
+find_trUtf8 = re.compile(rtrUtf8\(u?(['\])([^\1]+)\1\), re.UNICODE)
 strings = {}
 
 def parse_file(filename):
@@ -56,9 +56,9 @@
 class_name = line[6:line.find(u'(')]
 continue
 for match in find_trUtf8.finditer(line):
-key = u'%s-%s' % (class_name, match.group(1))
+key = u'%s-%s' % (class_name, match.group(2))
 if not key in strings:
-strings[key] = [class_name, filename, line_number, match.group(1)]
+strings[key] = [class_name, filename, line_number, match.group(2)]
 file.close()
 
 def write_file(filename):

=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py	2009-11-12 23:49:35 +
+++ openlp/core/ui/amendthemeform.py	2009-11-21 13:20:25 +
@@ -193,7 +193,7 @@
 
 def onImageToolButtonClicked(self):
 filename = QtGui.QFileDialog.getOpenFileName(
-self, self.trUtf8('Open file'))
+self, self.trUtf8(u'Open file'))
 if filename:
 self.ImageLineEdit.setText(filename)
 self.theme.background_filename = filename

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~mgorven/openlp/get-strings into lp:openlp

2009-11-21 Thread Raoul Snyman
Review: Approve 
Excellent
-- 
https://code.edge.launchpad.net/~mgorven/openlp/get-strings/+merge/15120
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~trb143/openlp/renderer into lp:openlp

2009-11-21 Thread Tim Bentley
Tim Bentley has proposed merging lp:~trb143/openlp/renderer into lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)


2nd attempt to get the Gushie proof renderer changes in.
-- 
https://code.launchpad.net/~trb143/openlp/renderer/+merge/15122
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2009-11-04 01:16:15 +
+++ openlp/core/lib/renderer.py	2009-11-21 15:40:25 +
@@ -168,35 +168,45 @@
 line_width = self._rect.width() - self._right_margin
 #number of lines on a page - adjust for rounding up.
 page_length = int(self._rect.height() / metrics.height() - 2 ) - 1
+#Average number of characters in line
 ave_line_width = line_width / metrics.averageCharWidth()
-ave_line_width = int(ave_line_width + (ave_line_width * 1))
+#Maximum size of a character
+max_char_width = metrics.maxWidth()
+#Min size of a character
+min_char_width = metrics.width(u'i')
+char_per_line = line_width / min_char_width
 log.debug(u'Page Length  area height %s , metrics %s , lines %s' %
   (int(self._rect.height()), metrics.height(), page_length ))
 split_pages = []
 page = []
 split_lines = []
+count = 0
 for line in text:
 #Must be a blank line so keep it.
 if len(line) == 0:
 line = u' '
 while len(line)  0:
-if len(line)  ave_line_width:
-pos = line.find(u' ', ave_line_width)
-split_text = line[:pos]
-else:
-pos = len(line)
-split_text = line
-while metrics.width(split_text, -1)  line_width:
-#Find the next space to the left
-pos = line[:pos].rfind(u' ')
-#no more spaces found
-if pos == 0:
-split_text = line
+pos = char_per_line
+split_text = line[:pos]
+#line needs splitting
+if metrics.width(split_text, -1)  line_width:
+#We have no spaces
+if split_text.find(u' ') == -1:
+#Move back 1 char at a time till it fits
 while metrics.width(split_text, -1)  line_width:
 split_text = split_text[:-1]
-pos = len(split_text)
+pos = len(split_text)
 else:
-split_text = line[:pos]
+#We have spaces so split at previous one
+while metrics.width(split_text, -1)  line_width:
+pos = split_text.rfind(u' ')
+#no more spaces and we are still too long
+if pos == -1:
+while metrics.width(split_text, -1)  line_width:
+split_text = split_text[:-1]
+pos = len(split_text)
+else:
+split_text = line[:pos]
 split_lines.append(split_text)
 line = line[pos:].lstrip()
 #if we have more text add up to 10 spaces on the front.
@@ -450,32 +460,32 @@
 draw=True, color = self._theme.display_shadow_color)
 if self._theme.display_outline:
 self._get_extent_and_render(line, footer,
-(x+self._outline_offset, y), draw=True,
-color = self._theme.display_outline_color)
-self._get_extent_and_render(line, footer,
-(x, y+self._outline_offset), draw=True,
-color = self._theme.display_outline_color)
-self._get_extent_and_render(line, footer,
-(x, y-self._outline_offset), draw=True,
-color = self._theme.display_outline_color)
-self._get_extent_and_render(line, footer,
-(x-self._outline_offset, y), draw=True,
+(x + self._outline_offset, y), draw=True,
+color = self._theme.display_outline_color)
+self._get_extent_and_render(line, footer,
+(x, y + self._outline_offset), draw=True,
+color = self._theme.display_outline_color)
+self._get_extent_and_render(line, footer,
+(x, y - self._outline_offset), draw=True,
+color = self._theme.display_outline_color)
+self._get_extent_and_render(line, footer,
+(x - self._outline_offset, y), draw=True,