From acd91262917929e703c9bf8d4efd54285e2d8b54 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sat, 17 Feb 2024 05:58:31 +0000 Subject: [PATCH] Disable list picker button after adding a new item --- .../widgets/abstract_model_component_list_picker_widget.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pywr_editor/form/widgets/abstract_model_component_list_picker_widget.py b/pywr_editor/form/widgets/abstract_model_component_list_picker_widget.py index dcfcb38b..91ce8869 100644 --- a/pywr_editor/form/widgets/abstract_model_component_list_picker_widget.py +++ b/pywr_editor/form/widgets/abstract_model_component_list_picker_widget.py @@ -361,6 +361,11 @@ def on_form_save( # noinspection PyUnresolvedReferences self.model.layoutChanged.emit() + # disable buttons on change + self.move_up.setEnabled(False) + self.move_down.setEnabled(False) + self.delete_button.setEnabled(False) + def sanitise_value( self, value: list[int | float | str | dict] ) -> [list[dict | str], str | None]: