Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #680 from ess-dmsc/679_edit_component_on_transform…
Browse files Browse the repository at this point in the history
…ation

679 - Disabling edit component button when transformation is selected
  • Loading branch information
matthew-d-jones authored Mar 13, 2020
2 parents 2d4dac0 + a6c5768 commit cca2343
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nexus_constructor/treeview_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def set_button_states(
)
else:
selected_object = selection_indices[0].internalPointer()

zoom_action.setEnabled(isinstance(selected_object, Component))
selected_object_is_component = isinstance(selected_object, Component)
zoom_action.setEnabled(selected_object_is_component)

selected_object_is_component_or_transform = isinstance(
selected_object, (Component, Transformation)
)
duplicate_action.setEnabled(selected_object_is_component_or_transform)
edit_component_action.setEnabled(selected_object_is_component_or_transform)
edit_component_action.setEnabled(selected_object_is_component)

selected_object_is_not_link_transform = not isinstance(
selected_object, LinkTransformation
Expand Down
1 change: 0 additions & 1 deletion tests/ui_tests/test_main_window_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ def test_GIVEN_transformation_is_selected_WHEN_changing_button_states_THEN_expec
transformation_selected_actions = {
delete_action,
duplicate_action,
edit_component_action,
new_rotation_action,
new_translation_action,
create_link_action,
Expand Down

0 comments on commit cca2343

Please sign in to comment.