WIP V3: preview button works
This commit is contained in:
parent
2861511f1f
commit
93c5475a29
@ -448,6 +448,13 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
|
|
||||||
return QVariant(boldfont)
|
return QVariant(boldfont)
|
||||||
|
|
||||||
|
def get_row_track_path(self, row_number: int) -> str:
|
||||||
|
"""
|
||||||
|
Return path of track associated with row or empty string if no track associated
|
||||||
|
"""
|
||||||
|
|
||||||
|
return self.playlist_rows[row_number].path
|
||||||
|
|
||||||
def get_rows_duration(self, row_numbers: List[int]) -> int:
|
def get_rows_duration(self, row_numbers: List[int]) -> int:
|
||||||
"""
|
"""
|
||||||
Return the total duration of the passed rows
|
Return the total duration of the passed rows
|
||||||
|
|||||||
@ -284,6 +284,20 @@ class PlaylistTab(QTableView):
|
|||||||
return index.row()
|
return index.row()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def get_selected_row_track_path(self) -> str:
|
||||||
|
"""
|
||||||
|
Return the path of the selected row. If no row selected or selected
|
||||||
|
row does not have a track, return empty string.
|
||||||
|
"""
|
||||||
|
|
||||||
|
sm = self.selectionModel()
|
||||||
|
if sm and sm.hasSelection():
|
||||||
|
index = sm.currentIndex()
|
||||||
|
if index.isValid():
|
||||||
|
model = cast(PlaylistModel, self.model())
|
||||||
|
return model.get_row_track_path(index.row())
|
||||||
|
return ""
|
||||||
|
|
||||||
# def lookup_row_in_songfacts(self) -> None:
|
# def lookup_row_in_songfacts(self) -> None:
|
||||||
# """
|
# """
|
||||||
# If there is a selected row and it is a track row,
|
# If there is a selected row and it is a track row,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user