Changeset 7454
- Timestamp:
- Dec 21, 2008, 8:02:21 PM (12 years ago)
- Location:
- trunk/wx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wx/filter.cc
r7404 r7454 28 28 const tr_stat * s = tr_torrentStat( (tr_torrent*)tor ); 29 29 30 switch( s-> status)30 switch( s->activity ) 31 31 { 32 32 case TR_STATUS_DOWNLOAD: … … 44 44 } 45 45 46 flags |= ( ( s-> rateUpload + s->rateDownload ) > 0.01 )46 flags |= ( ( s->pieceUploadSpeed + s->pieceDownloadSpeed ) > 0.01 ) 47 47 ? FLAG_ACTIVE 48 48 : FLAG_IDLE; -
trunk/wx/speed-stats.cc
r7404 r7454 214 214 { 215 215 // add a new record 216 float allUp, allDown;217 tr_sessionGetSpeed( handle, &allDown, &allUp);216 const double allUp = tr_sessionGetPieceSpeed( handle, TR_UP ); 217 const double allDown = tr_sessionGetPieceSpeed( handle, TR_DOWN ); 218 218 Speed s; 219 219 s.time = time( NULL ); … … 222 222 if( myTorrent ) { 223 223 const tr_stat * stat = tr_torrentStat( myTorrent ); 224 s.torrentUp = stat-> rateUpload;225 s.torrentDown = stat-> rateDownload;224 s.torrentUp = stat->pieceUploadSpeed; 225 s.torrentDown = stat->pieceDownloadSpeed; 226 226 } 227 227 myStats.push_back( s ); -
trunk/wx/torrent-list.cc
r7404 r7454 249 249 250 250 case COL_DOWNLOAD_SPEED: 251 if( s-> rateDownload > 0.01 )252 xstr = getReadableSpeed( s-> rateDownload );251 if( s->pieceDownloadSpeed > 0.01 ) 252 xstr = getReadableSpeed( s->pieceDownloadSpeed ); 253 253 else 254 254 xstr.Clear( ); … … 305 305 case COL_STATE: /* FIXME: divine the meaning of these two columns */ 306 306 case COL_STATUS: 307 switch( s-> status) {307 switch( s->activity ) { 308 308 case TR_STATUS_STOPPED: xstr = _("Stopped"); break; 309 309 case TR_STATUS_CHECK: xstr = wxString::Format ( _("Checking Files (%.0f)"), s->recheckProgress ); break; … … 320 320 321 321 case COL_UPLOAD_SPEED: 322 if( s-> rateUpload > 0.01 )323 xstr = getReadableSpeed( s-> rateUpload );322 if( s->pieceUploadSpeed > 0.01 ) 323 xstr = getReadableSpeed( s->pieceUploadSpeed ); 324 324 else 325 325 xstr.Clear( ); … … 421 421 422 422 case COL_DOWNLOAD_SPEED: 423 if( sa-> rateDownload < sb->rateDownload )423 if( sa->pieceDownloadSpeed < sb->pieceDownloadSpeed ) 424 424 ret = -1; 425 else if( sa-> rateDownload > sb->rateDownload )425 else if( sa->pieceDownloadSpeed > sb->pieceDownloadSpeed ) 426 426 ret = 1; 427 427 else … … 499 499 case COL_STATE: /* FIXME */ 500 500 case COL_STATUS: 501 ret = sa-> status - sb->status;501 ret = sa->activity - sb->activity; 502 502 break; 503 503 … … 507 507 508 508 case COL_UPLOAD_SPEED: 509 if( sa-> rateUpload < sb->rateUpload )509 if( sa->pieceUploadSpeed < sb->pieceUploadSpeed ) 510 510 ret = -1; 511 else if( sa-> rateUpload > sb->rateUpload )511 else if( sa->pieceUploadSpeed > sb->pieceUploadSpeed ) 512 512 ret = 1; 513 513 else -
trunk/wx/xmission.cc
r7404 r7454 286 286 bool enable = false; 287 287 foreach( torrents_v, mySelectedTorrents, it ) 288 if( tr_torrentStatCached(*it)-> status== TR_STATUS_STOPPED )288 if( tr_torrentStatCached(*it)->activity == TR_STATUS_STOPPED ) 289 289 enable = true; 290 290 event.Enable( enable ); … … 294 294 { 295 295 foreach( torrents_v, mySelectedTorrents, it ) 296 if( tr_torrentStatCached(*it)-> status== TR_STATUS_STOPPED )296 if( tr_torrentStatCached(*it)->activity == TR_STATUS_STOPPED ) 297 297 tr_torrentStart( *it ); 298 298 } … … 306 306 bool enable = false; 307 307 foreach( torrents_v, mySelectedTorrents, it ) 308 if( tr_torrentStatCached(*it)-> status!= TR_STATUS_STOPPED )308 if( tr_torrentStatCached(*it)->activity != TR_STATUS_STOPPED ) 309 309 enable = true; 310 310 event.Enable( enable ); … … 314 314 { 315 315 foreach( torrents_v, mySelectedTorrents, it ) 316 if( tr_torrentStat(*it)-> status!= TR_STATUS_STOPPED )316 if( tr_torrentStat(*it)->activity != TR_STATUS_STOPPED ) 317 317 tr_torrentStop( *it ); 318 318 } … … 474 474 mySpeedStats->Pulse( handle ); 475 475 476 float down, up;477 tr_sessionGetSpeed( handle, &down, &up);476 const double up = tr_sessionGetPieceSpeed( handle, TR_UP ); 477 const double down = tr_sessionGetPieceSpeed( handle, TR_DOWN ); 478 478 wxString xstr = _("Total DL: "); 479 479 xstr += getReadableSpeed( down ); … … 520 520 long port; 521 521 wxString key = _T("port"); 522 if( !myConfig->Read( key, &port, TR_DEFAULT_PORT) )522 if( !myConfig->Read( key, &port, atoi( TR_DEFAULT_PEER_PORT_STR ) ) ) 523 523 myConfig->Write( key, port ); 524 524 tr_sessionSetPeerPort( handle, port );
Note: See TracChangeset
for help on using the changeset viewer.