Skip to content

Commit

Permalink
reset structure
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Oct 7, 2023
1 parent e15086e commit e3afbdb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def _default_state(self):
return self.State.INIT

def reset(self):
"""Reset the widgets in all settings to their initial states."""
with self.hold_trait_notifications():
for _, settings in self.settings.items():
settings.reset()
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def _observe_process_selection(self, change):
if pk is None:
self._wizard_app_widget.reset()
self._wizard_app_widget.selected_index = 0
self.structure_step.reset()
self.configure_step.reset()
self.submit_step.reset()
else:
Expand Down
2 changes: 2 additions & 0 deletions src/aiidalab_qe/app/structure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,6 @@ def can_reset(self):
return self.confirmed_structure is not None

def reset(self): # unconfirm
"""Reset the widget to its initial state."""
self.confirmed_structure = None
self.manager.structure = None
3 changes: 3 additions & 0 deletions src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ def get_submission_parameters(self):
}

def reset(self):
"""Reset the widget to its initial state."""
with self.hold_trait_notifications():
self.process = None
self.input_structure = None
self.set_selected_codes(DEFAULT_PARAMETERS["codes"])
self.set_resource_defaults()

0 comments on commit e3afbdb

Please sign in to comment.