Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-788132 into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #788132 in OpenLP: "Search edit has no focus when changing a media 
manager tab"
  https://bugs.launchpad.net/openlp/+bug/788132

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-788132/+merge/62417

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.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/bug-788132/+merge/62417
Your team OpenLP Core is requested to review the proposed merge of 
lp:~raoul-snyman/openlp/bug-788132 into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2011-05-24 20:47:05 +0000
+++ openlp/core/lib/mediamanageritem.py	2011-05-26 06:29:24 +0000
@@ -431,6 +431,13 @@
         raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to '
             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):
         raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
             u'to be defined by the plugin')

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2011-05-25 08:32:37 +0000
+++ openlp/core/ui/mainwindow.py	2011-05-26 06:29:24 +0000
@@ -537,6 +537,9 @@
             QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
         QtCore.QObject.connect(Receiver.get_receiver(),
             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')
         # Simple message boxes
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -602,6 +605,11 @@
         LanguageManager.auto_language = value
         LanguageManager.set_language(self.languageGroup.checkedAction())
 
+    def onMediaToolBoxChanged(self, index):
+        widget = self.mediaToolBox.widget(index)
+        if widget:
+            widget.onFocus()
+
     def versionNotice(self, version):
         """
         Notifies the user that a newer version of OpenLP is available.

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-05-25 18:42:03 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-05-26 06:29:24 +0000
@@ -273,6 +273,12 @@
             QtCore.SIGNAL(u'currentChanged(int)'),
             self.onSearchTabBarCurrentChanged)
 
+    def onFocus(self):
+        if self.quickTab.isVisible():
+            self.quickSearchEdit.setFocus()
+        else:
+            self.advancedBookComboBox.setFocus()
+
     def configUpdated(self):
         log.debug(u'configUpdated')
         if QtCore.QSettings().value(self.settingsSection + u'/second bibles',
@@ -463,6 +469,7 @@
         else:
             self.quickTab.setVisible(False)
             self.advancedTab.setVisible(True)
+            self.advancedBookComboBox.setFocus()
 
     def onLockButtonToggled(self, checked):
         if checked:

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2011-05-24 20:53:41 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2011-05-26 06:29:24 +0000
@@ -199,6 +199,9 @@
             for row in row_list:
                 self.listView.takeItem(row)
 
+    def onFocus(self):
+        self.searchTextEdit.setFocus()
+
     def generateSlideData(self, service_item, item=None, xmlVersion=False):
         raw_slides = []
         raw_footer = []

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-05-25 18:42:03 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-05-26 06:29:24 +0000
@@ -125,6 +125,9 @@
             QtCore.SIGNAL(u'searchTypeChanged(int)'),
             self.onSearchTextButtonClick)
 
+    def onFocus(self):
+        self.searchTextEdit.setFocus()
+
     def configUpdated(self):
         self.searchAsYouType = QtCore.QSettings().value(
             self.settingsSection + u'/search as type',

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to