← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~sam92/openlp/bugs into lp:openlp

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/bugs into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1530340 in OpenLP: "Ctrl-F should select all text in the search field"
  https://bugs.launchpad.net/openlp/+bug/1530340
  Bug #1530354 in OpenLP: "Allow entering verse order in lowercase"
  https://bugs.launchpad.net/openlp/+bug/1530354

For more details, see:
https://code.launchpad.net/~sam92/openlp/bugs/+merge/281688

Usability improvements

* When pressing Ctrl+F, select the text in the searchfield to allow immediate typing
* Allow entering the verse order in lowercase (automatically convert to uppercase)
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/bugs into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2016-01-05 19:20:42 +0000
@@ -254,6 +254,7 @@
     def on_focus(self):
         if self.quickTab.isVisible():
             self.quick_search_edit.setFocus()
+            self.quick_search_edit.selectAll()
         else:
             self.advanced_book_combo_box.setFocus()
 

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2015-12-31 22:46:06 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2016-01-05 19:20:42 +0000
@@ -208,6 +208,7 @@
         Set the focus
         """
         self.search_text_edit.setFocus()
+        self.search_text_edit.selectAll()
 
     def generate_slide_data(self, service_item, item=None, xml_version=False,
                             remote=False, context=ServiceItemContext.Service):

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2016-01-05 19:20:42 +0000
@@ -76,7 +76,7 @@
         self.verse_edit_all_button.clicked.connect(self.on_verse_edit_all_button_clicked)
         self.verse_delete_button.clicked.connect(self.on_verse_delete_button_clicked)
         self.verse_list_widget.itemClicked.connect(self.on_verse_list_view_clicked)
-        self.verse_order_edit.textChanged.connect(self.on_verse_order_text_changed)
+        self.verse_order_edit.textEdited.connect(self.on_verse_order_text_changed)
         self.theme_add_button.clicked.connect(self.theme_manager.on_add_theme)
         self.maintenance_button.clicked.connect(self.on_maintenance_button_clicked)
         self.from_file_button.clicked.connect(self.on_audio_add_from_file_button_clicked)
@@ -803,6 +803,8 @@
 
         :param text: The text of the verse order edit (ignored).
         """
+        # First make sure that all letters entered in the verse order field are uppercase
+        self.verse_order_edit.setText(text.upper())
         # Extract all verses which were used in the order.
         verses_in_order = self._extract_verse_order(self.verse_order_edit.text())
         # Find the verses which were not used in the order.

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2016-01-05 19:20:42 +0000
@@ -112,6 +112,7 @@
 
     def on_focus(self):
         self.search_text_edit.setFocus()
+        self.search_text_edit.selectAll()
 
     def config_update(self):
         """

=== modified file 'tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py'
--- tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py	2015-12-31 22:46:06 +0000
+++ tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py	2016-01-05 19:20:42 +0000
@@ -142,3 +142,18 @@
                              'CCLI label should not be "{}"'.format(UiStrings().CCLINumberLabel))
         self.assertEquals(form.ccli_label.text(), UiStrings().CCLISongNumberLabel,
                           'CCLI label text should be "{}"'.format(UiStrings().CCLISongNumberLabel))
+
+    def verse_order_lowercase_test(self):
+        """
+        Test that entering a verse order in lowercase automatically converts to uppercase
+        """
+        # GIVEN; Mocked methods
+        form = self.form
+
+        # WHEN: We enter a verse order in lowercase
+        form.verse_order_edit.setText('v1 v2 c1 v3 c1 v4 c1')
+        # Need to manually trigger this method as it is only triggered by manual input
+        form.on_verse_order_text_changed(form.verse_order_edit.text())
+
+        # THEN: The verse order should be converted to uppercase
+        self.assertEqual(form.verse_order_edit.text(), 'V1 V2 C1 V3 C1 V4 C1')


Follow ups