forked from openlp/openlp
serach comments
This commit is contained in:
parent
42740f4b28
commit
674e9713e7
@ -516,9 +516,6 @@ class AudioPlayer(QtCore.QObject):
|
||||
|
||||
``parent``
|
||||
The parent widget.
|
||||
|
||||
``screens``
|
||||
The list of screens.
|
||||
"""
|
||||
log.debug(u'AudioPlayer Initialisation started')
|
||||
QtCore.QObject.__init__(self, parent)
|
||||
|
@ -159,15 +159,15 @@ class SongMediaItem(MediaManagerItem):
|
||||
def onSearchTextButtonClick(self):
|
||||
search_keywords = unicode(self.searchTextEdit.displayText())
|
||||
search_results = []
|
||||
# search_type = self.searchTypeComboBox.currentIndex()
|
||||
search_type = self.searchTextEdit.currentSearchType()
|
||||
if search_type == SongSearch.Entire:
|
||||
log.debug(u'Entire Song Search')
|
||||
search_results = self.parent.manager.get_all_objects(Song,
|
||||
or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ',
|
||||
search_keywords.lower()) + u'%'),
|
||||
Song.search_lyrics.like(u'%' + search_keywords.lower() + \
|
||||
u'%')), Song.search_title.asc())
|
||||
Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'),
|
||||
Song.comments.like(u'%' + search_keywords.lower() + u'%')),
|
||||
Song.search_title.asc())
|
||||
self.displayResultsSong(search_results)
|
||||
elif search_type == SongSearch.Titles:
|
||||
log.debug(u'Titles Search')
|
||||
@ -253,11 +253,13 @@ class SongMediaItem(MediaManagerItem):
|
||||
if self.searchAsYouType:
|
||||
search_length = 1
|
||||
if self.searchTextEdit.currentSearchType() == SongSearch.Entire:
|
||||
search_length = 3
|
||||
elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
|
||||
search_length = 7
|
||||
elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
|
||||
search_length = 3
|
||||
if len(text) > search_length:
|
||||
self.onSearchTextButtonClick()
|
||||
elif len(text) == 0:
|
||||
self.onClearTextButtonClick()
|
||||
|
||||
def onImportClick(self):
|
||||
if not hasattr(self, u'import_wizard'):
|
||||
@ -446,8 +448,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
add_song = False
|
||||
editId = song.id
|
||||
break
|
||||
if add_song:
|
||||
if self.addSongFromService:
|
||||
if add_song and self.addSongFromService:
|
||||
editId = self.openLyrics.xml_to_song(item.xml_version)
|
||||
self.onSearchTextButtonClick()
|
||||
# Update service with correct song id.
|
||||
|
Loading…
Reference in New Issue
Block a user