diff --git a/beos/TRTransfer.cpp b/beos/TRTransfer.cpp index 9935fe45b..e1586c93e 100644 --- a/beos/TRTransfer.cpp +++ b/beos/TRTransfer.cpp @@ -89,7 +89,7 @@ bool TRTransfer::UpdateStatus(tr_stat_t *stat, bool shade) { bool TRTransfer::IsRunning() { return (fStatus != NULL && (fStatus->status & - (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED))); + (TR_STATUS_CHECK_WAIT | TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED))); } @@ -125,6 +125,9 @@ void TRTransfer::DrawItem(BView *owner, BRect frame, bool) { if (fStatus->status & TR_STATUS_PAUSE ) { sprintf(fTimeStr, "Paused (%.2f %%)", 100 * fStatus->progress); + } else if (fStatus->status & TR_STATUS_CHECK_WAIT ) { + sprintf(fTimeStr, "Waiting To Check Existing Files (%.2f %%)", + 100 * fStatus->progress); } else if (fStatus->status & TR_STATUS_CHECK ) { sprintf(fTimeStr, "Checking Existing Files (%.2f %%)", 100 * fStatus->progress); @@ -148,7 +151,7 @@ void TRTransfer::DrawItem(BView *owner, BRect frame, bool) { textLoc.x = frame.Width() - owner->StringWidth(fTimeStr) - 2; owner->DrawString(fTimeStr, textLoc); - if (fStatus->status & (TR_STATUS_DOWNLOAD | TR_STATUS_SEED | TR_STATUS_CHECK )) { + if (fStatus->status & (TR_STATUS_DOWNLOAD | TR_STATUS_SEED | TR_STATUS_CHECK | TR_STATUS_CHECK_WAIT )) { // Move to the left of the bottom line. textLoc.Set(frame.left + 2, frame.top + fBaselineOffset * 3 + (2 * fLineSpacing) + (fBaselineOffset / 2)); diff --git a/beos/TRWindow.cpp b/beos/TRWindow.cpp index 35f0be78b..79ccd086e 100644 --- a/beos/TRWindow.cpp +++ b/beos/TRWindow.cpp @@ -369,7 +369,7 @@ bool TRWindow::QuitRequested() { tr_stat_t *stat = tr_torrentStat(torrent); strItem << info->torrent << ".running"; - if (stat->status & (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED)) { + if (stat->status & (TR_STATUS_CHECK_WAIT | TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED)) { prefs->SetBool(strItem.String(), true); tr_torrentStop(torrent); } else { diff --git a/cli/transmissioncli.c b/cli/transmissioncli.c index 1982313b4..efd9a09a0 100644 --- a/cli/transmissioncli.c +++ b/cli/transmissioncli.c @@ -220,6 +220,11 @@ int main( int argc, char ** argv ) { break; } + else if( s->status & TR_STATUS_CHECK_WAIT ) + { + chars = snprintf( string, sizeof string, + "Waiting to check files... %.2f %%", 100.0 * s->progress ); + } else if( s->status & TR_STATUS_CHECK ) { chars = snprintf( string, sizeof string, diff --git a/gtk/tr_window.c b/gtk/tr_window.c index c62ddfe94..3d0567db6 100644 --- a/gtk/tr_window.c +++ b/gtk/tr_window.c @@ -507,7 +507,11 @@ formatname( GtkTreeViewColumn * col SHUTUP, GtkCellRenderer * rend, mb = readablesize(size); prog *= 100; - if( TR_STATUS_CHECK & status ) + if( TR_STATUS_CHECK_WAIT & status ) + { + top = g_strdup_printf( _("Waiting to check existing files (%.1f%%)"), prog ); + } + else if( TR_STATUS_CHECK & status ) { top = g_strdup_printf( _("Checking existing files (%.1f%%)"), prog ); } diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 37e002e63..6050cb1cf 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -325,8 +325,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 //check to stop for ratio float stopRatio; - if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID - && [self ratio] >= stopRatio) + if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID && [self ratio] >= stopRatio) { [self stopTransfer]; fStat = tr_torrentStat(fHandle); @@ -654,9 +653,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (float) progressStopRatio { float stopRatio, ratio; - if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) > stopRatio) + if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) >= stopRatio) return 1.0; - else if (stopRatio > 0 && ratio > 0) + else if (ratio > 0 && stopRatio > 0) return ratio / stopRatio; else return 0;