Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: increase timeout limits (limits on all form spinboxes), prevent aggressive navigation #259

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Briefly scrutinizing this: why is the parent's parent always the instance that owns the full tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SetValueStep widget is inside a QWidget container, which is itself inside a StepPage(PageWidget) widget. only those PageWidget classes can see the full tree

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