Commit 45bda6d8 authored by Rene Milk's avatar Rene Milk

this removes all torrent dependencies and replaces torrentwrapper with a stand-in for pr-downloader

parent 390e93db
.gitignore
build-*
build
bin
obj
springlobby.layout
springlobby.depend
*~
.cproject
.project
unitsync.log
doc/.gitignore
rpm/.gitignore
*.vcproj.*.user
*.suo
*.ncb
*.o
po/*
Makefile
Options.fbp
Updater.fbp
*.diff
config.h
doc/html/
doc/*
formbuilder.cpp
formbuilder.h
options.xrc
patch0.patch
remrampatch.diff
springlobby
springsettings
src/images/logo_xmas.svg
src/images/replay_icon.xpm
src/images/updater/
src/iunitsyncmap.cpp
src/sha1.c
src/sha1.h
test.txt
test/*
src/images/updater/*
*.fbp.bak
CMakeLists.txt.user*
src/qt-build/
<<<<<<< HEAD
moc_*.cpp
=======
attic/
>>>>>>> gitignore update
......@@ -159,41 +159,6 @@ ELSE(WIN32)
LINK_LIBRARIES( ${CURL_LDFLAGS} )
INCLUDE_DIRECTORIES( ${CURL_INCLUDE_DIR} )
ENDIF(WIN32)
#----------------------------------------------------------------------------------------------------
# libtorrent-rasterbar dependency check
#----------------------------------------------------------------------------------------------------
IF( OPTION_TORRENT_SYSTEM )
IF( NOT WIN32)
SET ( LIBTORRENT_MIN_VERSION 0.14 )
pkg_check_modules( LIBTORRENT libtorrent-rasterbar>=${LIBTORRENT_MIN_VERSION} )
IF( LIBTORRENT_FOUND )
INCLUDE_DIRECTORIES( ${LIBTORRENT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${LIBTORRENT_LIBRARIES} )
ADD_DEFINITIONS( ${LIBTORRENT_CFLAGS} )
ELSE()
MESSAGE( FATAL_ERROR "libtorrent-rasterbar library not found! Please install the package or toggle OPTION_TORRENT_SYSTEM to OFF")
ENDIF()
FIND_PACKAGE( Boost COMPONENTS system )
IF( Boost_FOUND )
link_directories( ${Boost_LIB_DIR} )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
SET( SL_BOOST_LIBS boost_system )
ELSE()
MESSAGE( FATAL_ERROR "boost library not found! Please install the package or toggle OPTION_TORRENT_SYSTEM to OFF")
ENDIF()
ELSE( NOT WIN32)
link_directories( ${boost_LIB_DIR} )
INCLUDE_DIRECTORIES( ${boost_INCLUDE_DIR} )
ADD_DEFINITIONS( -mthreads )
LINK_LIBRARIES( -mthreads torrent-rasterbar ${Boost_LIBRARIES} z ws2_32 mswsock )
ENDIF( NOT WIN32)
LIST( APPEND SLSharedWithSettings ${curlSRC} )
ADD_DEFINITIONS( -DTORRENT_DISABLE_GEO_IP )
ELSE( OPTION_TORRENT_SYSTEM )
ADD_DEFINITIONS( -DNO_TORRENT_SYSTEM )
ENDIF( OPTION_TORRENT_SYSTEM )
#----------------------------------------------------------------------------------------------------
# libnotify dependency check
......@@ -230,10 +195,7 @@ IF(WIN32)
SET(StandAloneSettings ${StandAloneSettings} src/settings++/settings.rc)
ELSE(WIN32)
# If we don't build for windows, include some source code checks as pre-build step.
FIND_PROGRAM(AWKBIN awk)
IF(AWKBIN)
ADD_CUSTOM_TARGET(test_susynclib ALL COMMAND ${AWKBIN} -f tools/test-susynclib.awk src/springunitsynclib.cpp WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
ENDIF(AWKBIN)
ADD_CUSTOM_TARGET(test_susynclib ALL COMMAND tools/test-susynclib.awk src/springunitsynclib.cpp WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
ENDIF(WIN32)
#----------------------------------------------------------------------------------------------------
......@@ -257,7 +219,6 @@ cmake_policy(SET CMP0006 OLD)
ADD_EXECUTABLE(springlobby WIN32 MACOSX_BUNDLE ${header} ${springlobbySrc} ${SettingsSrc} ${SLSharedWithSettings} ${springlobby_RC_FILE})
ADD_EXECUTABLE(springsettings WIN32 MACOSX_BUNDLE ${StandAloneSettings} ${SettingsSrc} ${SLSharedWithSettings} ${SpringSettings_RC_FILE} )
set_target_properties(springsettings PROPERTIES COMPILE_FLAGS -DSPRINGSETTINGS_STANDALONE )
#the updater needs to be build for windows only
IF(WIN32)
ADD_EXECUTABLE(springlobby_updater WIN32 MACOSX_BUNDLE ${updaterSrc} ${SLSharedWithSettings} ${updater_RC_FILE} )
......
This diff is collapsed.
TODO:
exceptions: expand caught exceptions with mor debug info
paint-locker: actually useful??
stacktrace: realtion to dbg-report?
variable_saytext: status?
webconncet-win, webconncet-win2: ??
Notes:
gl-test: renderer in channelchooser menu item in mainwindow
html-test: html-conatiner in mainwindow/torrent
\ No newline at end of file
......@@ -79,7 +79,7 @@ SET(springlobbySrc
src/nicklistctrl.cpp
src/offlinebattle.cpp
src/playback/replaylist.cpp
#src/playback/savegamelist.cpp
src/playback/savegamelist.cpp
src/alsound.cpp
src/selectusersdialog.cpp
src/server.cpp
......@@ -94,15 +94,12 @@ SET(springlobbySrc
src/springprocess.cpp
src/tasserver.cpp
src/tdfcontainer.cpp
src/torrentlistctrl.cpp
src/torrentoptionspanel.cpp
src/torrentwrapper.cpp
src/downloader/downloadlistctrl.cpp
src/downloadoptionspanel.cpp
src/ui.cpp
src/user.cpp
src/useractions.cpp
src/userlist.cpp
src/utils/downloader.cpp
src/utils/plasmaresourceinfo.cpp
src/utils/battleevents.cpp
src/widgets/downloadlistctrl.cpp
src/widgets/downloaddialog.cpp
......@@ -116,8 +113,16 @@ SET(springlobbySrc
src/gui/notificationmanager.cpp
src/pingthread.cpp
src/iserverevents.cpp
src/simpleinterface/simpleserverevents.cpp
src/downloader/prdownloader.cpp
)
#currently unused
SET( filelistSrc
src/downloader/filelister/filelistctrl.cpp
src/downloader/filelister/filelistdialog.cpp
src/downloader/filelister/filelistfilter.cpp )
SET(SettingsSrc
src/settings++/frame.cpp
src/settings++/helpmenufunctions.cpp
......
#----------------------------------------------------------------------------------------------------
# Source listing
#----------------------------------------------------------------------------------------------------
# We define the include paths here, our minimal source dir is one
INCLUDE_DIRECTORIES(${springlobby_SOURCE_DIR} ${Settings_SOURCE_DIR} )
SET(springlobbySrc
src/utils/activitynotice.cpp
src/chatpanelmenu.cpp
src/gui/gradientpanel.cpp
src/gui/toasternotification.cpp
src/gui/wxgradientbutton.cpp
src/gui/wxbackgroundimage.cpp
src/gui/statusbar.cpp
src/aui/slbook.cpp
src/utils/math.cpp
src/utils/misc.cpp
src/gui/pastedialog.cpp
src/utils/tasutil.cpp
src/utils/networkevents.cpp
src/utils/md5.c
src/updater/updater.cpp
src/Helper/TextCompletionDatabase.cpp
src/Helper/imageviewer.cpp
src/Helper/slhtmlwindow.cpp
src/channel/channelchooser.cpp
src/channel/channelchooserdialog.cpp
src/Helper/wxtextctrlhist.cpp
src/Helper/colorbutton.cpp
src/aui/auimanager.cpp
src/aui/artprovider.cpp
src/autobalancedialog.cpp
src/autohost.cpp
src/channel/autojoinchanneldialog.cpp
src/addbotdialog.cpp
src/agreementdialog.cpp
src/base64.cpp
src/battle.cpp
src/battlelist.cpp
src/battlelistctrl.cpp
src/battlelistfilter.cpp
src/battlelisttab.cpp
src/battlemaptab.cpp
src/battleoptionstab.cpp
src/battleroomlistctrl.cpp
src/battleroomtab.cpp
src/crc.cpp
src/channel/channel.cpp
src/channel/channellist.cpp
src/channel/channellistctrl.cpp
src/chatlog.cpp
src/chatoptionstab.cpp
src/chatpanel.cpp
src/connectwindow.cpp
src/countrycodes.cpp
src/customlistctrl.cpp
src/flagimages.cpp
src/groupoptionspanel.cpp
src/hostbattledialog.cpp
src/ibattle.cpp
src/iconimagelist.cpp
src/introguide.cpp
src/lobbyoptionstab.cpp
src/mainchattab.cpp
src/mainjoinbattletab.cpp
src/mainoptionstab.cpp
src/mainsingleplayertab.cpp
src/maindownloadtab.cpp
src/mainwindow.cpp
src/mapctrl.cpp
src/mapgridctrl.cpp
src/mapselectdialog.cpp
src/mmoptionwindows.cpp
src/nicklistctrl.cpp
src/offlinebattle.cpp
src/playback/replaylist.cpp
#src/playback/savegamelist.cpp
src/alsound.cpp
src/selectusersdialog.cpp
src/server.cpp
src/reconnectdialog.cpp
src/serverevents.cpp
src/singleplayerbattle.cpp
src/singleplayertab.cpp
src/socket.cpp
src/spring.cpp
src/springlobbyapp.cpp
src/springoptionstab.cpp
src/springprocess.cpp
src/tasserver.cpp
src/tdfcontainer.cpp
src/downloader/downloadlistctrl.cpp
src/downloadoptionspanel.cpp
src/ui.cpp
src/user.cpp
src/useractions.cpp
src/userlist.cpp
src/utils/battleevents.cpp
src/widgets/downloadlistctrl.cpp
src/widgets/downloaddialog.cpp
src/widgets/downloadpanel.cpp
src/widgets/infopanel.cpp
src/widgets/widget.cpp
src/Helper/tasclientimport.cpp
src/toasterbox/ToasterBox.cpp
src/toasterbox/ToasterBoxWindow.cpp
src/toasterbox/ToasterBoxWindowList.cpp
src/gui/notificationmanager.cpp
src/pingthread.cpp
src/iserverevents.cpp
<<<<<<< HEAD
=======
src/simpleinterface/simpleserverevents.cpp
src/downloader/prdownloader.cpp
>>>>>>> this removes all torrent dependencies and replaces torrentwrapper with a stand-in for pr-downloader
)
#currently unused
SET( filelistSrc
src/downloader/filelister/filelistctrl.cpp
src/downloader/filelister/filelistdialog.cpp
src/downloader/filelister/filelistfilter.cpp )
SET(SettingsSrc
src/settings++/frame.cpp
src/settings++/helpmenufunctions.cpp
src/settings++/panel_pathoption.cpp
src/settings++/se_utils.cpp
src/settings++/tab_abstract.cpp
src/settings++/tab_audio.cpp
src/settings++/tab_quality_video.cpp
src/settings++/tab_render_detail.cpp
src/settings++/tab_simple.cpp
src/settings++/tab_ui.cpp
src/settings++/hotkeys/HotkeyForms.cpp
src/settings++/hotkeys/AddSelectionCmdDlg.cpp
src/settings++/hotkeys/commandlist.cpp
src/settings++/hotkeys/hotkey_panel.cpp
src/settings++/hotkeys/hotkey_parser.cpp
src/settings++/hotkeys/KeynameConverter.cpp
src/settings++/hotkeys/wxSpringCommand.cpp
src/settings++/hotkeys/SpringDefaultProfile.cpp
src/settings++/hotkeys/HotkeyTypes.cpp
src/settings++/hotkeys/CommandOrderDlg.cpp
src/settings++/hotkeys/ChangeMetaDlg.cpp
src/wxkeybinder/keybinder.cpp
src/wxkeybinder/wxKeyMonitorTextCtrl.cpp
)
SET( curlSRC
src/utils/curlhelper.cpp
)
SET(StandAloneSettings
src/settings++/main.cpp
)
SET(SLSharedWithSettings
src/customizations.cpp
src/Helper/wxTranslationHelper.cpp
src/uiutils.cpp
src/updater/versionchecker.cpp
src/updater/updatehelper.cpp
src/utils/controls.cpp
src/utils/conversion.cpp
src/utils/customdialogs.cpp
src/utils/debug.cpp
src/utils/pathlistfactory.cpp
src/utils/globalevents.cpp
src/utils/platform.cpp
src/utils/sltipwin.cpp
src/utils/uievents.cpp
src/crashreport.cpp
src/globalsmanager.cpp
src/mmoptionmodel.cpp
src/mmoptionswrapper.cpp
src/settings.cpp
src/springunitsynclib.cpp
src/springunitsync.cpp
src/thread.cpp
src/infodialog.cpp
src/gui/windowattributespickle.cpp
src/gui/spinctl/generic/spinctlg.cpp
src/Helper/slconfig.cpp
)
SET( updaterSrc
src/updater/updatermainwindow.cpp
src/updater/updater.cpp
src/updater/updaterapp.cpp
src/utils/activitynotice.cpp
src/utils/misc.cpp
src/customizations.cpp
)
FILE( GLOB header "src/*.h" )
FILE( GLOB header2 "src/*/*.h" )
#grep -lR cpp\"$ src/* | sed -e "s/\.h/\.cpp/g"
SET( templatesources
src/battleroommmoptionstab.cpp
src/customvirtlistctrl.cpp
src/httpdownloader.cpp
src/playback/playbackfilter.cpp
src/playback/playbacklist.cpp
src/playback/playbacklistctrl.cpp
src/playback/playbackthread.cpp
src/playback/playbacktab.cpp
src/utils/stringserializer.cpp
)
LIST( APPEND header ${header2} ${templatesources} )
set_source_files_properties( ${header} PROPERTIES HEADER_FILE_ONLY 1 )
#cppcheck stuff
find_program( CPPCHECK_BINARY NAMES cppcheck )
IF( EXISTS ${CPPCHECK_BINARY} )
ADD_CUSTOM_TARGET( cppcheck )
FOREACH( list ${updaterSrc} ${header} ${SLSharedWithSettings} ${StandAloneSettings} ${curlSRC} ${SettingsSrc} ${springlobbySrc} )
FOREACH( SOURCEFILE ${list} )
LIST( APPEND CHECKPATHS ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCEFILE} )
ENDFOREACH( SOURCEFILE )
ENDFOREACH( list )
ADD_CUSTOM_TARGET( cppcheck-full ${CPPCHECK_BINARY} "--xml" "--enable=all" "-f" "--quiet" "-j 3"
${CHECKPATHS} "2>${CMAKE_CURRENT_BINARY_DIR}/cppcheck-full.xml" "&&"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck-htmlreport" "--source-dir=${CMAKE_CURRENT_SOURCE_DIR}/src/"
"--file=${CMAKE_CURRENT_BINARY_DIR}/cppcheck-full.xml" "--report-dir=report-full" "--title=SpringLobby - Full")
ADD_CUSTOM_TARGET( cppcheck-lite ${CPPCHECK_BINARY} "--xml" "-f" "--quiet" "-j 3"
${CHECKPATHS} "2>${CMAKE_CURRENT_BINARY_DIR}/cppcheck-lite.xml" "&&"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck-htmlreport" "--source-dir=${CMAKE_CURRENT_SOURCE_DIR}/src/"
"--file=${CMAKE_CURRENT_BINARY_DIR}/cppcheck-lite.xml" "--report-dir=report-lite" "--title=SpringLobby - Lite")
add_dependencies( cppcheck cppcheck-full )
add_dependencies( cppcheck cppcheck-lite )
ENDIF( EXISTS ${CPPCHECK_BINARY} )
IF( WIN32 )
LIST( APPEND SLSharedWithSettings src/stacktrace.c )
#snarl's currently not functional on win
#LIST( APPEND springlobbySrc src/gui/snarl/SnarlInterface.cpp src/gui/snarlnotification.cpp)
ELSE( WIN32 )
LIST( APPEND SLSharedWithSettings src/stacktrace.cpp )
ENDIF( WIN32 )
......@@ -13,12 +13,10 @@
#include <wx/menu.h>
#include <wx/datetime.h>
#include "torrentlistctrl.h"
#include "torrentwrapper.h"
//#include "utils/.h"
#include "iconimagelist.h"
#include "utils/conversion.h"
#include "downloadlistctrl.h"
#include "prdownloader.h"
#include "../iconimagelist.h"
#include "../utils/conversion.h"
static const wxString na_str = wxString(_("N/A"));
......@@ -123,28 +121,28 @@ void TorrentListCtrl::UpdateTorrentInfo(const DataType& info)
void TorrentListCtrl::OnListRightClick( wxListEvent& event )
{
int idx = event.GetIndex();
if ( idx < (long)m_data.size() && idx > -1 ) {
DataType dt = m_data[idx];
delete m_popup;
m_popup = new wxMenu( _T("") );
if(dt.downloadstatus == P2P::not_stored)
{
m_popup->Append( TLIST_CANCEL, _("Cancel download") );
m_popup->Append( TLIST_RETRY, _("Retry download") );
}
else if(dt.downloadstatus == P2P::queued || dt.downloadstatus == P2P::leeching)
m_popup->Append( TLIST_CANCEL, _("Cancel download") );
else if(dt.downloadstatus == P2P::complete)
m_popup->Append( TLIST_CANCEL, _("Remove download (keeping downloaded file)") );
PopupMenu( m_popup );
}
// if ( idx < (long)m_data.size() && idx > -1 ) {
// DataType dt = m_data[idx];
// delete m_popup;
// m_popup = new wxMenu( _T("") );
// if(dt.downloadstatus == P2P::not_stored)
// {
// m_popup->Append( TLIST_CANCEL, _("Cancel download") );
// m_popup->Append( TLIST_RETRY, _("Retry download") );
// }
// else if(dt.downloadstatus == P2P::queued || dt.downloadstatus == P2P::leeching)
// m_popup->Append( TLIST_CANCEL, _("Cancel download") );
// else if(dt.downloadstatus == P2P::complete)
// m_popup->Append( TLIST_CANCEL, _("Remove download (keeping downloaded file)") );
// PopupMenu( m_popup );
// }
}
void TorrentListCtrl::OnCancel(wxCommandEvent &/*event*/)
{
torrent().RemoveTorrentByName(GetSelectedData().name);
prDownloader().RemoveTorrentByName(GetSelectedData().name);
RemoveTorrentInfo(GetSelectedData());
}
......@@ -152,9 +150,9 @@ void TorrentListCtrl::OnCancel(wxCommandEvent &/*event*/)
void TorrentListCtrl::OnRetry(wxCommandEvent &/*event*/)
{
DataType info( GetSelectedData() );
torrent().RemoveTorrentByName( info.name );
prDownloader().RemoveTorrentByName( info.name );
RemoveTorrentInfo( info );
torrent().RequestFileByName( info.name );
prDownloader().RequestFileByName( info.name );
}
......@@ -213,7 +211,7 @@ wxString TorrentListCtrl::GetItemText(long item, long column) const
float kfactor = 1/float(1024);
float mfactor = 1/float(1024*1024);
const TorrentInfos& infos = m_data[item];
const DataType& infos = m_data[item];
switch ( column ) {
default: return wxEmptyString;
......
......@@ -3,8 +3,8 @@
#ifndef NO_TORRENT_SYSTEM
#include "customvirtlistctrl.h"
#include "torrentwrapper.h"
#include "../customvirtlistctrl.h"
#include "prdownloader.h"
#include <map>
//struct TorrentInfos;
......@@ -18,7 +18,7 @@ class Ui;
/** \brief list all currently active (queued,lecching,seeding) torrents with their infos
* the list is newly populated every n-seconds from Ui::OnUpdate()
*/
class TorrentListCtrl : public CustomVirtListCtrl<TorrentInfos, TorrentListCtrl>
class TorrentListCtrl : public CustomVirtListCtrl<DownloadInfo, TorrentListCtrl>
{
public:
TorrentListCtrl( wxWindow* parent );
......
......@@ -4,7 +4,6 @@
#ifndef NO_TORRENT_SYSTEM
#include <wx/dialog.h>
#include "../torrentwrapper.h"
#include "../utils/globalevents.h"
class wxBoxSizer;
......
lib @ bb68539f
Subproject commit bb68539f8a4431ba140ae591cc499489ef79770c
/**
This file is part of SpringLobby,
Copyright (C) 2007-2010
SpringLobby is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.
springsettings 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 SpringLobby. If not, see <http://www.gnu.org/licenses/>.
**/
#include "prdownloader.h"
#include "../globalsmanager.h"
PrDownloader::PrDownloader()
{
}
void PrDownloader::ClearFinished()
{
}
void PrDownloader::UpdateSettings()
{
}
void PrDownloader::RemoveTorrentByName(const wxString &name)
{
}
void PrDownloader::RequestFileByName(const wxString &name)
{
}
void PrDownloader::SetIngameStatus(bool ingame)
{
}
PrDownloader& prDownloader()
{
static LineInfo<PrDownloader> m( AT );
static GlobalObjectHolder<PrDownloader, LineInfo<PrDownloader> > s_PrDownloader( m );
return s_PrDownloader;
}
/**
This file is part of SpringLobby,
Copyright (C) 2007-2010
SpringLobby is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.
springsettings 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 SpringLobby. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef SPRINGLOBBY_HEADERGUARD_PRDOWNLOADER_H
#define SPRINGLOBBY_HEADERGUARD_PRDOWNLOADER_H
#include <wx/string.h>
namespace P2P {
enum FileStatus
{
not_stored = 0, /// file is not on disk and not downloading
queued = 1, /// file is not on disk and queued for download
leeching = 2, /// file is being downloaded
paused = 3, /// file currently not downloading but has valid handle
complete = 4 /// file is on disk / dl completed
};
}
struct DownloadInfo{
P2P::FileStatus downloadstatus;
wxString name;
int numcopies;//TODO remove
double progress;
double inspeed;
double eta;
double filesize;
};
class PrDownloader
{
public:
PrDownloader();
void ClearFinished();
void UpdateSettings();
void RemoveTorrentByName( const wxString& name );
void RequestFileByName( const wxString& name );
void SetIngameStatus( bool ingame );
};
PrDownloader& prDownloader();
#endif // PRDOWNLOADER_H
......@@ -16,10 +16,10 @@
#include <wx/radiobut.h>
#include <wx/button.h>
#include "torrentoptionspanel.h"
#include "downloadoptionspanel.h"
#include "aui/auimanager.h"
#include "settings.h"
#include "torrentwrapper.h"
#include "downloader/prdownloader.h"
#include "utils/conversion.h"
#include "utils/controls.h"
......@@ -114,7 +114,7 @@ void TorrentOptionsPanel::OnApply( wxCommandEvent& /*unused*/ )
// if mode == pause selected --> m_gamestart_throttle->GetValue() == 0
sett().SetTorrentSystemSuspendMode( m_gamestart_throttle->GetValue() );
torrent().UpdateSettings();
prDownloader().UpdateSettings();
}
void TorrentOptionsPanel::OnRestore( wxCommandEvent& /*unused*/ )
......
......@@ -5,7 +5,7 @@
#include <winsock2.h>
#endif // _MSC_VER
#include "maintorrenttab.h"
#include "maindownloadtab.h"
#ifndef NO_TORRENT_SYSTEM
......@@ -15,16 +15,14 @@
#include <wx/button.h>
#include <wx/msgdlg.h>
#include "torrentlistctrl.h"
#include "torrentwrapper.h"
#include "downloader/downloadlistctrl.h"
#include "utils/conversion.h"
#include "utils/controls.h"
#include "Helper/colorbutton.h"
#include "filelister/filelistdialog.h"
//#include "downloader/filelister/filelistdialog.h"
#include "downloader/prdownloader.h"
#include "widgets/downloaddialog.h"
#include "aui/auimanager.h"
#include "utils/downloader.h"
BEGIN_EVENT_TABLE( MainTorrentTab, wxPanel )
//(*EventTable(MainTorrentTab)
......@@ -38,8 +36,7 @@ END_EVENT_TABLE()
MainTorrentTab::MainTorrentTab( wxWindow* parent )
: wxScrolledWindow( parent ),
m_widgets_dialog( NULL ),
m_download_dialog ( new FileListDialog( this ) )
m_widgets_dialog( NULL )
{
GetAui().manager->AddPane( this, wxLEFT, _T( "maintorrenttab" ) );
......@@ -87,29 +84,26 @@ MainTorrentTab::MainTorrentTab( wxWindow* parent )
SetSizer( m_mainbox );
SetScrollRate( SCROLL_RATE, SCROLL_RATE );
info_map = torrent().CollectGuiInfos();
// info_map = torrent().CollectGuiInfos();
m_torrent_list->Layout();
// m_torrent_list->Layout();
for ( map_infos_iter iter = info_map.begin(); iter != info_map.end(); ++iter )
{
if (iter->first == wxString(_T("global")))
continue;
m_torrent_list->AddTorrentInfo( iter->second );
}
// for ( map_infos_iter iter = info_map.begin(); iter != info_map.end(); ++iter )
// {
// if (iter->first == wxString(_T("global")))
// continue;
// m_torrent_list->AddTorrentInfo( iter->second );
// }
Layout();
}
MainTorrentTab::~MainTorrentTab()
{
delete m_download_dialog;
m_download_dialog = 0;
}
{}
void MainTorrentTab::OnClearFinished( wxCommandEvent& /*event*/ )
{
torrent().ClearFinishedTorrents();
prDownloader().ClearFinished();
m_torrent_list->Clear();