get the wx client compiling again, at least.

This commit is contained in:
Charles Kerr 2008-01-05 08:05:17 +00:00
parent cf4566eccb
commit 0a66cb5103
4 changed files with 31 additions and 24 deletions

View File

@ -7,14 +7,15 @@ SUBDIRS = images
bin_PROGRAMS = Xmission
Xmission_SOURCES = \
speed-stats.cc \
filter.cc \
torrent-list.cc \
torrent-stats.cc \
xmission.cc
speed-stats.cc \
filter.cc \
torrent-list.cc \
torrent-stats.cc \
xmission.cc
Xmission_LDADD = \
$(top_builddir)/libtransmission/libtransmission.a \
$(top_builddir)/third-party/libevent/libevent.la \
$(top_builddir)/third-party/miniupnp/libminiupnp.a \
$(WX_LIBS) $(OPENSSL_LIBS) $(PTHREAD_LIBS) -lm
$(top_builddir)/libtransmission/libtransmission.a \
$(top_builddir)/third-party/libevent/libevent.la \
$(top_builddir)/third-party/miniupnp/libminiupnp.a \
$(top_builddir)/third-party/libnatpmp/libnatpmp.a \
$(WX_LIBS) $(OPENSSL_LIBS) $(PTHREAD_LIBS) -lm

View File

@ -38,7 +38,6 @@ TorrentFilter :: GetFlags( const tr_torrent * tor )
flags |= FLAG_SEEDING;
break;
case TR_STATUS_STOPPING:
case TR_STATUS_STOPPED:
case TR_STATUS_CHECK:
case TR_STATUS_CHECK_WAIT:

View File

@ -303,7 +303,6 @@ TorrentListCtrl :: RefreshTorrent( tr_torrent * tor,
case COL_STATE: /* FIXME: divine the meaning of these two columns */
case COL_STATUS:
switch( s->status ) {
case TR_STATUS_STOPPING: xstr = _("Stopping"); break;
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;

View File

@ -282,16 +282,17 @@ MyFrame :: OnDeselectAllUpdate( wxUpdateUIEvent& event )
void
MyFrame :: OnStartUpdate( wxUpdateUIEvent& event )
{
unsigned long l = 0;
bool enable = false;
foreach( torrents_v, mySelectedTorrents, it )
l |= tr_torrentStat(*it)->status;
event.Enable( (l & TR_STATUS_INACTIVE)!=0 );
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
enable = true;
event.Enable( enable );
}
void
MyFrame :: OnStart( wxCommandEvent& WXUNUSED(unused) )
{
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStat(*it)->status & TR_STATUS_INACTIVE )
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
tr_torrentStart( *it );
}
@ -301,16 +302,17 @@ MyFrame :: OnStart( wxCommandEvent& WXUNUSED(unused) )
void
MyFrame :: OnStopUpdate( wxUpdateUIEvent& event )
{
unsigned long l = 0;
bool enable = false;
foreach( torrents_v, mySelectedTorrents, it )
l |= tr_torrentStat(*it)->status;
event.Enable( (l & TR_STATUS_ACTIVE)!=0 );
if( tr_torrentStatCached(*it)->status != TR_STATUS_STOPPED )
enable = true;
event.Enable( enable );
}
void
MyFrame :: OnStop( wxCommandEvent& WXUNUSED(unused) )
{
foreach( torrents_v, mySelectedTorrents, it )
if( tr_torrentStat(*it)->status & TR_STATUS_ACTIVE )
if( tr_torrentStat(*it)->status != TR_STATUS_STOPPED )
tr_torrentStop( *it );
}
@ -368,10 +370,12 @@ void MyFrame :: OnOpen( wxCommandEvent& WXUNUSED(event) )
for( size_t i=0; i<nPaths; ++i )
{
const std::string filename = toStr( paths[i] );
tr_torrent * tor = tr_torrentInit( handle,
filename.c_str(),
mySavePath.c_str(),
false, NULL );
tr_ctor * ctor = tr_ctorNew( handle );
tr_ctorSetMetainfoFromFile( ctor, filename.c_str() );
tr_ctorSetDestination( ctor, TR_FALLBACK, mySavePath.c_str() );
tr_torrent * tor = tr_torrentNew( handle, ctor, NULL );
tr_ctorFree( ctor );
if( tor )
myTorrents.push_back( tor );
}
@ -674,9 +678,13 @@ MyFrame :: MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size
**/
int count = 0;
tr_torrent ** torrents = tr_loadTorrents ( handle, mySavePath.c_str(), paused, &count );
tr_ctor * ctor = tr_ctorNew( handle );
tr_ctorSetPaused( ctor, TR_FORCE, paused );
tr_ctorSetDestination( ctor, TR_FALLBACK, mySavePath.c_str() );
tr_torrent ** torrents = tr_loadTorrents ( handle, ctor, &count );
myTorrents.insert( myTorrents.end(), torrents, torrents+count );
tr_free( torrents );
tr_ctorFree( ctor );
wxTimerEvent dummy;
OnPulse( dummy );