1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-02 20:43:51 +00:00

(trunk wx) get the wx client mostly building again.

This commit is contained in:
Charles Kerr 2008-12-21 20:02:21 +00:00
parent 32ebb868e7
commit 32a9006121
4 changed files with 23 additions and 23 deletions

View file

@ -27,7 +27,7 @@ TorrentFilter :: GetFlags( const tr_torrent * tor )
int flags = 0;
const tr_stat * s = tr_torrentStat( (tr_torrent*)tor );
switch( s->status )
switch( s->activity )
{
case TR_STATUS_DOWNLOAD:
flags |= FLAG_LEECHING;
@ -43,7 +43,7 @@ TorrentFilter :: GetFlags( const tr_torrent * tor )
break;
}
flags |= ( ( s->rateUpload + s->rateDownload ) > 0.01 )
flags |= ( ( s->pieceUploadSpeed + s->pieceDownloadSpeed ) > 0.01 )
? FLAG_ACTIVE
: FLAG_IDLE;

View file

@ -213,16 +213,16 @@ void
SpeedStats :: Pulse( tr_handle * handle )
{
// add a new record
float allUp, allDown;
tr_sessionGetSpeed( handle, &allDown, &allUp );
const double allUp = tr_sessionGetPieceSpeed( handle, TR_UP );
const double allDown = tr_sessionGetPieceSpeed( handle, TR_DOWN );
Speed s;
s.time = time( NULL );
s.allUp = allUp;
s.allDown = allDown;
if( myTorrent ) {
const tr_stat * stat = tr_torrentStat( myTorrent );
s.torrentUp = stat->rateUpload;
s.torrentDown = stat->rateDownload;
s.torrentUp = stat->pieceUploadSpeed;
s.torrentDown = stat->pieceDownloadSpeed;
}
myStats.push_back( s );

View file

@ -248,8 +248,8 @@ TorrentListCtrl :: RefreshTorrent( tr_torrent * tor,
break;
case COL_DOWNLOAD_SPEED:
if( s->rateDownload > 0.01 )
xstr = getReadableSpeed( s->rateDownload );
if( s->pieceDownloadSpeed > 0.01 )
xstr = getReadableSpeed( s->pieceDownloadSpeed );
else
xstr.Clear( );
break;
@ -304,7 +304,7 @@ TorrentListCtrl :: RefreshTorrent( tr_torrent * tor,
case COL_STATE: /* FIXME: divine the meaning of these two columns */
case COL_STATUS:
switch( s->status ) {
switch( s->activity ) {
case TR_STATUS_STOPPED: xstr = _("Stopped"); break;
case TR_STATUS_CHECK: xstr = wxString::Format ( _("Checking Files (%.0f)"), s->recheckProgress ); break;
case TR_STATUS_CHECK_WAIT: xstr = _("Waiting to Check"); break;
@ -319,8 +319,8 @@ TorrentListCtrl :: RefreshTorrent( tr_torrent * tor,
break;
case COL_UPLOAD_SPEED:
if( s->rateUpload > 0.01 )
xstr = getReadableSpeed( s->rateUpload );
if( s->pieceUploadSpeed > 0.01 )
xstr = getReadableSpeed( s->pieceUploadSpeed );
else
xstr.Clear( );
break;
@ -420,9 +420,9 @@ TorrentListCtrl :: Compare( long item1, long item2, long sortData )
break;
case COL_DOWNLOAD_SPEED:
if( sa->rateDownload < sb->rateDownload )
if( sa->pieceDownloadSpeed < sb->pieceDownloadSpeed )
ret = -1;
else if( sa->rateDownload > sb->rateDownload )
else if( sa->pieceDownloadSpeed > sb->pieceDownloadSpeed )
ret = 1;
else
ret = 0;
@ -498,7 +498,7 @@ TorrentListCtrl :: Compare( long item1, long item2, long sortData )
case COL_STATE: /* FIXME */
case COL_STATUS:
ret = sa->status - sb->status;
ret = sa->activity - sb->activity;
break;
case COL_TOTAL:
@ -506,9 +506,9 @@ TorrentListCtrl :: Compare( long item1, long item2, long sortData )
break;
case COL_UPLOAD_SPEED:
if( sa->rateUpload < sb->rateUpload )
if( sa->pieceUploadSpeed < sb->pieceUploadSpeed )
ret = -1;
else if( sa->rateUpload > sb->rateUpload )
else if( sa->pieceUploadSpeed > sb->pieceUploadSpeed )
ret = 1;
else
ret = 0;

View file

@ -285,7 +285,7 @@ MyFrame :: OnStartUpdate( wxUpdateUIEvent& event )
{
bool enable = false;
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
if( tr_torrentStatCached(*it)->activity == TR_STATUS_STOPPED )
enable = true;
event.Enable( enable );
}
@ -293,7 +293,7 @@ void
MyFrame :: OnStart( wxCommandEvent& WXUNUSED(unused) )
{
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
if( tr_torrentStatCached(*it)->activity == TR_STATUS_STOPPED )
tr_torrentStart( *it );
}
@ -305,7 +305,7 @@ MyFrame :: OnStopUpdate( wxUpdateUIEvent& event )
{
bool enable = false;
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStatCached(*it)->status != TR_STATUS_STOPPED )
if( tr_torrentStatCached(*it)->activity != TR_STATUS_STOPPED )
enable = true;
event.Enable( enable );
}
@ -313,7 +313,7 @@ void
MyFrame :: OnStop( wxCommandEvent& WXUNUSED(unused) )
{
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStat(*it)->status != TR_STATUS_STOPPED )
if( tr_torrentStat(*it)->activity != TR_STATUS_STOPPED )
tr_torrentStop( *it );
}
@ -473,8 +473,8 @@ MyFrame :: OnPulse(wxTimerEvent& WXUNUSED(event) )
mySpeedStats->Pulse( handle );
float down, up;
tr_sessionGetSpeed( handle, &down, &up );
const double up = tr_sessionGetPieceSpeed( handle, TR_UP );
const double down = tr_sessionGetPieceSpeed( handle, TR_DOWN );
wxString xstr = _("Total DL: ");
xstr += getReadableSpeed( down );
SetStatusText( xstr, 1 );
@ -519,7 +519,7 @@ MyFrame :: MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size
long port;
wxString key = _T("port");
if( !myConfig->Read( key, &port, TR_DEFAULT_PORT ) )
if( !myConfig->Read( key, &port, atoi( TR_DEFAULT_PEER_PORT_STR ) ) )
myConfig->Write( key, port );
tr_sessionSetPeerPort( handle, port );