From 070d71996123efabab01177197952980590e1dae Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 15 May 2011 20:18:50 +0100 Subject: [PATCH] Fixes --- openlp/core/lib/mediamanageritem.py | 2 ++ openlp/plugins/custom/lib/mediaitem.py | 7 +++---- openlp/plugins/songs/lib/mediaitem.py | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 9c1a84c99..b4133943b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -28,6 +28,7 @@ Provides the generic functions for interfacing plugins with the Media Manager. """ import logging import os +import re from PyQt4 import QtCore, QtGui @@ -90,6 +91,7 @@ class MediaManagerItem(QtGui.QWidget): """ QtGui.QWidget.__init__(self) self.parent = parent + self.whitespace = re.compile(r'\W+', re.UNICODE) #TODO: plugin should not be the parent in future self.plugin = parent # plugin visible_title = self.plugin.getString(StringContent.VisibleName) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 61c1887f8..7a6d8a0b3 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -29,7 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - check_item_selected, translate, check_search_result + check_item_selected, translate from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomXMLParser @@ -63,7 +63,6 @@ class CustomMediaItem(MediaManagerItem): def addEndHeaderBar(self): self.addToolbarSeparator() - ## Song Maintenance Button ## self.searchWidget = QtGui.QWidget(self) self.searchWidget.setObjectName(u'searchWidget') self.searchLayout = QtGui.QVBoxLayout(self.searchWidget) @@ -122,7 +121,7 @@ class CustomMediaItem(MediaManagerItem): CustomSlide, order_by_ref=CustomSlide.title)) self.searchTextEdit.setCurrentSearchType(QtCore.QSettings().value( u'%s/last search type' % self.settingsSection, - QtCore.QVariant(SongSearch.Entire)).toInt()[0]) + QtCore.QVariant(CustomSearch.Titles)).toInt()[0]) # Called to redisplay the custom list screen edith from a search # or from the exit of the Custom edit dialog. If remote editing is # active trigger it and clean up so it will not update again. @@ -242,7 +241,7 @@ class CustomMediaItem(MediaManagerItem): CustomSlide.theme_name.like(u'%' + self.whitespace.sub(u' ', search_keywords) + u'%')) self.loadList(search_results) - check_search_result(self.listView, search_results) + self.check_search_result() def onSearchTextEditChanged(self, text): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 5648f78eb..2bb1c4cf6 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -26,7 +26,6 @@ import logging import locale -import re from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ @@ -72,7 +71,6 @@ class SongMediaItem(MediaManagerItem): # which Song is required. self.remoteSong = -1 self.editItem = None - self.whitespace = re.compile(r'\W+', re.UNICODE) self.quickPreviewAllowed = True def addEndHeaderBar(self):