2
2
// This file is part of the aMule Project.
4
// Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
4
// Copyright (c) 2003-2009 aMule Team ( admin@amule.org / http://www.amule.org )
5
5
// Copyright (c) 2002 Merkur ( devs@emule-project.net / http://www.emule-project.net )
7
7
// Any parts of this program derived from the xMule, lMule or eMule project,
917
917
m_menu->AppendSeparator();
918
918
//-----------------------------------------------------
919
919
wxMenu* extendedmenu = new wxMenu();
920
extendedmenu->Append(MP_SWAP_A4AF_TO_THIS,
921
_("Swap every A4AF to this file now"));
922
extendedmenu->AppendCheckItem(MP_SWAP_A4AF_TO_THIS_AUTO,
923
_("Swap every A4AF to this file (Auto)"));
920
extendedmenu->Append(MP_SWAP_A4AF_TO_THIS, _("Swap every A4AF to this file now"));
921
extendedmenu->AppendCheckItem(MP_SWAP_A4AF_TO_THIS_AUTO, _("Swap every A4AF to this file (Auto)"));
924
922
//-----------------------------------------------------
925
923
extendedmenu->AppendSeparator();
926
924
//-----------------------------------------------------
927
extendedmenu->Append(MP_SWAP_A4AF_TO_ANY_OTHER,
928
_("Swap every A4AF to any other file now"));
925
extendedmenu->Append(MP_SWAP_A4AF_TO_ANY_OTHER, _("Swap every A4AF to any other file now"));
929
926
//-----------------------------------------------------
930
m_menu->Append(MP_MENU_EXTD,
931
_("Extended Options"), extendedmenu);
927
m_menu->Append(MP_MENU_EXTD, _("Extended Options"), extendedmenu);
932
928
//-----------------------------------------------------
933
929
m_menu->AppendSeparator();
934
930
//-----------------------------------------------------
935
931
/* Commented out till RB2 is back
936
m_menu->Append( MP_RAZORSTATS,
937
_("Get Razorback 2's stats for this file"));
932
m_menu->Append( MP_RAZORSTATS, _("Get Razorback 2's stats for this file"));
938
933
//-----------------------------------------------------
939
934
m_menu->AppendSeparator();
940
935
//-----------------------------------------------------
946
941
//-----------------------------------------------------
947
942
m_menu->AppendSeparator();
948
943
//-----------------------------------------------------
949
m_menu->Append(MP_GETMAGNETLINK,
950
_("Copy magnet URI to clipboard"));
951
m_menu->Append(MP_GETED2KLINK,
952
_("Copy eD2k &link to clipboard"));
953
m_menu->Append(MP_WS,
954
_("Copy feedback to clipboard"));
944
m_menu->Append(MP_GETMAGNETLINK, _("Copy magnet URI to clipboard"));
945
m_menu->Append(MP_GETED2KLINK, _("Copy eD2k &link to clipboard"));
946
m_menu->Append(MP_WS, _("Copy feedback to clipboard"));
955
947
//-----------------------------------------------------
956
948
m_menu->AppendSeparator();
957
949
//-----------------------------------------------------
1014
1006
int priority = file->IsAutoDownPriority() ?
1015
1007
PR_AUTO : file->GetDownPriority();
1017
1009
priomenu->Check( MP_PRIOHIGH, priority == PR_HIGH );
1018
1010
priomenu->Check( MP_PRIONORMAL, priority == PR_NORMAL );
1019
1011
priomenu->Check( MP_PRIOLOW, priority == PR_LOW );
1020
1012
priomenu->Check( MP_PRIOAUTO, priority == PR_AUTO );
1022
1014
menu->Enable( MP_MENU_EXTD, canPause );
1024
PopupMenu(m_menu, evt.GetPoint());
1027
1016
CUpDownClient* client = item->GetSource();
1029
1018
m_menu = new wxMenu(wxT("Clients"));
1030
1019
m_menu->Append(MP_DETAIL, _("Show &Details"));
1031
1020
m_menu->Append(MP_ADDFRIEND, client->IsFriend() ? _("Remove from friends") : _("Add to Friends"));
1032
1021
m_menu->Append(MP_SHOWLIST, _("View Files"));
1033
1022
m_menu->Append(MP_SENDMESSAGE, _("Send message"));
1034
1023
m_menu->Append(MP_CHANGE2FILE, _("Swap to this file"));
1036
1025
// Only enable the Swap option for A4AF sources
1037
1026
m_menu->Enable(MP_CHANGE2FILE, (item->GetType() == A4AF_SOURCE));
1038
1027
// We need a valid IP if we are to message the client
1039
1028
m_menu->Enable(MP_SENDMESSAGE, (client->GetIP() != 0));
1041
1030
m_menu->Enable(MP_SHOWLIST, !client->HasDisabledSharedFiles());
1043
PopupMenu(m_menu, evt.GetPoint());
1033
bool autosort = thePrefs::AutoSortDownload(false);
1034
PopupMenu(m_menu, evt.GetPoint());
1035
thePrefs::AutoSortDownload(autosort);
1061
1051
CtrlItem_Struct* item = (CtrlItem_Struct*)GetItemData( index );
1053
bool autosort = thePrefs::AutoSortDownload(false);
1063
1054
if ( item->GetType() == FILE_TYPE ) {
1064
1055
CFileDetailDialog(this, item->GetFile()).ShowModal();
1066
1057
CClientDetailDialog(this, item->GetSource()).ShowModal();
1059
thePrefs::AutoSortDownload(autosort);
1126
1118
dc->SetBackground(*(wxTheBrushList->FindOrCreateBrush(
1127
1119
wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX), wxSOLID)));
1128
dc->SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
1121
// Patch da forum.amule.org per bug #0001531
1123
dc->SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
1125
# if wxCHECK_VERSION(2,8,10)
1126
// wsSYS_COLOUR_LISTBOXTEXT introdotta solo con 2.8.10
1127
dc->SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT));
1129
dc->SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
1402
1406
Parte di codice spostata: se ho capito bene
1403
1407
per prima cosa si vuole avere
1405
riferita ai sourceconut di Adunanza
1409
riferita ai sourcecount di Adunanza
1407
1411
text = wxString::Format( wxT("%i/%i" ), sc - ncsc, sc );
1491
// Mr Hyde per Clarensio
1492
uint8 CDownloadListCtrl::GetAduMuleSmiley(const CUpDownClient* pClient)
1494
if (!pClient) return Client_Unknown;
1496
switch (pClient->GetClientAduType()) {
1497
case ADUNANZA_ICON_ADU:
1498
switch (pClient->GetClientSoft()) {
1499
case SO_EMULE: return Client_eMule_AdunanzA_Smiley;
1500
case SO_AMULE: return Client_aMule_AdunanzA_Smiley;
1501
default: return Client_Unknown;
1505
case ADUNANZA_ICON_FW:
1506
return Client_Fastweb_Smiley;
1510
switch (pClient->GetClientSoft()) {
1511
case SO_EMULE: return Client_eMule_Smiley;
1512
case SO_AMULE: return Client_aMule_Smiley;
1513
default: return Client_Unknown;
1487
1521
void CDownloadListCtrl::DrawSourceItem(
1488
1522
wxDC* dc, int nColumn, const wxRect& rect, CtrlItem_Struct* item ) const
1629
1663
// Stefano Picerno: Aggiungo l'immagine giusta a seconda dei flag Adu / Fastweb
1630
1664
uint32 client_type = client->GetClientAduType();
1631
1665
wxString preUserName = wxString(_(""));
1632
if (client_type>ADUNANZA_ANY) {
1666
// if (client_type != ADUNANZA_ICON_NONE) {
1667
if ((client_type == ADUNANZA_ICON_ADU) || (client_type == ADUNANZA_ICON_FW)) {
1633
1669
if (client->IsFastwebFiber()) // Mr Hyde ADUFLAGS 20080201
1634
1670
m_ImageList.Draw(Client_Fiber_Flag, *dc, point2.x, point.y, wxIMAGELIST_DRAW_TRANSPARENT);
1663
1699
// ADUNANZA BEGIN
1665
1701
userName << wxT("?");
1667
1703
userName << preUserName + wxT("?");
1668
1705
// ADUNANZA END
1670
1707
// ADUNANZA BEGIN
1672
1709
userName << client->GetUserName();
1674
1711
userName << preUserName + client->GetUserName();
1675
1713
// ADUNANZA END
1677
1715
dc->DrawText(userName, rect.GetX() + 60, rect.GetY());
1903
1941
result = CmpAny(
1904
1942
file1->GetFileName(),
1905
1943
file2->GetFileName() );
1944
// Filename shouldn't be equal. If it IS, definitely choose one, so comparison result
1945
// is always defined. (Fallback in MuleListCtrl is wrong for client comparison.)
1947
result = CmpAny(file1, file2);
1908
1951
// Sort by size
2172
void CDownloadListCtrl::ResetCatParts(uint8 cat)
2174
// Go through all files
2175
for ( ListItems::iterator it = m_ListItems.begin(); it != m_ListItems.end(); ) {
2176
CtrlItem_Struct* item = it->second; ++it;
2178
if ( item->GetType() == FILE_TYPE ) {
2179
CPartFile* file = item->GetFile();
2181
if ( file->GetCategory() == cat ) {
2182
// Reset the category
2183
file->SetCategory( 0 );
2184
} else if ( file->GetCategory() > cat ) {
2185
// Set to the new position of the original category
2186
file->SetCategory( file->GetCategory() - 1 );
2129
2193
void CDownloadListCtrl::ShowFilesCount( int diff )
2131
2195
m_filecount += diff;
2349
2413
// Remove the .met and see if out video player specifiation uses the magic string
2350
2414
wxString fileWithoutMet = thePrefs::GetTempDir().JoinPaths(
2351
2415
file->GetPartMetFileName().RemoveExt()).GetRaw();
2352
2417
if (!command.Replace(wxT("$file"), fileWithoutMet)) {
2353
2418
// No magic string, so we just append the filename to the player command
2354
2419
// Need to use quotes in case filename contains spaces
2358
2423
// This is a complete file
2359
2424
// FIXME: This is probably not going to work if the filenames are mangled ...
2360
2425
wxString rawFileName = file->GetFullName().GetRaw();
2428
// We have to escape quote characters in the file name, otherwise arbitrary
2429
// options could be passed to the player.
2430
rawFileName.Replace(QUOTE, wxT("\\") QUOTE);
2361
2433
if (!command.Replace(wxT("$file"), rawFileName)) {
2362
2434
// No magic string, so we just append the filename to the player command
2363
2435
// Need to use quotes in case filename contains spaces