Song sequence, alert position and make OOo not invisible anymore

This commit is contained in:
Jonathan Corwin 2011-03-12 00:12:52 +00:00
parent 69478231e0
commit f04964e073
3 changed files with 20 additions and 12 deletions

View File

@ -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

View File

@ -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:

View File

@ -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()))