← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~sam92/openlp/improve-single-click-behavior into lp:openlp

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/improve-single-click-behavior into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~sam92/openlp/improve-single-click-behavior/+merge/220485

Remove flickering when single click option is active

To test:
Activate the "Preview items when clicked in Media Manager" option (Advanced options)

Before patch: Focus goes to preview widget, then returns to Media manager (produces flickering)
After patch: Focus stays on Media manager (no flickering)

lp:~sam92/openlp/improve-single-click-behavior (revision 2386)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/462/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/418/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/363/
[SUCCESS] http://ci.openlp.org/job/Branch-04-Windows_Tests/324/
[SUCCESS] http://ci.openlp.org/job/Branch-05a-Code_Analysis/221/
[SUCCESS] http://ci.openlp.org/job/Branch-05b-Test_Coverage/95/
-- 
https://code.launchpad.net/~sam92/openlp/improve-single-click-behavior/+merge/220485
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/improve-single-click-behavior into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2014-04-12 20:19:22 +0000
+++ openlp/core/lib/mediamanageritem.py	2014-05-21 15:27:23 +0000
@@ -495,8 +495,8 @@
             if service_item:
                 service_item.from_plugin = True
                 self.preview_controller.add_service_item(service_item)
-                if keep_focus:
-                    self.list_view.setFocus()
+                if not keep_focus:
+                    self.preview_controller.preview_widget.setFocus()
 
     def on_live_click(self):
         """
@@ -535,6 +535,7 @@
             if remote:
                 service_item.will_auto_start = True
             self.live_controller.add_service_item(service_item)
+            self.live_controller.preview_widget.setFocus()
 
     def create_item_from_id(self, item_id):
         """

=== modified file 'openlp/core/ui/listpreviewwidget.py'
--- openlp/core/ui/listpreviewwidget.py	2014-03-20 19:10:31 +0000
+++ openlp/core/ui/listpreviewwidget.py	2014-05-21 15:27:23 +0000
@@ -136,7 +136,6 @@
         if self.service_item.is_text():
             self.resizeRowsToContents()
         self.setColumnWidth(0, self.viewport().width())
-        self.setFocus()
         self.change_slide(slide_number)
 
     def change_slide(self, slide):

=== modified file 'scripts/jenkins_script.py' (properties changed: -x to +x)
=== modified file 'tests/functional/openlp_core_lib/test_ui.py'
--- tests/functional/openlp_core_lib/test_ui.py	2014-05-07 23:52:51 +0000
+++ tests/functional/openlp_core_lib/test_ui.py	2014-05-21 15:27:23 +0000
@@ -197,3 +197,19 @@
 
         # THEN: The index should have changed
         self.assertEqual(2, combo.currentIndex())
+
+    def test_set_case_insensitive_completer(self):
+        """
+        Test setting a case insensitive completer on a widget
+        """
+        # GIVEN: A QComboBox and a list of completion items
+        line_edit = QtGui.QLineEdit()
+        suggestions = ['one', 'Two', 'THRee', 'FOUR']
+
+        # WHEN: We call the function
+        set_case_insensitive_completer(suggestions, line_edit)
+
+        # THEN: The Combobox should have a completer which is case insensitive
+        completer = line_edit.completer()
+        self.assertIsInstance(completer, QtGui.QCompleter)
+        self.assertEqual(completer.caseSensitivity(), QtCore.Qt.CaseInsensitive)


Follow ups