Save playlist column widths correctly
This commit is contained in:
parent
8838c23c59
commit
199dada246
@ -91,19 +91,6 @@ class PlaylistTab(QTableWidget):
|
|||||||
|
|
||||||
# ########## Events ##########
|
# ########## 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):
|
def dropEvent(self, event: QDropEvent):
|
||||||
if not event.isAccepted() and event.source() == self:
|
if not event.isAccepted() and event.source() == self:
|
||||||
drop_row = self._drop_on(event)
|
drop_row = self._drop_on(event)
|
||||||
@ -170,6 +157,16 @@ class PlaylistTab(QTableWidget):
|
|||||||
|
|
||||||
# ########## Externally called functions ##########
|
# ########## 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):
|
def insert_note(self, session, note, repaint=True):
|
||||||
"""
|
"""
|
||||||
Add note to playlist
|
Add note to playlist
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user