1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

update files to recognize the new "waiting to check" state

This commit is contained in:
Mitchell Livingston 2007-05-28 18:37:47 +00:00
parent 4c1151556d
commit de37792d9a
5 changed files with 19 additions and 8 deletions

View file

@ -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));

View file

@ -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 {

View file

@ -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,

View file

@ -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 );
}

View file

@ -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;