Skip to content

Commit f2eb3fa

Browse files
ui: fixed selecting rows when in detail view
When the user double clicked on a rule to view the details, we were not using the correct column to track selections.
1 parent 6f09709 commit f2eb3fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/opensnitch/dialogs/stats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,9 @@ def _cb_table_double_clicked(self, row):
20272027
self._set_active_widgets(cur_idx, True, rule_name)
20282028
r_name, node = self._set_rules_tab_active(row, cur_idx, self.COL_R_NAME, self.COL_R_NODE)
20292029
self.LAST_SELECTED_ITEM = row.model().index(row.row(), self.COL_R_NAME).data()
2030+
# Use COL_TIME as index when in detail view. Otherwise COL_R_NAME
2031+
# (col number 2) will be used, leading to incorrect selections.
2032+
self.TABLES[cur_idx]['view'].setTrackingColumn(self.COL_TIME)
20302033
self._set_rules_query(r_name, node)
20312034
self._restore_details_view_columns(
20322035
self.TABLES[cur_idx]['view'].horizontalHeader(),
@@ -2582,6 +2585,7 @@ def _restore_rules_tab_widgets(self, active):
25822585
self.editRuleButton.setVisible(not active)
25832586
self.nodeRuleLabel.setText("")
25842587
self.rulesTreePanel.setVisible(active)
2588+
self.TABLES[self.TAB_RULES]['view'].setTrackingColumn(self.COL_R_NAME)
25852589

25862590
if not active:
25872591
return

0 commit comments

Comments
 (0)