This commit is contained in:
billypom on debian 2024-09-16 22:16:04 -04:00
parent b61a18ee03
commit f5db5cf89d
3 changed files with 20 additions and 13 deletions

20
main.py
View File

@ -235,22 +235,26 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
self.albumGraphicsView.albumArtDropped.connect(
self.set_album_art_for_selected_songs
)
self.albumGraphicsView.albumArtDeleted.connect(
self.delete_album_art_for_selected_songs
)
# multithreading
# whatever
# FIXME: this should delete the album art for the current song - not all selected songs
# move functionality to remove album for selected songs to the batch metadata editor
# self.albumGraphicsView.albumArtDeleted.connect(
# self.delete_album_art_for_selected_songs
# )
self.tableView.viewport().installEventFilter(
self
) # for drag & drop functionality
self.tableView.handleProgressSignal.connect(self.handle_progress)
# set column widths
# FIXME: last column needs to not leave the screen when other columns become big...
# howwww
table_view_column_widths = str(self.config["table"]["column_widths"]).split(",")
for i in range(self.tableView.model.columnCount()):
for i in range(self.tableView.model.columnCount() - 1):
self.tableView.setColumnWidth(i, int(table_view_column_widths[i]))
# dont extend last column past table view border
# self.tableView.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
# self.tableView.horizontalHeader().setStretchLastSection(False)
self.tableView.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
self.tableView.horizontalHeader().setStretchLastSection(True)
def reload_config(self) -> None:
"""does what it says"""

2
ui.py
View File

@ -106,6 +106,7 @@ class Ui_MainWindow(object):
self.playlistTreeView.setObjectName("playlistTreeView")
self.hLayoutMusicTable.addWidget(self.playlistTreeView)
self.tableView = MusicTable(self.centralwidget)
self.tableView.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.tableView.setAcceptDrops(True)
self.tableView.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.tableView.setEditTriggers(QtWidgets.QAbstractItemView.AnyKeyPressed|QtWidgets.QAbstractItemView.EditKeyPressed)
@ -114,7 +115,6 @@ class Ui_MainWindow(object):
self.tableView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.tableView.setSortingEnabled(True)
self.tableView.setObjectName("tableView")
self.tableView.horizontalHeader().setStretchLastSection(True)
self.tableView.verticalHeader().setVisible(False)
self.hLayoutMusicTable.addWidget(self.tableView)
self.hLayoutMusicTable.setStretch(0, 2)

9
ui.ui
View File

@ -177,6 +177,12 @@
</item>
<item>
<widget class="MusicTable" name="tableView">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
@ -198,9 +204,6 @@
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>