2007-07-19 20:35:01 +00:00
|
|
|
/*
|
2007-08-14 13:53:03 +00:00
|
|
|
* Xmission - a cross-platform bittorrent client
|
|
|
|
* Copyright (C) 2007 Charles Kerr <charles@rebelbase.com>
|
2007-07-19 20:35:01 +00:00
|
|
|
*
|
2007-08-14 13:53:03 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2007-08-18 17:19:49 +00:00
|
|
|
*
|
|
|
|
* $Id$
|
2007-07-19 20:35:01 +00:00
|
|
|
*/
|
|
|
|
|
2007-08-23 16:38:58 +00:00
|
|
|
#include <ctype.h>
|
2007-08-04 01:34:00 +00:00
|
|
|
#include <inttypes.h>
|
2007-07-19 20:35:01 +00:00
|
|
|
#include <set>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2007-07-19 14:06:50 +00:00
|
|
|
#include <iostream>
|
2007-07-27 23:09:09 +00:00
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
#include <wx/artprov.h>
|
2007-07-23 17:36:34 +00:00
|
|
|
#include <wx/bitmap.h>
|
2007-07-27 23:09:09 +00:00
|
|
|
#include <wx/cmdline.h>
|
2007-07-19 14:06:50 +00:00
|
|
|
#include <wx/config.h>
|
2007-07-27 23:09:09 +00:00
|
|
|
#include <wx/dcmemory.h>
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/filename.h>
|
2007-07-23 17:36:34 +00:00
|
|
|
#include <wx/image.h>
|
2007-07-23 21:01:26 +00:00
|
|
|
#include <wx/intl.h>
|
2007-07-23 02:43:25 +00:00
|
|
|
#include <wx/listctrl.h>
|
2007-07-23 17:36:34 +00:00
|
|
|
#include <wx/notebook.h>
|
2007-07-27 23:09:09 +00:00
|
|
|
#include <wx/snglinst.h>
|
2007-07-23 17:36:34 +00:00
|
|
|
#include <wx/splitter.h>
|
2007-08-03 20:46:02 +00:00
|
|
|
#include <wx/statline.h>
|
2007-07-23 05:43:16 +00:00
|
|
|
#include <wx/taskbar.h>
|
2007-08-03 05:11:03 +00:00
|
|
|
#include <wx/tglbtn.h>
|
2007-07-19 14:06:50 +00:00
|
|
|
#include <wx/toolbar.h>
|
|
|
|
#include <wx/wx.h>
|
2007-07-20 02:12:07 +00:00
|
|
|
#if wxCHECK_VERSION(2,8,0)
|
|
|
|
#include <wx/aboutdlg.h>
|
|
|
|
#endif
|
2007-07-23 17:12:38 +00:00
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
2007-07-19 14:06:50 +00:00
|
|
|
#include <libtransmission/transmission.h>
|
2007-07-22 02:24:13 +00:00
|
|
|
#include <libtransmission/utils.h>
|
2007-07-23 17:12:38 +00:00
|
|
|
|
2007-08-03 18:52:01 +00:00
|
|
|
#include <images/play.xpm>
|
2007-07-23 17:12:38 +00:00
|
|
|
#include <images/stop.xpm>
|
2007-08-03 18:52:01 +00:00
|
|
|
#include <images/plus.xpm>
|
|
|
|
#include <images/minus.xpm>
|
|
|
|
|
2007-07-24 20:12:56 +00:00
|
|
|
#include <images/systray.xpm>
|
2007-07-23 17:12:38 +00:00
|
|
|
#include <images/transmission.xpm>
|
2007-07-19 14:06:50 +00:00
|
|
|
}
|
2007-07-23 17:12:38 +00:00
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
#include "foreach.h"
|
|
|
|
#include "speed-stats.h"
|
2007-08-23 19:02:33 +00:00
|
|
|
#include "filter.h"
|
2007-07-23 15:20:47 +00:00
|
|
|
#include "torrent-list.h"
|
2007-07-27 23:09:09 +00:00
|
|
|
#include "torrent-stats.h"
|
2007-07-19 14:06:50 +00:00
|
|
|
|
2007-07-25 05:37:12 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
int bestDecimal( double num ) {
|
|
|
|
if ( num < 10 ) return 2;
|
|
|
|
if ( num < 100 ) return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString toWxStr( const char * s )
|
|
|
|
{
|
|
|
|
return wxString( s, wxConvUTF8 );
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string toStr( const wxString& xstr )
|
|
|
|
{
|
|
|
|
return std::string( xstr.mb_str( *wxConvCurrent ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString getReadableSize( uint64_t size )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
static const char *sizestrs[] = { "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" };
|
|
|
|
for ( i=0; size>>10; ++i ) size = size>>10;
|
|
|
|
char buf[512];
|
|
|
|
snprintf( buf, sizeof(buf), "%.*f %s", bestDecimal(size), (double)size, sizestrs[i] );
|
|
|
|
return toWxStr( buf );
|
|
|
|
}
|
|
|
|
|
|
|
|
wxString getReadableSize( float f )
|
|
|
|
{
|
|
|
|
return getReadableSize( (uint64_t)f );
|
|
|
|
}
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
wxString getReadableSpeed( float kib_sec )
|
2007-07-25 05:37:12 +00:00
|
|
|
{
|
2007-07-27 23:09:09 +00:00
|
|
|
wxString xstr = getReadableSize(1024*kib_sec);
|
2007-07-25 05:37:12 +00:00
|
|
|
xstr += _T("/s");
|
|
|
|
return xstr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
const wxCmdLineEntryDesc cmdLineDesc[] =
|
|
|
|
{
|
|
|
|
{ wxCMD_LINE_SWITCH, _T("p"), _("pause"), _("pauses all the torrents on startup"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
|
|
|
|
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_STRING, 0 }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2007-07-25 05:37:12 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
class MyApp : public wxApp
|
|
|
|
{
|
|
|
|
virtual bool OnInit();
|
2007-07-27 23:09:09 +00:00
|
|
|
virtual ~MyApp();
|
|
|
|
wxSingleInstanceChecker * myChecker;
|
2007-07-19 14:06:50 +00:00
|
|
|
};
|
|
|
|
|
2007-07-23 15:20:47 +00:00
|
|
|
namespace
|
|
|
|
{
|
2007-09-20 19:47:19 +00:00
|
|
|
tr_handle * handle = NULL;
|
2007-07-23 15:20:47 +00:00
|
|
|
|
2007-09-20 19:47:19 +00:00
|
|
|
typedef std::vector<tr_torrent*> torrents_v;
|
2007-07-23 15:20:47 +00:00
|
|
|
}
|
2007-07-19 14:06:50 +00:00
|
|
|
|
2007-07-24 04:36:36 +00:00
|
|
|
class MyFrame : public wxFrame, public TorrentListCtrl::Listener
|
2007-07-19 14:06:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-07-27 23:09:09 +00:00
|
|
|
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, bool paused);
|
2007-07-19 14:06:50 +00:00
|
|
|
virtual ~MyFrame();
|
2007-07-23 21:01:26 +00:00
|
|
|
|
|
|
|
public:
|
2007-07-24 20:12:56 +00:00
|
|
|
void OnExit( wxCommandEvent& );
|
2007-07-23 15:20:47 +00:00
|
|
|
void OnAbout( wxCommandEvent& );
|
|
|
|
void OnOpen( wxCommandEvent& );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
void OnStart( wxCommandEvent& );
|
2007-07-26 01:25:36 +00:00
|
|
|
void OnStartUpdate( wxUpdateUIEvent& );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
void OnStop( wxCommandEvent& );
|
2007-07-26 01:25:36 +00:00
|
|
|
void OnStopUpdate( wxUpdateUIEvent& );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
void OnRemove( wxCommandEvent& );
|
2007-07-26 01:25:36 +00:00
|
|
|
void OnRemoveUpdate( wxUpdateUIEvent& );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
void OnRecheck( wxCommandEvent& );
|
|
|
|
void OnRecheckUpdate( wxUpdateUIEvent& );
|
|
|
|
|
|
|
|
void OnSelectAll( wxCommandEvent& );
|
|
|
|
void OnSelectAllUpdate( wxUpdateUIEvent& );
|
|
|
|
void OnDeselectAll( wxCommandEvent& );
|
|
|
|
void OnDeselectAllUpdate( wxUpdateUIEvent& );
|
|
|
|
|
2007-08-23 19:02:33 +00:00
|
|
|
void OnFilterChanged( wxCommandEvent& );
|
2007-08-03 05:11:03 +00:00
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
void OnPulse( wxTimerEvent& );
|
|
|
|
|
2007-09-20 19:47:19 +00:00
|
|
|
virtual void OnTorrentListSelectionChanged( TorrentListCtrl*, const std::set<tr_torrent*>& );
|
2007-07-19 14:06:50 +00:00
|
|
|
|
2007-07-23 21:01:26 +00:00
|
|
|
private:
|
|
|
|
void RefreshFilterCounts( );
|
2007-07-25 05:37:12 +00:00
|
|
|
void ApplyCurrentFilter( );
|
2007-07-23 21:01:26 +00:00
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
protected:
|
|
|
|
wxConfig * myConfig;
|
2007-07-22 19:37:43 +00:00
|
|
|
wxTimer myPulseTimer;
|
2007-07-19 20:35:01 +00:00
|
|
|
|
|
|
|
private:
|
2007-07-23 15:20:47 +00:00
|
|
|
TorrentListCtrl * myTorrentList;
|
2007-07-27 23:09:09 +00:00
|
|
|
TorrentStats * myTorrentStats;
|
2007-07-23 21:01:26 +00:00
|
|
|
wxListCtrl * myFilters;
|
2007-07-28 00:41:35 +00:00
|
|
|
wxTaskBarIcon * myTrayIcon;
|
2007-07-24 20:12:56 +00:00
|
|
|
wxIcon myLogoIcon;
|
|
|
|
wxIcon myTrayIconIcon;
|
2007-07-27 23:09:09 +00:00
|
|
|
SpeedStats * mySpeedStats;
|
2007-07-23 21:01:26 +00:00
|
|
|
torrents_v myTorrents;
|
2007-07-24 04:36:36 +00:00
|
|
|
torrents_v mySelectedTorrents;
|
2007-08-23 19:02:33 +00:00
|
|
|
int myFilter;
|
2007-07-27 23:09:09 +00:00
|
|
|
std::string mySavePath;
|
|
|
|
time_t myExitTime;
|
2007-08-23 19:02:33 +00:00
|
|
|
wxToggleButton* myFilterButtons[TorrentFilter::N_FILTERS];
|
2007-07-23 23:59:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-07-19 14:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ID_START,
|
2007-07-27 23:09:09 +00:00
|
|
|
ID_DESELECTALL,
|
2007-07-19 14:06:50 +00:00
|
|
|
ID_EDIT_PREFS,
|
|
|
|
ID_SHOW_DEBUG_WINDOW,
|
2007-07-22 19:37:43 +00:00
|
|
|
ID_Pulse,
|
2007-07-26 01:25:36 +00:00
|
|
|
ID_Filter
|
2007-07-19 14:06:50 +00:00
|
|
|
};
|
|
|
|
|
2007-07-23 23:59:13 +00:00
|
|
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
2007-08-23 19:02:33 +00:00
|
|
|
EVT_COMMAND_RANGE( ID_Filter, ID_Filter+TorrentFilter::N_FILTERS, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, MyFrame::OnFilterChanged )
|
2007-07-27 23:09:09 +00:00
|
|
|
EVT_MENU ( wxID_ABOUT, MyFrame::OnAbout )
|
|
|
|
EVT_TIMER ( ID_Pulse, MyFrame::OnPulse )
|
|
|
|
EVT_MENU ( wxID_EXIT, MyFrame::OnExit )
|
|
|
|
EVT_MENU ( wxID_OPEN, MyFrame::OnOpen )
|
|
|
|
EVT_MENU ( ID_START, MyFrame::OnStart )
|
2007-07-26 01:25:36 +00:00
|
|
|
EVT_UPDATE_UI( ID_START, MyFrame::OnStartUpdate )
|
2007-07-27 23:09:09 +00:00
|
|
|
EVT_MENU ( wxID_STOP, MyFrame::OnStop )
|
2007-07-26 01:25:36 +00:00
|
|
|
EVT_UPDATE_UI( wxID_STOP, MyFrame::OnStopUpdate )
|
2007-07-27 23:09:09 +00:00
|
|
|
EVT_MENU ( wxID_REFRESH, MyFrame::OnRecheck )
|
|
|
|
EVT_UPDATE_UI( wxID_REFRESH, MyFrame::OnRecheckUpdate )
|
|
|
|
EVT_MENU ( wxID_REMOVE, MyFrame::OnRemove )
|
2007-07-26 01:25:36 +00:00
|
|
|
EVT_UPDATE_UI( wxID_REMOVE, MyFrame::OnRemoveUpdate )
|
2007-07-27 23:09:09 +00:00
|
|
|
EVT_MENU ( wxID_SELECTALL, MyFrame::OnSelectAll )
|
|
|
|
EVT_UPDATE_UI( wxID_SELECTALL, MyFrame::OnSelectAllUpdate )
|
|
|
|
EVT_MENU ( ID_DESELECTALL, MyFrame::OnDeselectAll )
|
|
|
|
EVT_UPDATE_UI( ID_DESELECTALL, MyFrame::OnDeselectAllUpdate )
|
2007-07-23 23:59:13 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
IMPLEMENT_APP(MyApp)
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
|
2007-08-03 05:11:03 +00:00
|
|
|
void
|
2007-08-23 19:02:33 +00:00
|
|
|
MyFrame :: OnFilterChanged( wxCommandEvent& e )
|
2007-08-03 05:11:03 +00:00
|
|
|
{
|
2007-08-23 19:02:33 +00:00
|
|
|
static bool ignore = false;
|
|
|
|
|
|
|
|
if( !ignore )
|
|
|
|
{
|
|
|
|
myFilter = e.GetId() - ID_Filter;
|
|
|
|
std::cerr << " OnFilterChanged, myFilter is now " << myFilter << std::endl;
|
|
|
|
ApplyCurrentFilter ( );
|
|
|
|
|
|
|
|
ignore = true;
|
|
|
|
for( int i=0; i<TorrentFilter::N_FILTERS; ++i )
|
|
|
|
myFilterButtons[i]->SetValue( i==myFilter );
|
|
|
|
ignore = false;
|
|
|
|
}
|
2007-08-03 05:11:03 +00:00
|
|
|
}
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnSelectAll( wxCommandEvent& )
|
|
|
|
{
|
|
|
|
myTorrentList->SelectAll( );
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnSelectAllUpdate( wxUpdateUIEvent& event )
|
|
|
|
{
|
|
|
|
event.Enable( mySelectedTorrents.size() < myTorrents.size() );
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnDeselectAll( wxCommandEvent& )
|
|
|
|
{
|
|
|
|
myTorrentList->DeselectAll ( );
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnDeselectAllUpdate( wxUpdateUIEvent& event )
|
|
|
|
{
|
|
|
|
event.Enable( !mySelectedTorrents.empty() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
**/
|
|
|
|
|
2007-07-26 01:25:36 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnStartUpdate( wxUpdateUIEvent& event )
|
|
|
|
{
|
2008-01-05 08:05:17 +00:00
|
|
|
bool enable = false;
|
2007-07-27 23:09:09 +00:00
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
2008-01-05 08:05:17 +00:00
|
|
|
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
|
|
|
|
enable = true;
|
|
|
|
event.Enable( enable );
|
2007-07-26 01:25:36 +00:00
|
|
|
}
|
2007-07-27 23:09:09 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnStart( wxCommandEvent& WXUNUSED(unused) )
|
|
|
|
{
|
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
2008-01-05 08:05:17 +00:00
|
|
|
if( tr_torrentStatCached(*it)->status == TR_STATUS_STOPPED )
|
2007-07-27 23:09:09 +00:00
|
|
|
tr_torrentStart( *it );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
**/
|
2007-07-26 01:25:36 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnStopUpdate( wxUpdateUIEvent& event )
|
|
|
|
{
|
2008-01-05 08:05:17 +00:00
|
|
|
bool enable = false;
|
2007-07-27 23:09:09 +00:00
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
2008-01-05 08:05:17 +00:00
|
|
|
if( tr_torrentStatCached(*it)->status != TR_STATUS_STOPPED )
|
|
|
|
enable = true;
|
|
|
|
event.Enable( enable );
|
2007-07-26 01:25:36 +00:00
|
|
|
}
|
2007-07-27 23:09:09 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnStop( wxCommandEvent& WXUNUSED(unused) )
|
|
|
|
{
|
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
2008-01-05 08:05:17 +00:00
|
|
|
if( tr_torrentStat(*it)->status != TR_STATUS_STOPPED )
|
2007-07-27 23:09:09 +00:00
|
|
|
tr_torrentStop( *it );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
**/
|
2007-07-26 01:25:36 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnRemoveUpdate( wxUpdateUIEvent& event )
|
|
|
|
{
|
2007-07-27 23:09:09 +00:00
|
|
|
event.Enable( !mySelectedTorrents.empty() );
|
2007-07-26 01:25:36 +00:00
|
|
|
}
|
|
|
|
void
|
2007-07-27 23:09:09 +00:00
|
|
|
MyFrame :: OnRemove( wxCommandEvent& WXUNUSED(unused) )
|
|
|
|
{
|
2008-05-21 17:14:58 +00:00
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
|
|
|
tr_torrentRemove( *it );
|
2007-07-27 23:09:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
**/
|
|
|
|
|
|
|
|
void
|
|
|
|
MyFrame :: OnRecheckUpdate( wxUpdateUIEvent& event )
|
2007-07-26 01:25:36 +00:00
|
|
|
{
|
|
|
|
event.Enable( !mySelectedTorrents.empty() );
|
|
|
|
}
|
2007-07-27 23:09:09 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnRecheck( wxCommandEvent& WXUNUSED(unused) )
|
|
|
|
{
|
|
|
|
foreach( torrents_v, mySelectedTorrents, it )
|
|
|
|
tr_torrentRecheck( *it );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
**/
|
|
|
|
|
2007-07-26 17:15:56 +00:00
|
|
|
void MyFrame :: OnOpen( wxCommandEvent& WXUNUSED(event) )
|
2007-07-19 14:06:50 +00:00
|
|
|
{
|
2007-07-23 15:33:04 +00:00
|
|
|
const wxString key = _T("prev-directory");
|
2007-07-19 14:06:50 +00:00
|
|
|
wxString directory;
|
|
|
|
myConfig->Read( key, &directory );
|
|
|
|
wxFileDialog * w = new wxFileDialog( this, _T("message"),
|
|
|
|
directory,
|
|
|
|
_T(""), /* default file */
|
|
|
|
_T("Torrent files|*.torrent"),
|
|
|
|
wxOPEN|wxMULTIPLE );
|
|
|
|
|
|
|
|
if( w->ShowModal() == wxID_OK )
|
|
|
|
{
|
|
|
|
wxArrayString paths;
|
|
|
|
w->GetPaths( paths );
|
|
|
|
size_t nPaths = paths.GetCount();
|
|
|
|
for( size_t i=0; i<nPaths; ++i )
|
|
|
|
{
|
2007-07-25 05:37:12 +00:00
|
|
|
const std::string filename = toStr( paths[i] );
|
2008-01-05 08:05:17 +00:00
|
|
|
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 );
|
|
|
|
|
2007-07-25 05:37:12 +00:00
|
|
|
if( tor )
|
|
|
|
myTorrents.push_back( tor );
|
2007-07-19 14:06:50 +00:00
|
|
|
}
|
2007-07-25 05:37:12 +00:00
|
|
|
ApplyCurrentFilter( );
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
myConfig->Write( key, w->GetDirectory() );
|
|
|
|
}
|
|
|
|
|
|
|
|
delete w;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-05 18:17:23 +00:00
|
|
|
bool
|
|
|
|
MyApp :: OnInit( )
|
2007-07-19 14:06:50 +00:00
|
|
|
{
|
2008-05-18 16:44:30 +00:00
|
|
|
handle = tr_sessionInit( "wx" );
|
2007-07-19 14:06:50 +00:00
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
wxCmdLineParser cmdParser( cmdLineDesc, argc, argv );
|
|
|
|
if( cmdParser.Parse ( ) )
|
|
|
|
return false;
|
|
|
|
|
2007-07-28 00:27:30 +00:00
|
|
|
const wxString name = wxString::Format( _T("Xmission-%s"), wxGetUserId().c_str());
|
2007-07-27 23:09:09 +00:00
|
|
|
myChecker = new wxSingleInstanceChecker( name );
|
|
|
|
if ( myChecker->IsAnotherRunning() ) {
|
2007-07-28 00:27:30 +00:00
|
|
|
wxLogError(_("An instance of Xmission is already running."));
|
2007-07-27 23:09:09 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const bool paused = cmdParser.Found( _("p") );
|
|
|
|
|
2007-07-28 00:27:30 +00:00
|
|
|
MyFrame * frame = new MyFrame( _("Xmission"),
|
2007-07-19 14:06:50 +00:00
|
|
|
wxPoint(50,50),
|
2007-07-27 23:09:09 +00:00
|
|
|
wxSize(900,600),
|
|
|
|
paused);
|
2007-07-19 14:06:50 +00:00
|
|
|
|
|
|
|
frame->Show( true );
|
|
|
|
SetTopWindow( frame );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
MyApp :: ~MyApp()
|
|
|
|
{
|
|
|
|
delete myChecker;
|
|
|
|
}
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
/***
|
|
|
|
****
|
|
|
|
***/
|
|
|
|
|
2007-07-23 21:01:26 +00:00
|
|
|
void
|
|
|
|
MyFrame :: RefreshFilterCounts( )
|
|
|
|
{
|
2007-08-03 05:11:03 +00:00
|
|
|
int hits[ TorrentFilter :: N_FILTERS ];
|
|
|
|
TorrentFilter::CountHits( myTorrents, hits );
|
2007-07-23 21:01:26 +00:00
|
|
|
for( int i=0; i<TorrentFilter::N_FILTERS; ++i )
|
2007-08-23 19:02:33 +00:00
|
|
|
myFilterButtons[i]->SetLabel( TorrentFilter::GetName( i, hits[i] ) );
|
2007-07-23 21:01:26 +00:00
|
|
|
}
|
|
|
|
|
2007-07-23 23:59:13 +00:00
|
|
|
void
|
2007-07-25 05:37:12 +00:00
|
|
|
MyFrame :: ApplyCurrentFilter( )
|
2007-07-23 23:59:13 +00:00
|
|
|
{
|
|
|
|
torrents_v tmp( myTorrents );
|
2007-08-23 19:02:33 +00:00
|
|
|
TorrentFilter :: RemoveFailures( myFilter, tmp );
|
2007-07-23 23:59:13 +00:00
|
|
|
myTorrentList->Assign( tmp );
|
|
|
|
}
|
|
|
|
|
2007-07-24 04:36:36 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnTorrentListSelectionChanged( TorrentListCtrl* list,
|
2007-09-20 19:47:19 +00:00
|
|
|
const std::set<tr_torrent*>& torrents )
|
2007-07-24 04:36:36 +00:00
|
|
|
{
|
|
|
|
assert( list == myTorrentList );
|
|
|
|
mySelectedTorrents.assign( torrents.begin(), torrents.end() );
|
2007-08-22 19:49:24 +00:00
|
|
|
|
2007-09-20 19:47:19 +00:00
|
|
|
tr_torrent * tor = mySelectedTorrents.empty() ? NULL : mySelectedTorrents.front();
|
2007-08-22 19:49:24 +00:00
|
|
|
mySpeedStats->SetTorrent( tor );
|
2007-07-24 04:36:36 +00:00
|
|
|
}
|
|
|
|
|
2007-07-22 19:37:43 +00:00
|
|
|
void
|
2007-07-27 23:09:09 +00:00
|
|
|
MyFrame :: OnPulse(wxTimerEvent& WXUNUSED(event) )
|
2007-07-22 19:37:43 +00:00
|
|
|
{
|
2007-07-27 23:09:09 +00:00
|
|
|
if( myExitTime ) {
|
2008-05-22 20:44:41 +00:00
|
|
|
if ( !tr_sessionCountTorrents(handle) || myExitTime<time(0) ) {
|
2007-07-28 00:41:35 +00:00
|
|
|
delete myTrayIcon;
|
|
|
|
myTrayIcon = 0;
|
2007-07-27 23:09:09 +00:00
|
|
|
Destroy( );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-23 21:01:26 +00:00
|
|
|
RefreshFilterCounts( );
|
2007-08-03 20:46:02 +00:00
|
|
|
ApplyCurrentFilter( );
|
2007-07-23 21:01:26 +00:00
|
|
|
|
2007-08-22 19:49:24 +00:00
|
|
|
mySpeedStats->Pulse( handle );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
float down, up;
|
|
|
|
tr_torrentRates( handle, &down, &up );
|
|
|
|
wxString xstr = _("Total DL: ");
|
|
|
|
xstr += getReadableSpeed( down );
|
|
|
|
SetStatusText( xstr, 1 );
|
|
|
|
xstr = _("Total UL: ");
|
|
|
|
xstr += getReadableSpeed( up );
|
|
|
|
SetStatusText( xstr, 2 );
|
2007-07-23 05:43:16 +00:00
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
xstr = _("Download: ");
|
|
|
|
xstr += getReadableSpeed( down );
|
|
|
|
xstr += _T("\n");
|
|
|
|
xstr +=_("Upload: ");
|
|
|
|
xstr += getReadableSpeed( up );
|
2007-07-28 00:41:35 +00:00
|
|
|
myTrayIcon->SetIcon( myTrayIconIcon, xstr );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
myTorrentList->Refresh ( );
|
2007-07-22 19:37:43 +00:00
|
|
|
}
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
MyFrame::~MyFrame()
|
|
|
|
{
|
2007-07-24 04:36:36 +00:00
|
|
|
myTorrentList->RemoveListener( this );
|
|
|
|
delete myTorrentList;
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
delete myConfig;
|
|
|
|
}
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
MyFrame :: MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, bool paused):
|
2007-07-19 14:06:50 +00:00
|
|
|
wxFrame((wxFrame*)NULL,-1,title,pos,size),
|
2007-07-22 19:37:43 +00:00
|
|
|
myConfig( new wxConfig( _T("xmission") ) ),
|
2007-07-24 20:12:56 +00:00
|
|
|
myPulseTimer( this, ID_Pulse ),
|
|
|
|
myLogoIcon( transmission_xpm ),
|
2007-07-25 05:37:12 +00:00
|
|
|
myTrayIconIcon( systray_xpm ),
|
2007-08-22 19:49:24 +00:00
|
|
|
mySpeedStats( 0 ),
|
2007-08-23 19:02:33 +00:00
|
|
|
myFilter( TorrentFilter::ALL ),
|
2007-07-27 23:09:09 +00:00
|
|
|
myExitTime( 0 )
|
2007-07-19 14:06:50 +00:00
|
|
|
{
|
2007-07-28 00:41:35 +00:00
|
|
|
myTrayIcon = new wxTaskBarIcon;
|
2007-07-26 01:25:36 +00:00
|
|
|
SetIcon( myLogoIcon );
|
|
|
|
|
2007-08-23 16:38:58 +00:00
|
|
|
/**
|
|
|
|
*** Prefs
|
|
|
|
**/
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
long port;
|
|
|
|
wxString key = _T("port");
|
2007-11-22 04:15:22 +00:00
|
|
|
if( !myConfig->Read( key, &port, TR_DEFAULT_PORT ) )
|
2007-07-27 23:09:09 +00:00
|
|
|
myConfig->Write( key, port );
|
|
|
|
tr_setBindPort( handle, port );
|
|
|
|
|
|
|
|
key = _T("save-path");
|
|
|
|
wxString wxstr;
|
|
|
|
if( !myConfig->Read( key, &wxstr, wxFileName::GetHomeDir() ) )
|
2007-08-23 16:38:58 +00:00
|
|
|
myConfig->Write( key, wxstr );
|
2007-07-27 23:09:09 +00:00
|
|
|
mySavePath = toStr( wxstr );
|
2007-08-23 16:38:58 +00:00
|
|
|
|
|
|
|
const wxString default_colors[SpeedStats::N_COLORS] = {
|
|
|
|
_T("#000000"), // background
|
|
|
|
_T("#32cd32"), // frame
|
|
|
|
_T("#ff0000"), // all up
|
|
|
|
_T("#ff00ff"), // all down
|
|
|
|
_T("#ffff00"), // torrent up
|
|
|
|
_T("#00ff88") // torrent down
|
|
|
|
};
|
|
|
|
wxColor speedColors[SpeedStats::N_COLORS];
|
|
|
|
for( int i=0; i<SpeedStats::N_COLORS; ++i )
|
|
|
|
{
|
|
|
|
key = SpeedStats::GetColorName( i );
|
|
|
|
myConfig->Read( key, &wxstr, _T("") );
|
|
|
|
std::string str = toStr( wxstr );
|
|
|
|
if( (str.size()!=7)
|
|
|
|
|| (str[0]!='#')
|
|
|
|
|| !isxdigit(str[1]) || !isxdigit(str[2])
|
|
|
|
|| !isxdigit(str[3]) || !isxdigit(str[4])
|
|
|
|
|| !isxdigit(str[5]) || !isxdigit(str[6]))
|
|
|
|
{
|
|
|
|
myConfig->Write( key, default_colors[i] );
|
|
|
|
str = toStr( default_colors[i] );
|
|
|
|
}
|
|
|
|
int r, g, b;
|
|
|
|
sscanf( str.c_str()+1, "%02x%02x%02x", &r, &g, &b );
|
|
|
|
speedColors[i].Set( r, g, b );
|
|
|
|
}
|
2007-07-27 23:09:09 +00:00
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
/**
|
|
|
|
*** Menu
|
|
|
|
**/
|
|
|
|
|
|
|
|
wxMenuBar *menuBar = new wxMenuBar;
|
|
|
|
|
|
|
|
wxMenu * m = new wxMenu;
|
|
|
|
m->Append( wxID_OPEN, _T("&Open") );
|
|
|
|
m->Append( ID_START, _T("&Start") );
|
|
|
|
m->Append( wxID_STOP, _T("Sto&p") ) ;
|
|
|
|
m->Append( wxID_REFRESH, _T("Re&check") );
|
|
|
|
m->Append( wxID_REMOVE, _T("&Remove") );
|
|
|
|
m->AppendSeparator();
|
|
|
|
m->Append( wxID_NEW, _T("Create &New Torrent") );
|
|
|
|
m->AppendSeparator();
|
|
|
|
m->Append( wxID_CLOSE, _T("&Close") );
|
|
|
|
m->Append( wxID_EXIT, _T("&Exit") );
|
|
|
|
menuBar->Append( m, _T("&File") );
|
|
|
|
|
|
|
|
m = new wxMenu;
|
2007-07-27 23:09:09 +00:00
|
|
|
m->Append( wxID_SELECTALL, _T("Select &All") );
|
|
|
|
m->Append( ID_DESELECTALL, _T("&Deselect All") );
|
|
|
|
m->AppendSeparator();
|
2007-07-19 14:06:50 +00:00
|
|
|
m->Append( wxID_PREFERENCES, _T("Edit &Preferences") );
|
|
|
|
menuBar->Append( m, _T("&Edit") );
|
|
|
|
|
|
|
|
m = new wxMenu;
|
|
|
|
m->Append( ID_SHOW_DEBUG_WINDOW, _T("Show &Debug Window") );
|
|
|
|
m->AppendSeparator();
|
2007-07-19 14:50:42 +00:00
|
|
|
m->Append( wxID_ABOUT, _T("&About Xmission") );
|
2007-07-19 14:06:50 +00:00
|
|
|
menuBar->Append( m, _T("&Help") );
|
|
|
|
|
|
|
|
SetMenuBar(menuBar);
|
|
|
|
|
|
|
|
/**
|
|
|
|
*** Toolbar
|
|
|
|
**/
|
|
|
|
|
2007-08-03 18:52:01 +00:00
|
|
|
wxIcon open_icon( plus_xpm );
|
|
|
|
wxIcon exec_icon( play_xpm );
|
2007-07-23 17:36:34 +00:00
|
|
|
wxIcon stop_icon( stop_xpm );
|
2007-08-03 18:52:01 +00:00
|
|
|
wxIcon drop_icon( minus_xpm );
|
2007-07-23 17:36:34 +00:00
|
|
|
wxBitmap bitmap;
|
2007-07-19 14:50:42 +00:00
|
|
|
|
2007-08-03 20:46:02 +00:00
|
|
|
wxToolBar* toolbar = CreateToolBar( wxTB_FLAT );
|
|
|
|
toolbar->SetToolBitmapSize( wxSize( 24, 24 ) );
|
2007-07-23 17:36:34 +00:00
|
|
|
bitmap.CopyFromIcon( open_icon );
|
|
|
|
toolbar->AddTool( wxID_OPEN, _T("Open"), bitmap );
|
|
|
|
bitmap.CopyFromIcon( exec_icon );
|
|
|
|
toolbar->AddTool( ID_START, _T("Start"), bitmap );
|
|
|
|
bitmap.CopyFromIcon( stop_icon );
|
|
|
|
toolbar->AddTool( wxID_STOP, _T("Stop"), bitmap );
|
|
|
|
bitmap.CopyFromIcon( drop_icon );
|
|
|
|
toolbar->AddTool( wxID_REMOVE, _T("Remove"), bitmap );
|
2007-07-19 14:06:50 +00:00
|
|
|
toolbar->Realize();
|
|
|
|
|
|
|
|
/**
|
2007-07-19 19:05:55 +00:00
|
|
|
*** Row 1
|
|
|
|
**/
|
|
|
|
|
2007-08-03 20:46:02 +00:00
|
|
|
wxSplitterWindow * hsplit = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH );
|
2007-07-28 00:12:38 +00:00
|
|
|
#if wxCHECK_VERSION(2,5,4)
|
2007-07-23 00:56:51 +00:00
|
|
|
hsplit->SetSashGravity( 0.8 );
|
2007-07-28 00:12:38 +00:00
|
|
|
#endif
|
2007-07-19 19:05:55 +00:00
|
|
|
|
2007-08-03 05:11:03 +00:00
|
|
|
wxPanel * panel_1 = new wxPanel( hsplit, wxID_ANY );
|
2007-07-19 19:05:55 +00:00
|
|
|
|
2007-08-23 19:02:33 +00:00
|
|
|
wxBoxSizer * buttonSizer = new wxBoxSizer( wxVERTICAL );
|
2007-08-03 16:22:52 +00:00
|
|
|
|
2007-08-03 05:11:03 +00:00
|
|
|
for( int i=0; i<TorrentFilter::N_FILTERS; ++i ) {
|
2007-08-23 19:02:33 +00:00
|
|
|
wxToggleButton * b = new wxToggleButton( panel_1, ID_Filter+i, TorrentFilter::GetName(i), wxDefaultPosition, wxDefaultSize, (i==0)?wxRB_GROUP:0 );
|
|
|
|
b->SetValue( i==0 );
|
|
|
|
myFilterButtons[i] = b;
|
|
|
|
buttonSizer->Add( b, 1, wxGROW, 0 );
|
2007-08-03 05:11:03 +00:00
|
|
|
}
|
2007-07-19 19:05:55 +00:00
|
|
|
|
2007-08-03 05:11:03 +00:00
|
|
|
myTorrentList = new TorrentListCtrl( handle, myConfig, panel_1 );
|
2007-07-24 04:36:36 +00:00
|
|
|
myTorrentList->AddListener( this );
|
2007-07-19 19:05:55 +00:00
|
|
|
|
2007-08-23 19:02:33 +00:00
|
|
|
wxBoxSizer * panelSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
panelSizer->Add( buttonSizer, 0, wxALL, 5 );
|
|
|
|
panelSizer->Add( myTorrentList, 1, wxGROW|wxALL, 5 );
|
2007-08-03 05:11:03 +00:00
|
|
|
|
|
|
|
panel_1->SetSizer( panelSizer );
|
2007-07-19 19:05:55 +00:00
|
|
|
|
|
|
|
|
2007-07-23 00:56:51 +00:00
|
|
|
wxNotebook * notebook = new wxNotebook( hsplit, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
|
2007-07-27 23:09:09 +00:00
|
|
|
myTorrentStats = new TorrentStats( notebook );
|
|
|
|
notebook->AddPage( myTorrentStats, _T("General"), false );
|
|
|
|
wxButton * tmp = new wxButton( notebook, wxID_ANY, _T("Hello &World"));
|
|
|
|
notebook->AddPage( tmp, _T("Peers") );
|
|
|
|
tmp = new wxButton( notebook, wxID_ANY, _T("&Hello World"));
|
|
|
|
notebook->AddPage( tmp, _T("Pieces") );
|
2007-07-19 19:05:55 +00:00
|
|
|
tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
|
2007-07-27 23:09:09 +00:00
|
|
|
notebook->AddPage( tmp, _T("Files") );
|
|
|
|
mySpeedStats = new SpeedStats( notebook, wxID_ANY );
|
2007-08-23 16:38:58 +00:00
|
|
|
for( int i=0; i<SpeedStats::N_COLORS; ++i )
|
|
|
|
mySpeedStats->SetColor( i, speedColors[i] );
|
2007-07-27 23:09:09 +00:00
|
|
|
notebook->AddPage( mySpeedStats, _T("Speed"), true );
|
2007-07-19 19:05:55 +00:00
|
|
|
tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
|
2007-07-27 23:09:09 +00:00
|
|
|
notebook->AddPage( tmp, _T("Logger") );
|
2007-07-19 19:05:55 +00:00
|
|
|
|
2007-08-03 05:11:03 +00:00
|
|
|
hsplit->SplitHorizontally( panel_1, notebook );
|
2007-07-19 19:05:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*** Statusbar
|
2007-07-19 14:06:50 +00:00
|
|
|
**/
|
|
|
|
|
2007-07-27 23:09:09 +00:00
|
|
|
const int widths[] = { -1, 150, 150 };
|
|
|
|
wxStatusBar * statusBar = CreateStatusBar( WXSIZEOF(widths) );
|
|
|
|
SetStatusWidths( WXSIZEOF(widths), widths );
|
|
|
|
const int styles[] = { wxSB_FLAT, wxSB_NORMAL, wxSB_NORMAL };
|
|
|
|
statusBar->SetStatusStyles( WXSIZEOF(widths), styles );
|
2007-07-22 19:37:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*** Refresh
|
|
|
|
**/
|
|
|
|
|
2007-08-24 01:31:26 +00:00
|
|
|
myPulseTimer.Start( 500 );
|
2007-07-23 05:43:16 +00:00
|
|
|
|
2007-07-23 15:20:47 +00:00
|
|
|
/**
|
|
|
|
*** Load the torrents
|
|
|
|
**/
|
|
|
|
|
|
|
|
int count = 0;
|
2008-01-05 08:05:17 +00:00
|
|
|
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 );
|
2007-07-23 21:01:26 +00:00
|
|
|
myTorrents.insert( myTorrents.end(), torrents, torrents+count );
|
2007-07-23 15:20:47 +00:00
|
|
|
tr_free( torrents );
|
2008-01-05 08:05:17 +00:00
|
|
|
tr_ctorFree( ctor );
|
2007-07-23 23:59:13 +00:00
|
|
|
|
|
|
|
wxTimerEvent dummy;
|
2007-07-27 23:09:09 +00:00
|
|
|
OnPulse( dummy );
|
2007-07-19 14:06:50 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 18:17:23 +00:00
|
|
|
void
|
|
|
|
MyFrame :: OnExit( wxCommandEvent& WXUNUSED( event ) )
|
2007-07-19 14:06:50 +00:00
|
|
|
{
|
2007-07-27 23:09:09 +00:00
|
|
|
Enable( false );
|
|
|
|
|
2008-01-05 18:17:23 +00:00
|
|
|
myTorrents.clear( );
|
|
|
|
mySelectedTorrents.clear( );
|
|
|
|
ApplyCurrentFilter( );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
tr_sessionClose( handle );
|
2007-07-27 23:09:09 +00:00
|
|
|
|
|
|
|
/* give the connections a max of 10 seconds to shut themselves down */
|
|
|
|
myExitTime = time(0) + 10;
|
2007-07-19 14:06:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{
|
2007-07-23 17:36:34 +00:00
|
|
|
wxIcon ico( transmission_xpm );
|
2007-07-19 14:50:42 +00:00
|
|
|
|
2007-07-20 02:12:07 +00:00
|
|
|
#if wxCHECK_VERSION(2,8,0)
|
2007-07-19 14:06:50 +00:00
|
|
|
wxAboutDialogInfo info;
|
2007-07-19 14:50:42 +00:00
|
|
|
info.SetName(_T("Xmission"));
|
2007-07-19 14:06:50 +00:00
|
|
|
info.SetVersion(_T(LONG_VERSION_STRING));
|
|
|
|
info.SetCopyright(_T("Copyright 2005-2007 The Transmission Project"));
|
2007-10-13 17:35:49 +00:00
|
|
|
info.SetDescription(_T("A fast and easy BitTorrent client"));
|
2007-12-31 01:19:35 +00:00
|
|
|
info.SetWebSite( _T( "http://www.transmissionbt.com/" ) );
|
2007-07-19 14:50:42 +00:00
|
|
|
info.SetIcon( ico );
|
2007-07-23 02:43:25 +00:00
|
|
|
info.AddDeveloper( _T("Charles Kerr (Back-end, GTK+, wxWidgets)") );
|
|
|
|
info.AddDeveloper( _T("Mitchell Livingston (Back-end; OS X)") );
|
|
|
|
info.AddDeveloper( _T("Eric Petit (Back-end; OS X)") );
|
2007-10-13 17:35:49 +00:00
|
|
|
info.AddDeveloper( _T("Josh Elsasser (Back-end; GTK+)") );
|
2007-07-23 02:43:25 +00:00
|
|
|
info.AddDeveloper( _T("Bryan Varner (BeOS)") );
|
2007-07-19 14:06:50 +00:00
|
|
|
wxAboutBox( info );
|
2007-07-20 02:12:07 +00:00
|
|
|
#else
|
|
|
|
wxMessageBox(_T("Xmission " LONG_VERSION_STRING "\n"
|
|
|
|
"Copyright 2005-2007 The Transmission Project"),
|
|
|
|
_T("About Xmission"),
|
|
|
|
wxOK|wxICON_INFORMATION, this);
|
|
|
|
#endif
|
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
}
|