From: APTX Date: Tue, 1 Jun 2010 11:36:37 +0000 (+0200) Subject: Report hashing progress. Do not allow to mark a file more than once. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=46a847a1264011dd7c77fba1c1ee536fb664b591;p=aniplayer-old.git Report hashing progress. Do not allow to mark a file more than once. --- diff --git a/src/videowindow.cpp b/src/videowindow.cpp index 9e0ff5f..8c5d7a7 100644 --- a/src/videowindow.cpp +++ b/src/videowindow.cpp @@ -427,7 +427,6 @@ void VideoWindow::tick(qint64 time) return; markWatched(); - m_marked = true; #endif } @@ -540,12 +539,15 @@ void VideoWindow::markWatched() AniDBUdpClient::File *file = new AniDBUdpClient::File(videoPlayer->currentFile()); file->markWatched(); - connect(file, SIGNAL(statusUpdate(AniDBUdpClient::File::Action,AniDBUdpClient::File::ActionState)), this, SLOT(markingStatus(AniDBUdpClient::File::Action,AniDBUdpClient::File::ActionState))); + connect(file, SIGNAL(statusUpdate(AniDBUdpClient::File::Action,AniDBUdpClient::File::ActionState,int)), this, SLOT(markingStatus(AniDBUdpClient::File::Action,AniDBUdpClient::File::ActionState,int))); connect(file, SIGNAL(finished()), file, SLOT(deleteLater())); + + m_marked = true; } -void VideoWindow::markingStatus(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState) +void VideoWindow::markingStatus(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState, int percent) { + qDebug() << "markingStatus called"; AniDBUdpClient::File *file = (AniDBUdpClient::File *) sender(); switch (action) { @@ -553,7 +555,10 @@ void VideoWindow::markingStatus(AniDBUdpClient::File::Action action, AniDBUdpCli switch (actionState) { case AniDBUdpClient::File::InProgress: - menu->showMessage(tr("Hashing File")); + menu->showMessage(tr("Hashing File... %1%").arg(percent)); + break; + case AniDBUdpClient::File::Success: + menu->showMessage(tr("Hashing File complete!").arg(percent)); break; default: ; } diff --git a/src/videowindow.h b/src/videowindow.h index 4a494a8..be9623e 100644 --- a/src/videowindow.h +++ b/src/videowindow.h @@ -99,7 +99,7 @@ private slots: #ifndef NO_ANIDBUDPCLIENT void markWatched(); - void markingStatus(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState); + void markingStatus(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState, int percent); void anidbSettings(); void updateAutomarkable();