Compare commits

..

No commits in common. "5d3d373abc68cba3999926f169355d43879346da" and "1da0668807808055282f75d9604c6f5a1d0c9d63" have entirely different histories.

2 changed files with 4 additions and 35 deletions

View File

@ -215,8 +215,10 @@ class Window(QMainWindow, Ui_MainWindow):
self.btnFade.clicked.connect(self.fade) self.btnFade.clicked.connect(self.fade)
self.btnHidePlayed.clicked.connect(self.hide_played) self.btnHidePlayed.clicked.connect(self.hide_played)
self.btnStop.clicked.connect(self.stop) self.btnStop.clicked.connect(self.stop)
self.hdrCurrentTrack.clicked.connect(self.show_current) self.hdrCurrentTrack.clicked.connect(
self.hdrNextTrack.clicked.connect(self.show_next) lambda: self.tabPlaylist.currentWidget().scroll_current_to_top())
self.hdrNextTrack.clicked.connect(
lambda: self.tabPlaylist.currentWidget().scroll_next_to_top())
self.tabPlaylist.currentChanged.connect( self.tabPlaylist.currentChanged.connect(
lambda: self.tabPlaylist.currentWidget().tab_visible()) lambda: self.tabPlaylist.currentWidget().tab_visible())
self.tabPlaylist.tabCloseRequested.connect(self.close_tab) self.tabPlaylist.tabCloseRequested.connect(self.close_tab)
@ -770,20 +772,6 @@ class Window(QMainWindow, Ui_MainWindow):
idx = self.tabPlaylist.indexOf(widget) idx = self.tabPlaylist.indexOf(widget)
self.tabPlaylist.tabBar().setTabTextColor(idx, colour) self.tabPlaylist.tabBar().setTabTextColor(idx, colour)
def show_current(self) -> None:
"""Scroll to show current track"""
if self.current_track_playlist_tab != self.visible_playlist_tab:
self.tabPlaylist.setCurrentWidget(self.current_track_playlist_tab)
self.tabPlaylist.currentWidget().scroll_current_to_top()
def show_next(self) -> None:
"""Scroll to show next track"""
if self.next_track_playlist_tab != self.visible_playlist_tab:
self.tabPlaylist.setCurrentWidget(self.next_track_playlist_tab)
self.tabPlaylist.currentWidget().scroll_next_to_top()
def stop(self) -> None: def stop(self) -> None:
"""Stop playing immediately""" """Stop playing immediately"""
@ -949,18 +937,6 @@ class Window(QMainWindow, Ui_MainWindow):
if self.playing: if self.playing:
self.stop_playing() self.stop_playing()
def update_current_track(self, track):
"""Update current track with passed details"""
self.current_track = TrackData(track)
self.update_headers()
def update_next_track(self, track):
"""Update next track with passed details"""
self.next_track = TrackData(track)
self.update_headers()
def update_headers(self) -> None: def update_headers(self) -> None:
""" """
Update last / current / next track headers Update last / current / next track headers

View File

@ -432,17 +432,10 @@ class PlaylistTab(QTableWidget):
if track_id: if track_id:
track = session.get(Tracks, track_id) track = session.get(Tracks, track_id)
if track: if track:
update_current = row == self._get_current_track_row()
update_next = row == self._get_next_track_row()
if self.edit_cell_type == "title": if self.edit_cell_type == "title":
track.title = new_text track.title = new_text
elif self.edit_cell_type == "artist": elif self.edit_cell_type == "artist":
track.artist = new_text track.artist = new_text
if update_current:
self.musicmuster.update_current_track(track)
elif update_next:
self.musicmuster.update_next_track(track)
# Headers will be incorrect if the edited track is # Headers will be incorrect if the edited track is
# previous / current / next TODO: this will require # previous / current / next TODO: this will require
# the stored data in musicmuster to be updated, # the stored data in musicmuster to be updated,