rename GUI Save button as Confirm
more idiomatic this way, since it's really just "set the value", not actually saving the config Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
parent
03a8235445
commit
df875a5d99
|
@ -60,7 +60,7 @@ class EditScreen(ModalScreen):
|
|||
Label(self.field_descriptor.full_name, id="field-name"),
|
||||
self.input_field,
|
||||
Pretty('', id='input-errors', classes='hidden'),
|
||||
Button("Save", id='save-button'),
|
||||
Button("Confirm", id='confirm-button'),
|
||||
Button("Cancel", id='cancel-button'),
|
||||
id='edit-dialog',
|
||||
)
|
||||
|
@ -70,7 +70,7 @@ class EditScreen(ModalScreen):
|
|||
"""Update the UI to show why validation failed."""
|
||||
if event.validation_result:
|
||||
error_field = self.query_one(Pretty)
|
||||
save_button = self.query_one('#save-button', Button)
|
||||
save_button = self.query_one('#confirm-button', Button)
|
||||
if not event.validation_result.is_valid:
|
||||
error_field.update(event.validation_result.failure_descriptions)
|
||||
error_field.classes = ''
|
||||
|
@ -82,7 +82,7 @@ class EditScreen(ModalScreen):
|
|||
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
"""Process the button actions."""
|
||||
if event.button.id == 'save-button':
|
||||
if event.button.id == 'confirm-button':
|
||||
logger.debug("calling _save")
|
||||
self._save()
|
||||
self.app.pop_screen()
|
||||
|
|
|
@ -121,7 +121,7 @@ async def test_simple_edit_via_input_field():
|
|||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
||||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.click('Button#save-button')
|
||||
await pilot.click('Button#confirm-button')
|
||||
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 5
|
||||
|
||||
|
||||
|
@ -145,7 +145,7 @@ async def test_simple_edit_via_input_field_enum():
|
|||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.press('down', 'down', 'enter')
|
||||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.click('Button#save-button')
|
||||
await pilot.click('Button#confirm-button')
|
||||
assert pilot.app.config.gamepadOptions.dpadMode == 1
|
||||
|
||||
|
||||
|
@ -166,7 +166,7 @@ async def test_simple_edit_via_input_field_string():
|
|||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.press('backspace', '-', 'h', 'i')
|
||||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.click('Button#save-button')
|
||||
await pilot.click('Button#confirm-button')
|
||||
assert pilot.app.config.boardVersion == 'v0.7.-hi'
|
||||
|
||||
|
||||
|
@ -196,7 +196,7 @@ async def test_add_node_to_repeated():
|
|||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
||||
await pilot.wait_for_scheduled_animations()
|
||||
await pilot.click('Button#save-button')
|
||||
await pilot.click('Button#confirm-button')
|
||||
|
||||
assert pilot.app.config.profileOptions.deprecatedAlternativePinMappings[0].pinButtonB4 == 5
|
||||
|
||||
|
|
Loading…
Reference in New Issue