From 18e1588d733255485fb13c8eb6e00f9cceee742d Mon Sep 17 00:00:00 2001 From: Carl Philipp Klemm Date: Sat, 7 Mar 2026 12:10:27 +0100 Subject: [PATCH] Add wating message when douleclicking item --- src/MainWindow.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 6888b41..9480bcf 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -296,16 +296,12 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index) if (!index.isValid()) return; - // Temporarily disconnect the signal to prevent multiple invocations - // This happens when the dialog closes and triggers another double-click event disconnect(ui->songListView, &QTableView::doubleClicked, this, &MainWindow::on_songListView_doubleClicked); int row = index.row(); - // Different behavior based on which column was clicked if (index.column() == 0) { - // Column 0 (play indicator): Stop current playback and play this song if (isPlaying) { audioPlayer->stop(); @@ -316,14 +312,13 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index) updateControls(); } - // Flush the generation queue when user selects a different song flushGenerationQueue(); + ui->nowPlayingLabel->setText("Now Playing: Waiting for generation..."); currentSong = songModel->getSong(row); ensureSongsInQueue(true); } else if (index.column() == 1 || index.column() == 2) { - // Column 1 (caption): Edit the song SongItem song = songModel->getSong(row); SongDialog dialog(this, song.caption, song.lyrics, song.vocalLanguage); @@ -334,14 +329,12 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index) QString lyrics = dialog.getLyrics(); QString vocalLanguage = dialog.getVocalLanguage(); - // Update the model - use column 1 for the song name songModel->setData(songModel->index(row, 1), caption, SongListModel::CaptionRole); songModel->setData(songModel->index(row, 1), lyrics, SongListModel::LyricsRole); songModel->setData(songModel->index(row, 1), vocalLanguage, SongListModel::VocalLanguageRole); } } - // Reconnect the signal after dialog is closed connect(ui->songListView, &QTableView::doubleClicked, this, &MainWindow::on_songListView_doubleClicked); }