forked from openlp/openlp
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) bzr-revno: 2592 Fixes: https://launchpad.net/bugs/1530340, https://launchpad.net/bugs/1530354
This commit is contained in:
commit
859288f172
@ -254,6 +254,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
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()
|
||||
|
||||
|
@ -207,6 +207,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
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):
|
||||
|
@ -77,7 +77,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
||||
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)
|
||||
@ -804,6 +804,8 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
||||
|
||||
: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.
|
||||
|
@ -112,6 +112,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
|
||||
def on_focus(self):
|
||||
self.search_text_edit.setFocus()
|
||||
self.search_text_edit.selectAll()
|
||||
|
||||
def config_update(self):
|
||||
"""
|
||||
|
@ -142,3 +142,18 @@ class TestEditSongForm(TestCase, TestMixin):
|
||||
'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')
|
||||
|
Loading…
Reference in New Issue
Block a user