debug markers to investigate #137
This commit is contained in:
parent
4357e0e038
commit
bf67866f8a
@ -260,7 +260,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
def debug(self):
|
def debug(self):
|
||||||
"""Invoke debugger"""
|
"""Invoke debugger"""
|
||||||
|
|
||||||
import ipdb
|
import ipdb # type: ignore
|
||||||
ipdb.set_trace()
|
ipdb.set_trace()
|
||||||
|
|
||||||
def disable_play_next_controls(self) -> None:
|
def disable_play_next_controls(self) -> None:
|
||||||
|
|||||||
@ -415,7 +415,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
|
|
||||||
# Determin cell type changed
|
# Determin cell type changed
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
if self.edit_cell_type == "row_notes":
|
if self.edit_cell_type == ROW_NOTES:
|
||||||
# Get playlistrow object
|
# Get playlistrow object
|
||||||
plr_id = self._get_playlistrow_id(row)
|
plr_id = self._get_playlistrow_id(row)
|
||||||
plr_item = session.get(PlaylistRows, plr_id)
|
plr_item = session.get(PlaylistRows, plr_id)
|
||||||
@ -434,9 +434,10 @@ class PlaylistTab(QTableWidget):
|
|||||||
if track:
|
if track:
|
||||||
update_current = row == self._get_current_track_row()
|
update_current = row == self._get_current_track_row()
|
||||||
update_next = row == self._get_next_track_row()
|
update_next = row == self._get_next_track_row()
|
||||||
if self.edit_cell_type == "title":
|
if self.edit_cell_type == TITLE:
|
||||||
|
log.debug(f"KAE: _cell_changed:438, {new_text=}")
|
||||||
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:
|
if update_current:
|
||||||
self.musicmuster.update_current_track(track)
|
self.musicmuster.update_current_track(track)
|
||||||
@ -487,25 +488,21 @@ class PlaylistTab(QTableWidget):
|
|||||||
# If a track row, we only allow editing of title, artist and
|
# If a track row, we only allow editing of title, artist and
|
||||||
# note. Check that this column is one of those.
|
# note. Check that this column is one of those.
|
||||||
self.edit_cell_type = None
|
self.edit_cell_type = None
|
||||||
if column == TITLE:
|
if column in [TITLE, ARTIST, ROW_NOTES]:
|
||||||
self.edit_cell_type = "title"
|
self.edit_cell_type = column
|
||||||
elif column == ARTIST:
|
|
||||||
self.edit_cell_type = "artist"
|
|
||||||
elif column == ROW_NOTES:
|
|
||||||
self.edit_cell_type = "row_notes"
|
|
||||||
else:
|
else:
|
||||||
# Can't edit other columns
|
# Can't edit other columns
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check whether we're editing a notes row for later
|
# Check whether we're editing a notes row for later
|
||||||
if self.edit_cell_type == "row_notes":
|
if self.edit_cell_type == ROW_NOTES:
|
||||||
note_column = ROW_NOTES
|
note_column = ROW_NOTES
|
||||||
else:
|
else:
|
||||||
# This is a section header.
|
# This is a section header.
|
||||||
if column != HEADER_NOTES_COLUMN:
|
if column != HEADER_NOTES_COLUMN:
|
||||||
return False
|
return False
|
||||||
note_column = HEADER_NOTES_COLUMN
|
note_column = HEADER_NOTES_COLUMN
|
||||||
self.edit_cell_type = "row_notes"
|
self.edit_cell_type = ROW_NOTES
|
||||||
|
|
||||||
# Disable play controls so that keyboard input doesn't
|
# Disable play controls so that keyboard input doesn't
|
||||||
# disturb playing
|
# disturb playing
|
||||||
@ -615,6 +612,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
self.setItem(row, START_GAP, start_gap_item)
|
self.setItem(row, START_GAP, start_gap_item)
|
||||||
|
|
||||||
title_item = QTableWidgetItem(row_data.track.title)
|
title_item = QTableWidgetItem(row_data.track.title)
|
||||||
|
log.debug(f"KAE: insert_row:615, {title_item.text()=}")
|
||||||
self.setItem(row, TITLE, title_item)
|
self.setItem(row, TITLE, title_item)
|
||||||
|
|
||||||
artist_item = QTableWidgetItem(row_data.track.artist)
|
artist_item = QTableWidgetItem(row_data.track.artist)
|
||||||
@ -1957,6 +1955,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
item_startgap.setBackground(QColor("white"))
|
item_startgap.setBackground(QColor("white"))
|
||||||
|
|
||||||
item_title = self.item(row, TITLE)
|
item_title = self.item(row, TITLE)
|
||||||
|
log.debug(f"KAE: _update_row:1958, {track.title=}")
|
||||||
item_title.setText(track.title)
|
item_title.setText(track.title)
|
||||||
|
|
||||||
item_artist = self.item(row, ARTIST)
|
item_artist = self.item(row, ARTIST)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user