← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/trivial into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/trivial into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/trivial/+merge/52723

Hello!

- "Entire Song" considers song comments
-- 
https://code.launchpad.net/~googol-hush/openlp/trivial/+merge/52723
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/trivial into lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-03-08 16:46:53 +0000
+++ openlp/core/ui/maindisplay.py	2011-03-09 18:19:01 +0000
@@ -516,9 +516,6 @@
 
         ``parent``
             The parent widget.
-
-        ``screens``
-            The list of screens.
         """
         log.debug(u'AudioPlayer Initialisation started')
         QtCore.QObject.__init__(self, parent)

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-03-08 16:46:53 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-03-09 18:19:01 +0000
@@ -159,15 +159,15 @@
     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 @@
         if self.searchAsYouType:
             search_length = 1
             if self.searchTextEdit.currentSearchType() == SongSearch.Entire:
+                search_length = 7
+            elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
                 search_length = 3
-            elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
-                search_length = 7
             if len(text) > search_length:
                 self.onSearchTextButtonClick()
+            elif len(text) == 0:
+                self.onClearTextButtonClick()
 
     def onImportClick(self):
         if not hasattr(self, u'import_wizard'):
@@ -446,10 +448,9 @@
                     add_song = False
                     editId = song.id
                     break
-        if add_song:
-            if self.addSongFromService:
-                editId = self.openLyrics.xml_to_song(item.xml_version)
-                self.onSearchTextButtonClick()
+        if add_song and self.addSongFromService:
+            editId = self.openLyrics.xml_to_song(item.xml_version)
+            self.onSearchTextButtonClick()
         # Update service with correct song id.
         if editId:
             Receiver.send_message(u'service_item_update',


Follow ups