Skip to content

Commit

Permalink
added result automatically added to summary
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanbasten-ns committed Sep 11, 2024
1 parent 143cb63 commit 1c7c022
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tool_flow_summary/flow_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def add_summary_grid(self, item: ThreeDiGridItem) -> None:
for result in results:
self.add_summary_result(result)

def add_summary_result(self, item: ThreeDiResultItem) -> None:
def add_summary_result(self, item: ThreeDiResultItem, show: bool = True) -> None:

if item.id in self.result_ids:
logger.warning("Result already added to flow summary, ignoring...")
Expand Down Expand Up @@ -136,7 +136,8 @@ def add_summary_result(self, item: ThreeDiResultItem) -> None:
self.tables[group_name].add_summary_results(item.text(), group_data)

self._reset_column_widths()
self.main_widget.show()
if show:
self.main_widget.show()

def remove_summary_grid(self, item: ThreeDiGridItem) -> None:
results = []
Expand Down Expand Up @@ -189,8 +190,9 @@ def result_changed(self, result_item: ThreeDiResultItem):
self.tables[table].change_result(idx+1, result_item.text())

@pyqtSlot(ThreeDiResultItem)
def result_added(self, _: ThreeDiResultItem):
def result_added(self, item: ThreeDiResultItem):
self.action_icon.setEnabled(self.model.number_of_results() > 0)
self.add_summary_result(item, False)

def run(self) -> None:
self.main_widget.show()

0 comments on commit 1c7c022

Please sign in to comment.