Skip to content

Commit

Permalink
fixup! Add support for deleting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Jan 29, 2024
1 parent f3585d3 commit 82a5e55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion damnit/gui/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(self) -> None:

self._columns_widget.setContextMenuPolicy(Qt.CustomContextMenu)
self._columns_widget.customContextMenuRequested.connect(self.show_delete_menu)
delete_action = QtWidgets.QAction("Delete")

self._static_columns_widget.itemChanged.connect(self.item_changed)
self._static_columns_widget.setStyleSheet("QListWidget {padding: 0px;} QListWidget::item { margin: 5px; }")
Expand Down Expand Up @@ -142,6 +141,12 @@ def confirm_delete_variable(self, name):
if button == QMessageBox.Yes:
main_window = self.model()._main_window
delete_variable(main_window.db, name)

# TODO: refactor this into simply removing the column from the table
# if we fix the bugs around adding/removing columns
# on-the-fly. Currently there are some lingering off-by-one errors
# or something that cause the wrong columns to be moved when moving
# a column after the number of columns has changed.
main_window.autoconfigure(main_window.context_dir)

def add_new_columns(self, columns, statuses, positions = None):
Expand Down

0 comments on commit 82a5e55

Please sign in to comment.