From de8074b00a9e64244ee0ad082d4df899fe8a5384 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 19 May 2014 21:19:05 +0200 Subject: [PATCH 1/4] Improve single click behavior (remove flickering) --- openlp/core/lib/mediamanageritem.py | 5 +++-- openlp/core/ui/listpreviewwidget.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 4d7676ad6..5893e8c38 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -495,8 +495,8 @@ s 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 @@ s 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): """ diff --git a/openlp/core/ui/listpreviewwidget.py b/openlp/core/ui/listpreviewwidget.py index 7dbcfc2bd..831eb182b 100644 --- a/openlp/core/ui/listpreviewwidget.py +++ b/openlp/core/ui/listpreviewwidget.py @@ -136,7 +136,6 @@ class ListPreviewWidget(QtGui.QTableWidget, RegistryProperties): 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): From d1814f05dea6eb728570514ef444102ac2dc843b Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 21 May 2014 17:17:08 +0200 Subject: [PATCH 2/4] Add test --- tests/functional/openlp_core_lib/test_ui.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/functional/openlp_core_lib/test_ui.py b/tests/functional/openlp_core_lib/test_ui.py index f1b8ee17a..b017a60f0 100644 --- a/tests/functional/openlp_core_lib/test_ui.py +++ b/tests/functional/openlp_core_lib/test_ui.py @@ -197,3 +197,20 @@ class TestUi(TestCase): # 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) + From 4fadbef1964ff5a5ff753d7151345faa7e659724 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 21 May 2014 17:22:13 +0200 Subject: [PATCH 3/4] PEP8 --- tests/functional/openlp_core_lib/test_ui.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_ui.py b/tests/functional/openlp_core_lib/test_ui.py index b017a60f0..fa098ba84 100644 --- a/tests/functional/openlp_core_lib/test_ui.py +++ b/tests/functional/openlp_core_lib/test_ui.py @@ -197,7 +197,7 @@ class TestUi(TestCase): # 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 @@ -213,4 +213,3 @@ class TestUi(TestCase): completer = line_edit.completer() self.assertIsInstance(completer, QtGui.QCompleter) self.assertEqual(completer.caseSensitivity(), QtCore.Qt.CaseInsensitive) - From 5345f52cf41de9c86205c46b215707de461d2928 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 21 May 2014 17:22:49 +0200 Subject: [PATCH 4/4] chmod +x jenkins_script.py --- scripts/jenkins_script.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/jenkins_script.py diff --git a/scripts/jenkins_script.py b/scripts/jenkins_script.py old mode 100644 new mode 100755