Skip to content

Commit

Permalink
Fixed problem with ResultText. When a new scenario was created, the p…
Browse files Browse the repository at this point in the history
…revious ResultTexts were still shown.
  • Loading branch information
WouterPeere committed Dec 9, 2022
1 parent b03b0bb commit d2c730d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions GHEtool/gui/gui_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,10 @@ def hide(self, **kwargs) -> None:
continue
self.options_hidden.append(option)
option.hide()
# when results is given as an argument, the current category is on the result page
# all ResultTexts should be out of the options_hidden list
if kwargs.get("results"):
self.options_hidden = [i for i in self.options_hidden if not isinstance(i, ResultText)]

def show(self, **kwargs) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion GHEtool/gui/gui_combine_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def add_scenario(self) -> None:
:return: None
"""
# get current number of scenario but at least 0
number: int = max(len(self.list_ds), 0)
number: int = len(self.list_ds)
# append new scenario to List of DataStorages
self.list_ds.append(DataStorage(self.gui_structure))
# add new scenario name and item to list widget
Expand Down

0 comments on commit d2c730d

Please sign in to comment.