Compare commits

..

No commits in common. "c9c47c3133a11c6693655b402601c154d18f07df" and "b30f2d5cc3b772ebb0eb7ed3d04a79db7b57a94a" have entirely different histories.

2 changed files with 21 additions and 22 deletions

View File

@ -1210,6 +1210,14 @@ class Window(QMainWindow, Ui_MainWindow):
# If there's currently a track playing, fade it.
self.stop_playing(fade=True)
# Ensure playlist tabs are the correct colour
# If next track is on a different playlist_tab to the
# current track, reset the current track playlist_tab colour
current_tab = self.current_track.playlist_tab
if current_tab and current_tab != self.next_track.playlist_tab:
self.set_tab_colour(current_tab,
QColor(Config.COLOUR_NORMAL_TAB))
# Move next track to current track.
# stop_playing() above has called end_of_track_actions()
# which will have populated self.previous_track
@ -1224,7 +1232,6 @@ class Window(QMainWindow, Ui_MainWindow):
return
# Set current track playlist_tab colour
current_tab = self.current_track.playlist_tab
if current_tab:
self.set_tab_colour(
current_tab, QColor(Config.COLOUR_CURRENT_TAB))
@ -1250,6 +1257,17 @@ class Window(QMainWindow, Ui_MainWindow):
# Disable play next controls
self.disable_play_next_controls()
# If previous track playlist is showing and that's not the
# current track playlist, we need to reset the current track
# highlighting
if (
self.previous_track.playlist_tab == self.visible_playlist_tab()
and
self.current_track.playlist_tab != self.visible_playlist_tab()
and self.previous_track.plr_id
):
self.previous_track.playlist_tab.clear_next()
# Update headers
self.update_headers()

View File

@ -357,11 +357,6 @@ class PlaylistTab(QTableWidget):
if update_next or update_current:
self.musicmuster.update_headers()
if update_current:
self._set_row_colour_current(row)
elif update_next:
self._set_row_colour_next(row)
self.clear_selection()
def closeEditor(self,
@ -601,20 +596,14 @@ class PlaylistTab(QTableWidget):
def play_ended(self) -> None:
"""
Called by musicmuster when play has ended.
current_track points to track that's just finished
Called by musicmuster when play has ended
"""
row_number = self._get_current_track_row_number()
if row_number is None:
if not row_number:
return
self._set_row_colour_default(row_number)
self.clear_selection()
self._set_row_last_played_time(
row_number, self.musicmuster.current_track.start_time)
with Session() as session:
self._set_row_note_colour(session, row_number)
@ -704,14 +693,6 @@ class PlaylistTab(QTableWidget):
# Queue up time calculations to take place after UI has
# updated
self._update_start_end_times(session)
# It's possible that the current/next tracks are in this
# playlist, so check and set.
current_row = self._get_current_track_row_number()
if current_row is not None:
self._set_row_colour_current(current_row)
next_row = self._get_next_track_row_number()
if next_row is not None:
self._set_row_colour_next(next_row)
# Needed to wrap notes column correctly - add to event queue so
# that it's processed after list is populated
QTimer.singleShot(0, self.tab_visible)