This commit is contained in:
Tim Bentley 2011-05-15 20:18:50 +01:00
parent 387c911fdb
commit 070d719961
3 changed files with 5 additions and 6 deletions

View File

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

View File

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

View File

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