Skip to content

Commit

Permalink
Merge pull request #259 from tangkong/mnt_timeout_nav
Browse files Browse the repository at this point in the history
MNT: increase timeout limits (limits on all form spinboxes), prevent aggressive navigation
  • Loading branch information
tangkong authored Nov 6, 2024
2 parents 87cba02 + 8d4521d commit e09c76d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
9 changes: 9 additions & 0 deletions atef/widgets/config/data_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ def __init__(self, *args, data=SetValueStep, **kwargs):
self.checks_table.add_row(data=check)

self.checks_table.cellClicked.connect(self.update_all_desc)
self.checks_table.table_updated.connect(self.nav_to_self)

# checkboxes
self.bridge.halt_on_fail.changed_value.connect(
Expand Down Expand Up @@ -652,6 +653,14 @@ def update_all_desc(self, *args, **kwargs):
row_widget: CheckRowWidget = self.checks_table.cellWidget(ind, 0)
row_widget.update_summary()

def nav_to_self(self):
# A bit of a hack to prevent navigating to details prematurely
# normally an isinstance check would be good, but circular imports
try:
self.parent().parent().full_tree.select_by_data(self.data)
except AttributeError:
return


class TargetRowWidget(DesignerDisplay, SimpleRowWidget):
"""Base widget with target selection"""
Expand Down
2 changes: 2 additions & 0 deletions atef/widgets/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,13 +971,15 @@ def make_field(self, value: Any) -> QtWidgets.QWidget:
elif isinstance(value, int):
int_edit = QtWidgets.QSpinBox()
int_edit.setMinimum(-1)
int_edit.setMaximum(2147483648)
int_edit.setSpecialValueText('None')
int_edit.setToolTip('Input -1 to set value to None')
int_edit.setValue(value)
return int_edit
elif isinstance(value, float):
float_edit = QtWidgets.QDoubleSpinBox()
float_edit.setMinimum(-1)
float_edit.setMaximum(2147483648)
float_edit.setSpecialValueText('None')
float_edit.setToolTip('Input -1 to set value to None')
float_edit.setValue(value)
Expand Down
23 changes: 23 additions & 0 deletions docs/source/upcoming_release_notes/259-mnt_timeout_nav.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
259 mnt_timeout_nav
###################

API Breaks
----------
- N/A

Features
--------
- N/A

Bugfixes
--------
- N/A

Maintenance
-----------
- increase the limit on spinboxes generated from MultiInputFormDialog, in response to a request that set-value-step timeouts not be limited to 99
- navigate BACK to the parent page when creating a new check in SetValueStep, preventing extra navigation clicks

Contributors
------------
- tangkong

0 comments on commit e09c76d

Please sign in to comment.