From f04964e07343bfc94b5fdd6d06c0c7f8dda21028 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Sat, 12 Mar 2011 00:12:52 +0000 Subject: [PATCH] Song sequence, alert position and make OOo not invisible anymore --- openlp/core/ui/maindisplay.py | 17 +++++++++++++---- openlp/core/utils/__init__.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 13 ++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 72ebe422a..858383f12 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -181,6 +181,7 @@ class MainDisplay(DisplayWidget): # Wait for the webview to update before displaying text. while not self.webLoaded: Receiver.send_message(u'openlp_process_events') + self.setGeometry(self.screen[u'size']) self.frame.evaluateJavaScript(u'show_text("%s")' % \ slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')) return self.preview() @@ -192,7 +193,7 @@ class MainDisplay(DisplayWidget): `slide` The slide text to be displayed """ - log.debug(u'alert to display') + log.debug(u'alert to display') if self.height() != self.screen[u'size'].height() \ or not self.isVisible() or self.videoWidget.isVisible(): shrink = True @@ -208,12 +209,18 @@ class MainDisplay(DisplayWidget): else: shrinkItem = self if text: - shrinkItem.resize(self.width(), int(height.toString())) + alert_height = int(height.toString()) + shrinkItem.resize(self.width(), alert_height) shrinkItem.setVisible(True) + if self.alertTab.location == 1: + shrinkItem.move(self.screen[u'size'].left(), + (self.screen[u'size'].height() - alert_height) / 2) + elif self.alertTab.location == 2: + shrinkItem.move(self.screen[u'size'].left(), + self.screen[u'size'].height() - alert_height) else: shrinkItem.setVisible(False) - shrinkItem.resize(self.screen[u'size'].width(), - self.screen[u'size'].height()) + self.setGeometry(self.screen[u'size']) def directImage(self, name, path): """ @@ -243,6 +250,7 @@ class MainDisplay(DisplayWidget): """ Display an image, as is. """ + self.setGeometry(self.screen[u'size']) if image: js = u'show_image("data:image/png;base64,%s");' % image else: @@ -336,6 +344,7 @@ class MainDisplay(DisplayWidget): """ log.debug(u'video') self.webLoaded = True + self.setGeometry(self.screen[u'size']) # We are running a background theme self.override[u'theme'] = u'' self.override[u'video'] = True diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index f3dacee88..0454c35d0 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -384,7 +384,7 @@ def get_uno_command(): Returns the UNO command to launch an openoffice.org instance. """ COMMAND = u'soffice' - OPTIONS = u'-nologo -norestore -minimized -invisible -nofirststartwizard' + OPTIONS = u'-nologo -norestore -minimized -nofirststartwizard' if UNO_CONNECTION_TYPE == u'pipe': CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' else: diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index feabc98b7..a07b5091f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -166,20 +166,18 @@ class SongMediaItem(MediaManagerItem): or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ', search_keywords.lower()) + u'%'), Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'), - Song.comments.like(u'%' + search_keywords.lower() + u'%')), - Song.search_title.asc()) + Song.comments.like(u'%' + search_keywords.lower() + u'%'))) self.displayResultsSong(search_results) elif search_type == SongSearch.Titles: log.debug(u'Titles Search') search_results = self.parent.manager.get_all_objects(Song, Song.search_title.like(u'%' + self.whitespace.sub(u' ', - search_keywords.lower()) + u'%'), Song.search_title.asc()) + search_keywords.lower()) + u'%')) self.displayResultsSong(search_results) elif search_type == SongSearch.Lyrics: log.debug(u'Lyrics Search') search_results = self.parent.manager.get_all_objects(Song, - Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'), - Song.search_lyrics.asc()) + Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%')) self.displayResultsSong(search_results) elif search_type == SongSearch.Authors: log.debug(u'Authors Search') @@ -190,7 +188,7 @@ class SongMediaItem(MediaManagerItem): elif search_type == SongSearch.Themes: log.debug(u'Theme Search') search_results = self.parent.manager.get_all_objects(Song, - Song.theme_name == search_keywords, Song.search_lyrics.asc()) + Song.theme_name == search_keywords) self.displayResultsSong(search_results) def onSongListLoad(self): @@ -461,4 +459,5 @@ class SongMediaItem(MediaManagerItem): """ Locale aware collation of song titles """ - return locale.strcoll(unicode(song_1.title), unicode(song_2.title)) + return locale.strcoll(unicode(song_1.title.lower()), + unicode(song_2.title.lower()))