V3 polish
This commit is contained in:
parent
2e090b192c
commit
6061b20398
@ -88,7 +88,7 @@ class MusicMusterSignals(QObject):
|
|||||||
search_songfacts_signal = pyqtSignal(str)
|
search_songfacts_signal = pyqtSignal(str)
|
||||||
search_wikipedia_signal = pyqtSignal(str)
|
search_wikipedia_signal = pyqtSignal(str)
|
||||||
show_warning_signal = pyqtSignal(str, str)
|
show_warning_signal = pyqtSignal(str, str)
|
||||||
span_cells_signal = pyqtSignal(int, int, int, int)
|
span_cells_signal = pyqtSignal(int, int, int, int, int)
|
||||||
status_message_signal = pyqtSignal(str, int)
|
status_message_signal = pyqtSignal(str, int)
|
||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
plr.note += "\n" + note
|
plr.note += "\n" + note
|
||||||
# Reset header row spanning
|
# Reset header row spanning
|
||||||
self.signals.span_cells_signal.emit(
|
self.signals.span_cells_signal.emit(
|
||||||
row_number, HEADER_NOTES_COLUMN, 1, 1
|
self.playlist_id, row_number, HEADER_NOTES_COLUMN, 1, 1
|
||||||
)
|
)
|
||||||
# Update local copy
|
# Update local copy
|
||||||
self.refresh_row(session, row_number)
|
self.refresh_row(session, row_number)
|
||||||
@ -366,7 +366,11 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
if self.is_header_row(row):
|
if self.is_header_row(row):
|
||||||
if column == HEADER_NOTES_COLUMN:
|
if column == HEADER_NOTES_COLUMN:
|
||||||
self.signals.span_cells_signal.emit(
|
self.signals.span_cells_signal.emit(
|
||||||
row, HEADER_NOTES_COLUMN, 1, self.columnCount() - 1
|
self.playlist_id,
|
||||||
|
row,
|
||||||
|
HEADER_NOTES_COLUMN,
|
||||||
|
1,
|
||||||
|
self.columnCount() - 1,
|
||||||
)
|
)
|
||||||
header_text = self.header_text(prd)
|
header_text = self.header_text(prd)
|
||||||
if not header_text:
|
if not header_text:
|
||||||
@ -796,7 +800,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
if self.is_header_row(moving_row):
|
if self.is_header_row(moving_row):
|
||||||
# Reset column span
|
# Reset column span
|
||||||
self.signals.span_cells_signal.emit(
|
self.signals.span_cells_signal.emit(
|
||||||
moving_row, HEADER_NOTES_COLUMN, 1, 1
|
self.playlist_id, moving_row, HEADER_NOTES_COLUMN, 1, 1
|
||||||
)
|
)
|
||||||
# Check to see whether any rows in track_sequence have moved
|
# Check to see whether any rows in track_sequence have moved
|
||||||
if track_sequence.previous.plr_rownum in row_map:
|
if track_sequence.previous.plr_rownum in row_map:
|
||||||
@ -961,8 +965,6 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
log.error(f"OBS SDK error ({e})")
|
log.error(f"OBS SDK error ({e})")
|
||||||
return
|
return
|
||||||
|
|
||||||
self.signals.resize_rows_signal.emit(self.playlist_id)
|
|
||||||
|
|
||||||
def open_in_audacity(self, row_number: int) -> None:
|
def open_in_audacity(self, row_number: int) -> None:
|
||||||
"""
|
"""
|
||||||
Open track at passed row number in Audacity
|
Open track at passed row number in Audacity
|
||||||
@ -1052,9 +1054,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
if now_plr:
|
if now_plr:
|
||||||
track_sequence.now.plr_rownum = now_plr.plr_rownum
|
track_sequence.now.plr_rownum = now_plr.plr_rownum
|
||||||
if track_sequence.previous.plr_rownum:
|
if track_sequence.previous.plr_rownum:
|
||||||
previous_plr = session.get(
|
previous_plr = session.get(PlaylistRows, track_sequence.previous.plr_id)
|
||||||
PlaylistRows, track_sequence.previous.plr_id
|
|
||||||
)
|
|
||||||
if previous_plr:
|
if previous_plr:
|
||||||
track_sequence.previous.plr_rownum = previous_plr.plr_rownum
|
track_sequence.previous.plr_rownum = previous_plr.plr_rownum
|
||||||
|
|
||||||
@ -1416,7 +1416,9 @@ class PlaylistProxyModel(QSortFilterProxyModel):
|
|||||||
# true next time through.
|
# true next time through.
|
||||||
QTimer.singleShot(
|
QTimer.singleShot(
|
||||||
Config.HIDE_AFTER_PLAYING_OFFSET + 100,
|
Config.HIDE_AFTER_PLAYING_OFFSET + 100,
|
||||||
lambda: self.data_model.invalidate_row(source_row),
|
lambda: self.data_model.invalidate_row(
|
||||||
|
source_row
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -247,6 +247,9 @@ class PlaylistTab(QTableView):
|
|||||||
# Deselect rows
|
# Deselect rows
|
||||||
self.clear_selection()
|
self.clear_selection()
|
||||||
|
|
||||||
|
# Resize rows
|
||||||
|
self.signals.resize_rows_signal.emit(self.playlist_id)
|
||||||
|
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
def edit(
|
def edit(
|
||||||
@ -679,11 +682,16 @@ class PlaylistTab(QTableView):
|
|||||||
self.data_model.set_next_row(model_row_number)
|
self.data_model.set_next_row(model_row_number)
|
||||||
self.clearSelection()
|
self.clearSelection()
|
||||||
|
|
||||||
def _span_cells(self, row: int, column: int, rowSpan: int, columnSpan: int) -> None:
|
def _span_cells(
|
||||||
|
self, playlist_id: int, row: int, column: int, rowSpan: int, columnSpan: int
|
||||||
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Implement spanning of cells, initiated by signal
|
Implement spanning of cells, initiated by signal
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if playlist_id != self.playlist_id:
|
||||||
|
return
|
||||||
|
|
||||||
model = self.proxy_model
|
model = self.proxy_model
|
||||||
if hasattr(model, "mapToSource"):
|
if hasattr(model, "mapToSource"):
|
||||||
edit_index = model.mapFromSource(self.data_model.createIndex(row, column))
|
edit_index = model.mapFromSource(self.data_model.createIndex(row, column))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user