From 3359726be2164e35cf78bbd34beb4538fbe6430f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 20 May 2011 17:14:10 +0200 Subject: [PATCH 01/12] improved media item sorting --- openlp/plugins/custom/lib/mediaitem.py | 5 +++++ openlp/plugins/songs/lib/mediaitem.py | 11 +++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 66b1c3675..72db3bfa4 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -25,6 +25,8 @@ ############################################################################### import logging +import locale +import operator from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_, func @@ -135,6 +137,9 @@ class CustomMediaItem(MediaManagerItem): def loadList(self, list): self.listView.clear() + # Sort the customs by its title considering language specific + # characters. + list.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) for customSlide in list: custom_name = QtGui.QListWidgetItem(customSlide.title) custom_name.setData( diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 5f961b2f2..19a2924b3 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -26,6 +26,7 @@ import logging import locale +import operator from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ @@ -229,7 +230,8 @@ class SongMediaItem(MediaManagerItem): def displayResultsSong(self, searchresults): log.debug(u'display results Song') self.listView.clear() - searchresults.sort(cmp=self.collateSongTitles) + # Sort the songs by its title considering language specific characters. + searchresults.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) for song in searchresults: author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) @@ -472,13 +474,6 @@ class SongMediaItem(MediaManagerItem): Receiver.send_message(u'service_item_update', u'%s:%s' % (editId, item._uuid)) - def collateSongTitles(self, song_1, song_2): - """ - Locale aware collation of song titles - """ - return locale.strcoll(unicode(song_1.title.lower()), - unicode(song_2.title.lower())) - def search(self, string): """ Search for some songs From 5a7aa2fb9fde71785dfbee7641f9c7a1ad6b2b70 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 20 May 2011 17:18:57 +0200 Subject: [PATCH 02/12] do not override list --- openlp/plugins/custom/lib/mediaitem.py | 10 +++++----- openlp/plugins/presentations/lib/mediaitem.py | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 72db3bfa4..f22771eff 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -135,15 +135,15 @@ class CustomMediaItem(MediaManagerItem): self.onPreviewClick() self.onRemoteEditClear() - def loadList(self, list): + def loadList(self, custom_slides): self.listView.clear() # Sort the customs by its title considering language specific # characters. - list.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) - for customSlide in list: - custom_name = QtGui.QListWidgetItem(customSlide.title) + custom_slides.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) + for custom_slide in custom_slides: + custom_name = QtGui.QListWidgetItem(custom_slide.title) custom_name.setData( - QtCore.Qt.UserRole, QtCore.QVariant(customSlide.id)) + QtCore.Qt.UserRole, QtCore.QVariant(custom_slide.id)) self.listView.addItem(custom_name) def onNewClick(self): diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 7660c9099..5cc6f1fe1 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -149,20 +149,18 @@ class PresentationMediaItem(MediaManagerItem): else: self.presentationWidget.hide() - def loadList(self, list, initialLoad=False): + def loadList(self, files, initialLoad=False): """ Add presentations into the media manager This is called both on initial load of the plugin to populate with existing files, and when the user adds new files via the media manager """ currlist = self.getFileList() - titles = [] - for file in currlist: - titles.append(os.path.split(file)[1]) + titles = [os.path.split(file)[1] for file in currlist] Receiver.send_message(u'cursor_busy') if not initialLoad: - self.parent.formparent.displayProgressBar(len(list)) - for file in list: + self.parent.formparent.displayProgressBar(len(files)) + for file in files: if not initialLoad: self.parent.formparent.incrementProgressBar() if currlist.count(file) > 0: From f753070f53bebc8f85d877ad666f4db0be9ca9c6 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 20 May 2011 19:06:38 +0200 Subject: [PATCH 03/12] fix for windows --- openlp/plugins/custom/lib/mediaitem.py | 3 ++- openlp/plugins/songs/lib/mediaitem.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index f22771eff..064a558ba 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -139,7 +139,8 @@ class CustomMediaItem(MediaManagerItem): self.listView.clear() # Sort the customs by its title considering language specific # characters. - custom_slides.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) + custom_slides.sort( + cmp=locale.strcoll, key=operator.attrgetter('title').lower()) for custom_slide in custom_slides: custom_name = QtGui.QListWidgetItem(custom_slide.title) custom_name.setData( diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 19a2924b3..eb65fa775 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -231,7 +231,8 @@ class SongMediaItem(MediaManagerItem): log.debug(u'display results Song') self.listView.clear() # Sort the songs by its title considering language specific characters. - searchresults.sort(cmp=locale.strcoll, key=operator.attrgetter('title')) + searchresults.sort( + cmp=locale.strcoll, key=operator.attrgetter('title').lower()) for song in searchresults: author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) From 594caf0a193a1e3e4ed80c856363b28681bda1c4 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 12:34:42 +0200 Subject: [PATCH 04/12] fix for windows --- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 064a558ba..e56200ee7 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -140,7 +140,7 @@ class CustomMediaItem(MediaManagerItem): # Sort the customs by its title considering language specific # characters. custom_slides.sort( - cmp=locale.strcoll, key=operator.attrgetter('title').lower()) + cmp=locale.strcoll, key=lambda custom: custom.title.lower()) for custom_slide in custom_slides: custom_name = QtGui.QListWidgetItem(custom_slide.title) custom_name.setData( diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index eb65fa775..cbdb20462 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -232,7 +232,7 @@ class SongMediaItem(MediaManagerItem): self.listView.clear() # Sort the songs by its title considering language specific characters. searchresults.sort( - cmp=locale.strcoll, key=operator.attrgetter('title').lower()) + cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in searchresults: author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) From 73293c2985daeead5ac3e5ec61d3709d1fd019d8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 13:14:05 +0200 Subject: [PATCH 05/12] removed imports --- openlp/plugins/custom/lib/mediaitem.py | 1 - openlp/plugins/songs/lib/mediaitem.py | 1 - 2 files changed, 2 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index e56200ee7..d19f462d7 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -26,7 +26,6 @@ import logging import locale -import operator from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_, func diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index cbdb20462..0dabeb766 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -26,7 +26,6 @@ import logging import locale -import operator from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ From ce5c354e06c587df7c0b04ab68ff2dddf0bf2a66 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 13:49:14 +0200 Subject: [PATCH 06/12] fix for head --- openlp/plugins/custom/lib/mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 054a75424..e137d69e3 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -146,7 +146,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.Qt.UserRole, QtCore.QVariant(custom_slide.id)) self.listView.addItem(custom_name) # Auto-select the item if name has been set - if customSlide.title == self.autoSelectItem : + if custom_slide.title == self.autoSelectItem: self.listView.setCurrentItem(custom_name) def onNewClick(self): From 7fbef0d7d77589d8da98cc10fe6a9562857ed55a Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Mon, 23 May 2011 11:41:22 -0400 Subject: [PATCH 07/12] added: resources/windows/psvince.dll modified: resources/windows/OpenLP-2.0.iss scripts/windows-builder.py --- resources/windows/OpenLP-2.0.iss | 17 +++++++++++++++++ resources/windows/psvince.dll | Bin 0 -> 36864 bytes scripts/windows-builder.py | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 resources/windows/psvince.dll diff --git a/resources/windows/OpenLP-2.0.iss b/resources/windows/OpenLP-2.0.iss index adeb4ef7c..9d2e6bfaa 100644 --- a/resources/windows/OpenLP-2.0.iss +++ b/resources/windows/OpenLP-2.0.iss @@ -65,6 +65,7 @@ Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription [Files] Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs +Source: psvince.dll; Flags: dontcopy ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] @@ -86,6 +87,9 @@ Root: HKCR; Subkey: "OpenLP\DefaultIcon"; ValueType: string; ValueName: ""; Valu Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1""" [Code] +function IsModuleLoaded(modulename: String ): Boolean; +external 'IsModuleLoaded@files:psvince.dll stdcall'; + function GetUninstallString(): String; var sUnInstPath: String; @@ -126,6 +130,19 @@ begin Result := 1; end; +function InitializeSetup(): Boolean; +begin + Result := true; + while IsModuleLoaded( 'OpenLP.exe' ) and Result do + begin + if MsgBox( 'Openlp is currently running, please close it to continue the install.', + mbError, MB_OKCANCEL ) = IDCANCEL then + begin + Result := false; + end; + end; +end; + procedure CurStepChanged(CurStep: TSetupStep); begin if (CurStep=ssInstall) then diff --git a/resources/windows/psvince.dll b/resources/windows/psvince.dll new file mode 100644 index 0000000000000000000000000000000000000000..e910509d0dfff5e99e12dbdd1a56bf3b5aadd5ff GIT binary patch literal 36864 zcmeHw3tU{)wf7!4kO>(w69bA$%)}5In-~ehkQruxAu!|xapDjN#yl`g1SCL*bMk7i z!~>S$WNO-`k9%)En>5;M)wbShZCb5D$Onl{)g)G<$!D=m?ZH7MCN~frIp2SsGebyx z-2U#p-{amNhu=E;wf5R;uf6x$Yd_{ta@TGa%NXMTio)1Ixb(Qx_m{t9Bu}3H+sW*i ziGP@JP*?ni8Ku=VP3A^_!@d5>P38@i_4N(B`5vFyFVvfB>dl3Bc+Hy{s(kYj6BE)R zq}SZ^mz3+j5nL99bL+pk>~@6zaf7%l5$@O5KfLS)HGS8zyWpN%|DYP)zfD?}qJ{&i zduPptYNGK)9DCf173<>IlapsSqd0wR@{CEkc&)M?Ep|^bToXVGn^Zr-Bp-UBF58Cy z;o*r<-w3GTs2d61#aIc_cdcY>HsQ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=02VKT5f-CV%~y0ci!f_9eIJg$Masvdpqy_JS9?o*Re9}Ae?0xy>CdMhN}o1AZGPSSf0@50<7XLv&Ui0_vzRPq%R0+1EQc&C zGc9vYrZaP4=AD@pnd>vFGat(Qr_4t)f0p^H%;z$@Gf!lm%}lUfXPpK46{(!yR{yqCI?Fa4M_M`Tb_BZYQ_7Clr>^HM}oX4GSItQE|IrTZloaCJ8IkO;# z^c+{tlAH}We9rcqV9tj*Kg{jS)#cUZwdMtB69$_mRp=)+i^o!q`czq}Ep?XfS)Q}} z5q+W0a@HbS1}uY?3zlKa!py~)#hISW(#+px{!jFczhw?&4rX4+oMLrYH(7b>R_hLH zi?!9-Zrx?wZGFqyXFY3`tpnDstp2PIvp&gMxM1yq`xb0nAT8LlVBdlh3(hV$zaYtW zgUw-c+dQ_Fwly~17O*{J`+@C8w#RL!Y-epB*e=;(?TPlO_A>i=^q^XM18V;*`=|EU z>>1e^+3xJSvbSbGnEl=C1KEeOU(Nn=_8@wY$#Ik8D~{V7c1NybF?v$DV~wNAQG@>U zeTVE|=s`wj68cc8)9t*^+2-8k-0j@s{GoHNbD#4O=VOrHurusrIb2R{j*zoE=Lb1^ zbN1ytlGBwF%9)m%mODFlZf<&RX09#Qnd{2!$laa0C-;ZBdvim%gSm#h>3O&0+45X@ zp1jIDK5tjvlX=)`A~Ca=^rZCM^as;-rT=4kfBNPD`Ps*ive_8?DK#daJ=|vL;zmtf^MBHO)HPIv4#g(`vIitu8CkF1C8C zr5M+DV`NuZtF3j`#?Q3o9_tUSd#(Gdk60hGK52c*dc=Cn`l|Ic>nZD*(RLoThOI1X nuWg?VjE+C!5*U}jxCF)}FfM^{35-i%Tms_~7?;5RH3|H0b-PZz literal 0 HcmV?d00001 diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 8f2dc0171..26394f189 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -225,6 +225,8 @@ def copy_windows_files(): os.path.join(dist_path, u'OpenLP.ico')) copy(os.path.join(winres_path, u'LICENSE.txt'), os.path.join(dist_path, u'LICENSE.txt')) + copy(os.path.join(winres_path, u'psvince.dll'), + os.path.join(dist_path, u'psvince.dll')) if os.path.isfile(os.path.join(helpfile_path, u'Openlp.chm')): print u' Windows help file found' copy(os.path.join(helpfile_path, u'Openlp.chm'), From ffd017799f7574e66562a4828c1003555169a77e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 19:28:52 +0200 Subject: [PATCH 08/12] new 'word by word' algorithm --- openlp/core/lib/renderer.py | 68 +++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index bba85d176..f06fba539 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -231,7 +231,11 @@ class Renderer(object): pages.extend(new_pages) # Bibles elif item.is_capable(ItemCapabilities.AllowsWordSplit): + import time + import datetime + start = time.time() pages = self._paginate_slide_words(text, line_break) + print unicode(datetime.timedelta(seconds=time.time() - start)) return pages def _calculate_default(self, screen): @@ -367,7 +371,7 @@ class Renderer(object): """ log.debug(u'_paginate_slide_words - Start') - line_end = u'' + line_end = u' ' if line_break: line_end = u'
' formatted = [] @@ -375,6 +379,7 @@ class Renderer(object): previous_raw = u'' lines = text.split(u'\n') for line in lines: + line = line.strip() styled_line = expand_tags(line) html = self.page_shell + previous_html + styled_line + HTML_END self.web.setHtml(html) @@ -402,24 +407,59 @@ class Renderer(object): previous_html = styled_line + line_end previous_raw = line + line_end continue - words = self._words_split(line) - for word in words: - styled_word = expand_tags(word) - html = self.page_shell + previous_html + styled_word + \ - HTML_END + # Figure out how many words of the line will fit on screen. + # Instead of just looping of the list of words we follow a + # certain tactic, namely we try if the half of line fits. If it + # does we try if the half of the other half and the first half + # (75%) will still fit. In the case that the first half does not + # fit, we try if 25% will fit. + raw_words = self._words_split(line) + html_words = [expand_tags(word) for word in raw_words] + smallest_index = 0 + highest_index = len(html_words) - 1 + index = int(highest_index / 2) + while True: + html = self.page_shell + previous_html + \ + u''.join(html_words[:index + 1]).strip() + HTML_END self.web.setHtml(html) - # Text too long so go to next page if self.web_frame.contentsSize().height() > \ self.page_height: - while previous_raw.endswith(u'
'): - previous_raw = previous_raw[:-4] - formatted.append(previous_raw) + # We know that it does not fit, so change/calculate the + # new index and highest_index accordingly. + highest_index = index + index = int(index - (index - smallest_index) / 2) + else: + smallest_index = index + index = int(index + (highest_index - index) / 2) + # We found the number of words which will fit + if smallest_index == index or highest_index == index: + formatted.append(previous_raw.rstrip(u'
') + + u''.join(raw_words[:index + 1])) previous_html = u'' previous_raw = u'' - previous_html += styled_word - previous_raw += word - previous_html += line_end - previous_raw += line_end + else: + continue + # Check if the rest of the line fits on the slide. If it + # does we do not have to do the much more intensive "word by + # word" checking. + html = self.page_shell + \ + u''.join(html_words[index + 1:]).strip() + HTML_END + self.web.setHtml(html) + if self.web_frame.contentsSize().height() <= \ + self.page_height: + previous_html = \ + u''.join(html_words[index + 1:]).strip() + line_end + previous_raw = \ + u''.join(raw_words[index + 1:]).strip() + line_end + break + else: + # The other words do not fit, thus reset the indexes, + # create a new list and continue with "word by word". + raw_words = raw_words[index + 1:] + html_words = html_words[index + 1:] + smallest_index = 0 + highest_index = len(html_words) - 1 + index = int(highest_index / 2) else: previous_html += styled_line + line_end previous_raw += line + line_end From 86023454916178161633cf51ef1655a5fc032dad Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 20:23:45 +0200 Subject: [PATCH 09/12] removed print --- openlp/core/lib/renderer.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index f06fba539..ea6c3b4ce 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -231,11 +231,7 @@ class Renderer(object): pages.extend(new_pages) # Bibles elif item.is_capable(ItemCapabilities.AllowsWordSplit): - import time - import datetime - start = time.time() pages = self._paginate_slide_words(text, line_break) - print unicode(datetime.timedelta(seconds=time.time() - start)) return pages def _calculate_default(self, screen): From 5b7dc621123e5860bbdb11d3e87cf5e5092182dd Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 23 May 2011 20:41:49 +0200 Subject: [PATCH 10/12] comments --- openlp/core/lib/renderer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index f413bd778..6b20f7670 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -335,7 +335,7 @@ class Renderer(object): styled_text += styled_line html = self.page_shell + styled_text + HTML_END self.web.setHtml(html) - # Text too long so go to next page + # 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) @@ -378,7 +378,7 @@ class Renderer(object): styled_line = expand_tags(line) html = self.page_shell + previous_html + styled_line + HTML_END self.web.setHtml(html) - # Text too long so go to next page + # Text too long so go to next page. if self.web_frame.contentsSize().height() > self.page_height: # Check if there was a verse before the current one and append # it, when it fits on the page. @@ -426,7 +426,7 @@ class Renderer(object): else: smallest_index = index index = int(index + (highest_index - index) / 2) - # We found the number of words which will fit + # We found the number of words which will fit. if smallest_index == index or highest_index == index: formatted.append(previous_raw.rstrip(u'
') + u''.join(raw_words[:index + 1])) From 5473d3c817febdad4e622c7d63df61efbff00623 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 24 May 2011 07:23:28 +0200 Subject: [PATCH 11/12] added windows comment --- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index e137d69e3..85e6e51f2 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -137,7 +137,7 @@ class CustomMediaItem(MediaManagerItem): def loadList(self, custom_slides): self.listView.clear() # Sort the customs by its title considering language specific - # characters. + # characters. lower() is needed for windows! custom_slides.sort( cmp=locale.strcoll, key=lambda custom: custom.title.lower()) for custom_slide in custom_slides: diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 45827da0b..23632ca58 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -230,6 +230,7 @@ class SongMediaItem(MediaManagerItem): log.debug(u'display results Song') self.listView.clear() # Sort the songs by its title considering language specific characters. + # lower() is needed for windows! searchresults.sort( cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in searchresults: From 2377a5f5ff915f19b08fd0f5a144d6f324bf25cd Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 24 May 2011 09:02:13 +0200 Subject: [PATCH 12/12] fix for Esther 8:7 --- openlp/core/lib/renderer.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 6b20f7670..cb65dc057 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -402,12 +402,8 @@ class Renderer(object): previous_html = styled_line + line_end previous_raw = line + line_end continue - # Figure out how many words of the line will fit on screen. - # Instead of just looping of the list of words we follow a - # certain tactic, namely we try if the half of line fits. If it - # does we try if the half of the other half and the first half - # (75%) will still fit. In the case that the first half does not - # fit, we try if 25% will fit. + # Figure out how many words of the line will fit on screen by + # using the algorithm known as "binary chop". raw_words = self._words_split(line) html_words = [expand_tags(word) for word in raw_words] smallest_index = 0 @@ -428,6 +424,7 @@ class Renderer(object): index = int(index + (highest_index - index) / 2) # We found the number of words which will fit. if smallest_index == index or highest_index == index: + index = smallest_index formatted.append(previous_raw.rstrip(u'
') + u''.join(raw_words[:index + 1])) previous_html = u''