forked from openlp/openlp
Give the media items the ability to do something when they are "focused".
Make the search edits on the Songs, Bibles and Custom media items focus when the item is selected.
This commit is contained in:
parent
548e41f15c
commit
38000b5e56
@ -431,6 +431,13 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to '
|
raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to '
|
||||||
u'be defined by the plugin')
|
u'be defined by the plugin')
|
||||||
|
|
||||||
|
def onFocus(self):
|
||||||
|
"""
|
||||||
|
Run when a tab in the media manager gains focus. This gives the media
|
||||||
|
item a chance to focus any elements it wants to.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
def generateSlideData(self, serviceItem, item=None, xmlVersion=False):
|
def generateSlideData(self, serviceItem, item=None, xmlVersion=False):
|
||||||
raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
|
raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
|
||||||
u'to be defined by the plugin')
|
u'to be defined by the plugin')
|
||||||
|
@ -537,6 +537,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
|
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
|
QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
|
||||||
|
# Media Manager
|
||||||
|
QtCore.QObject.connect(self.mediaToolBox,
|
||||||
|
QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
|
||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
# Simple message boxes
|
# Simple message boxes
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -602,6 +605,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
LanguageManager.auto_language = value
|
LanguageManager.auto_language = value
|
||||||
LanguageManager.set_language(self.languageGroup.checkedAction())
|
LanguageManager.set_language(self.languageGroup.checkedAction())
|
||||||
|
|
||||||
|
def onMediaToolBoxChanged(self, index):
|
||||||
|
widget = self.mediaToolBox.widget(index)
|
||||||
|
if widget:
|
||||||
|
widget.onFocus()
|
||||||
|
|
||||||
def versionNotice(self, version):
|
def versionNotice(self, version):
|
||||||
"""
|
"""
|
||||||
Notifies the user that a newer version of OpenLP is available.
|
Notifies the user that a newer version of OpenLP is available.
|
||||||
|
@ -273,6 +273,12 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
QtCore.SIGNAL(u'currentChanged(int)'),
|
QtCore.SIGNAL(u'currentChanged(int)'),
|
||||||
self.onSearchTabBarCurrentChanged)
|
self.onSearchTabBarCurrentChanged)
|
||||||
|
|
||||||
|
def onFocus(self):
|
||||||
|
if self.quickTab.isVisible():
|
||||||
|
self.quickSearchEdit.setFocus()
|
||||||
|
else:
|
||||||
|
self.advancedBookComboBox.setFocus()
|
||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
log.debug(u'configUpdated')
|
log.debug(u'configUpdated')
|
||||||
if QtCore.QSettings().value(self.settingsSection + u'/second bibles',
|
if QtCore.QSettings().value(self.settingsSection + u'/second bibles',
|
||||||
@ -463,6 +469,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
else:
|
else:
|
||||||
self.quickTab.setVisible(False)
|
self.quickTab.setVisible(False)
|
||||||
self.advancedTab.setVisible(True)
|
self.advancedTab.setVisible(True)
|
||||||
|
self.advancedBookComboBox.setFocus()
|
||||||
|
|
||||||
def onLockButtonToggled(self, checked):
|
def onLockButtonToggled(self, checked):
|
||||||
if checked:
|
if checked:
|
||||||
|
@ -199,6 +199,9 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
for row in row_list:
|
for row in row_list:
|
||||||
self.listView.takeItem(row)
|
self.listView.takeItem(row)
|
||||||
|
|
||||||
|
def onFocus(self):
|
||||||
|
self.searchTextEdit.setFocus()
|
||||||
|
|
||||||
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
||||||
raw_slides = []
|
raw_slides = []
|
||||||
raw_footer = []
|
raw_footer = []
|
||||||
|
@ -125,6 +125,9 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
QtCore.SIGNAL(u'searchTypeChanged(int)'),
|
QtCore.SIGNAL(u'searchTypeChanged(int)'),
|
||||||
self.onSearchTextButtonClick)
|
self.onSearchTextButtonClick)
|
||||||
|
|
||||||
|
def onFocus(self):
|
||||||
|
self.searchTextEdit.setFocus()
|
||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
self.searchAsYouType = QtCore.QSettings().value(
|
self.searchAsYouType = QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/search as type',
|
self.settingsSection + u'/search as type',
|
||||||
|
Loading…
Reference in New Issue
Block a user