diff --git a/app/playlists.py b/app/playlists.py index a03f600..02d5514 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -91,19 +91,6 @@ class PlaylistTab(QTableWidget): # ########## Events ########## - def closeEvent(self, event): - "Save column widths" - - for column in range(self.columnCount()): - width = self.columnWidth(column) - name = f"playlist_col_{str(column)}_width" - with Session() as session: - record = Settings.get_int(session, name) - if record.f_int != self.columnWidth(column): - record.update(session, {'f_int': width}) - - event.accept() - def dropEvent(self, event: QDropEvent): if not event.isAccepted() and event.source() == self: drop_row = self._drop_on(event) @@ -170,6 +157,16 @@ class PlaylistTab(QTableWidget): # ########## Externally called functions ########## + def close(self, session): + "Save column widths" + + for column in range(self.columnCount()): + width = self.columnWidth(column) + name = f"playlist_col_{str(column)}_width" + record = Settings.get_int(session, name) + if record.f_int != self.columnWidth(column): + record.update(session, {'f_int': width}) + def insert_note(self, session, note, repaint=True): """ Add note to playlist