From 2b4323eca801638f0a305ff29afe815a45e103b1 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 4 Jan 2022 17:55:00 +0100 Subject: Added current value to notification system, fixed Qt hack --- solo_tool_qt.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'solo_tool_qt.py') diff --git a/solo_tool_qt.py b/solo_tool_qt.py index a6823e0..25a15fb 100644 --- a/solo_tool_qt.py +++ b/solo_tool_qt.py @@ -41,7 +41,7 @@ class ABListModel(QAbstractListModel): return len(self.soloTool.getStoredAbLimits()) class MainWindow(QMainWindow, Ui_MainWindow): - songChangeSignal = pyqtSignal() + songChangeSignal = pyqtSignal(int) def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) @@ -170,14 +170,12 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.abListModel.layoutChanged.emit() self.clearListViewSelection(self.abListView) - def currentSongChanged(self): + def currentSongChanged(self, songIndex): if self.songChangePending == CHANGE_GUI: self.songChangePending = None else: assert self.songChangePending is None self.songChangePending = CHANGE_INTERNAL - # TODO fix this hack - songIndex = self.soloTool._playlist.getCurrentSongIndex() print(f"Forcing selection to {songIndex}") i = self.playlistModel.createIndex(songIndex, 0) self.songListView.selectionModel().select(i, QItemSelectionModel.ClearAndSelect) -- cgit v1.2.3