Ticket #8976: filezilla_3.9.0.6_proxy_per_site.patch
File filezilla_3.9.0.6_proxy_per_site.patch, 28.3 KB (added by , 10 years ago) |
---|
-
src/engine/ControlSocket.cpp
diff -Nur filezilla-3.9.0.6.orig/src/engine/ControlSocket.cpp filezilla-3.9.0.6/src/engine/ControlSocket.cpp
old new 1122 1122 wxString host; 1123 1123 unsigned int port = 0; 1124 1124 1125 const int proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 1126 if (proxy_type > CProxySocket::unknown && proxy_type < CProxySocket::proxytype_count && !m_pCurrentServer->GetBypassProxy()) { 1125 int proxyType = 0; 1126 wxString proxyHost; 1127 unsigned int proxyPort; 1128 wxString proxyUser; 1129 wxString proxyPass; 1130 1131 if (m_pCurrentServer->GetProxyType() > CProxySocket::unknown && 1132 m_pCurrentServer->GetProxyType() < CProxySocket::proxytype_count && 1133 m_pCurrentServer->GetProxyHost() != _T("")) { 1134 proxyType = m_pCurrentServer->GetProxyType(); 1135 proxyHost = m_pCurrentServer->GetProxyHost(); 1136 proxyPort = m_pCurrentServer->GetProxyPort(); 1137 proxyUser = m_pCurrentServer->GetProxyUser(); 1138 proxyPass = m_pCurrentServer->GetProxyPass(); 1139 } 1140 else if (!m_pCurrentServer->GetBypassProxy()) { 1141 proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 1142 proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST); 1143 proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT); 1144 proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER); 1145 proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 1146 } 1147 if (proxyType > CProxySocket::unknown && proxyType < CProxySocket::proxytype_count) { 1127 1148 LogMessage(MessageType::Status, _("Connecting to %s through proxy"), m_pCurrentServer->FormatHost()); 1128 1149 1129 host = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST);1130 port = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT);1150 host = proxyHost; 1151 port = proxyPort; 1131 1152 1132 1153 delete m_pBackend; 1133 1154 m_pProxyBackend = new CProxySocket(this, m_pSocket, this); 1134 1155 m_pBackend = m_pProxyBackend; 1135 int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxy _type,1156 int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxyType, 1136 1157 m_pCurrentServer->GetHost(), m_pCurrentServer->GetPort(), 1137 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER),1138 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS));1158 proxyUser, 1159 proxyPass); 1139 1160 1140 1161 if (res != EINPROGRESS) { 1141 1162 LogMessage(MessageType::Error, _("Could not start proxy handshake: %s"), CSocket::GetErrorDescription(res)); -
src/engine/ftpcontrolsocket.cpp
diff -Nur filezilla-3.9.0.6.orig/src/engine/ftpcontrolsocket.cpp filezilla-3.9.0.6/src/engine/ftpcontrolsocket.cpp
old new 4389 4389 4390 4390 // Do not use FTP proxy if generic proxy is set 4391 4391 int generic_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 4392 if ((generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) && 4392 if ((server.GetProxyType() <= CProxySocket::unknown || server.GetProxyType() >= CProxySocket::proxytype_count || server.GetProxyHost() == _T("")) && 4393 (generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) && 4393 4394 (pData->ftp_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE)) && !server.GetBypassProxy()) 4394 4395 { 4395 4396 pData->host = m_pEngine->GetOptions()->GetOption(OPTION_FTP_PROXY_HOST); -
src/engine/server.cpp
diff -Nur filezilla-3.9.0.6.orig/src/engine/server.cpp filezilla-3.9.0.6/src/engine/server.cpp
old new 286 286 m_timezoneOffset = op.m_timezoneOffset; 287 287 m_pasvMode = op.m_pasvMode; 288 288 m_maximumMultipleConnections = op.m_maximumMultipleConnections; 289 m_proxyType = op.m_proxyType; 290 m_proxyHost = op.m_proxyHost; 291 m_proxyPort = op.m_proxyPort; 292 m_proxyUser = op.m_proxyUser; 293 m_proxyPass = op.m_proxyPass; 289 294 m_encodingType = op.m_encodingType; 290 295 m_customEncoding = op.m_customEncoding; 291 296 m_postLoginCommands = op.m_postLoginCommands; … … 329 334 return false; 330 335 else if (m_pasvMode != op.m_pasvMode) 331 336 return false; 337 else if (m_proxyType != op.m_proxyType) 338 return false; 339 else if (m_proxyHost != op.m_proxyHost) 340 return false; 341 else if (m_proxyPort != op.m_proxyPort) 342 return false; 343 else if (m_proxyUser != op.m_proxyUser) 344 return false; 345 else if (m_proxyPass != op.m_proxyPass) 346 return false; 332 347 else if (m_encodingType != op.m_encodingType) 333 348 return false; 334 349 else if (m_encodingType == ENCODING_CUSTOM) … … 415 430 else if (m_pasvMode > op.m_pasvMode) 416 431 return false; 417 432 433 if (m_proxyType < op.m_proxyType) 434 return true; 435 else if (m_proxyType > op.m_proxyType) 436 return false; 437 if (m_proxyHost < op.m_proxyHost) 438 return true; 439 else if (m_proxyHost > op.m_proxyHost) 440 return false; 441 if (m_proxyPort < op.m_proxyPort) 442 return true; 443 else if (m_proxyPort > op.m_proxyPort) 444 return false; 445 if (m_proxyUser < op.m_proxyUser) 446 return true; 447 else if (m_proxyUser > op.m_proxyUser) 448 return false; 449 if (m_proxyPass < op.m_proxyPass) 450 return true; 451 else if (m_proxyPass > op.m_proxyPass) 452 return false; 453 418 454 if (m_encodingType < op.m_encodingType) 419 455 return true; 420 456 else if (m_encodingType > op.m_encodingType) … … 468 504 return false; 469 505 else if (m_pasvMode != op.m_pasvMode) 470 506 return false; 507 else if (m_proxyType != op.m_proxyType) 508 return false; 509 else if (m_proxyHost != op.m_proxyHost) 510 return false; 511 else if (m_proxyPort != op.m_proxyPort) 512 return false; 513 else if (m_proxyUser != op.m_proxyUser) 514 return false; 515 else if (m_proxyPass != op.m_proxyPass) 516 return false; 471 517 else if (m_encodingType != op.m_encodingType) 472 518 return false; 473 519 else if (m_encodingType == ENCODING_CUSTOM) { … … 612 658 return m_maximumMultipleConnections; 613 659 } 614 660 661 int CServer::GetProxyType() const 662 { 663 return m_proxyType; 664 } 665 666 void CServer::SetProxyType(int type) 667 { 668 m_proxyType = type; 669 } 670 671 wxString CServer::GetProxyHost() const 672 { 673 return m_proxyHost; 674 } 675 676 bool CServer::SetProxyHost(wxString host) 677 { 678 m_proxyHost = host; 679 return true; 680 } 681 682 unsigned int CServer::GetProxyPort() const 683 { 684 return m_proxyPort; 685 } 686 687 bool CServer::SetProxyPort(unsigned int port) 688 { 689 if (port < 1 || port > 65535) 690 return false; 691 m_proxyPort = port; 692 return true; 693 } 694 695 wxString CServer::GetProxyUser() const 696 { 697 return m_proxyUser; 698 } 699 700 bool CServer::SetProxyUser(wxString user) 701 { 702 m_proxyUser = user; 703 return true; 704 } 705 706 wxString CServer::GetProxyPass() const 707 { 708 return m_proxyPass; 709 } 710 711 bool CServer::SetProxyPass(wxString pass) 712 { 713 m_proxyPass = pass; 714 return true; 715 } 716 615 717 wxString CServer::FormatHost(bool always_omit_port /*=false*/) const 616 718 { 617 719 wxString host = m_host; … … 660 762 m_timezoneOffset = 0; 661 763 m_pasvMode = MODE_DEFAULT; 662 764 m_maximumMultipleConnections = 0; 765 m_proxyType = 0; 766 m_proxyUser = _T(""); 767 m_proxyPort = 8080; 768 m_proxyUser = _T(""); 769 m_proxyPass = _T(""); 663 770 m_encodingType = ENCODING_AUTO; 664 771 m_customEncoding.clear(); 665 772 m_bypassProxy = false; -
src/engine/sftpcontrolsocket.cpp
diff -Nur filezilla-3.9.0.6.orig/src/engine/sftpcontrolsocket.cpp filezilla-3.9.0.6/src/engine/sftpcontrolsocket.cpp
old new 490 490 switch (pData->opState) 491 491 { 492 492 case connect_init: 493 if (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy()) 493 if ((m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T("")) || 494 (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy())) 494 495 pData->opState = connect_proxy; 495 496 else if (pData->pKeyFiles) 496 497 pData->opState = connect_keys; … … 544 545 { 545 546 case connect_proxy: 546 547 { 548 int proxyType; 549 wxString proxyHost; 550 unsigned int proxyPort; 551 wxString proxyUser; 552 wxString proxyPass; 553 554 if (m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T("")) { 555 proxyType = m_pCurrentServer->GetProxyType(); 556 proxyHost = m_pCurrentServer->GetProxyHost(); 557 proxyPort = m_pCurrentServer->GetProxyPort(); 558 proxyUser = m_pCurrentServer->GetProxyUser(); 559 proxyPass = m_pCurrentServer->GetProxyPass(); 560 } 561 else { 562 proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE); 563 proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST); 564 proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT); 565 proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER); 566 proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 567 } 568 547 569 int type; 548 switch (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE)) 549 { 570 switch (proxyType) { 550 571 case CProxySocket::HTTP: 551 572 type = 1; 552 573 break; … … 557 578 type = 3; 558 579 break; 559 580 default: 560 LogMessage(__TFILE__, __LINE__, this, MessageType::Debug_Warning, _T("Unsupported proxy type"));581 LogMessage(__TFILE__, __LINE__, this, MessageType::Debug_Warning, _T("Unsupported proxy type")); 561 582 DoClose(FZ_REPLY_INTERNALERROR); 562 583 return FZ_REPLY_ERROR; 563 584 } 564 585 565 586 wxString cmd = wxString::Format(_T("proxy %d \"%s\" %d"), type, 566 m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST),567 m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT));568 wxString user = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER);569 if ( !user.empty())587 proxyHost.c_str(), 588 proxyPort); 589 wxString user = proxyUser; 590 if (user != _T("")) 570 591 cmd += _T(" \"") + user + _T("\""); 571 592 572 593 wxString show = cmd; 573 594 574 wxString pass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS); 575 if (!pass.empty()) 576 { 595 wxString pass = proxyPass; 596 if (pass != _T("")) { 577 597 cmd += _T(" \"") + pass + _T("\""); 578 598 show += _T(" \"") + wxString('*', pass.Len()) + _T("\""); 579 599 } -
src/include/server.h
diff -Nur filezilla-3.9.0.6.orig/src/include/server.h filezilla-3.9.0.6/src/include/server.h
old new 107 107 void SetPasvMode(enum PasvMode pasvMode); 108 108 void MaximumMultipleConnections(int maximum); 109 109 110 int GetProxyType() const; 111 void SetProxyType(int type); 112 wxString GetProxyHost() const; 113 bool SetProxyHost(wxString host); 114 unsigned int GetProxyPort() const; 115 bool SetProxyPort(unsigned int port); 116 wxString GetProxyUser() const; 117 bool SetProxyUser(wxString user); 118 wxString GetProxyPass() const; 119 bool SetProxyPass(wxString pass); 120 110 121 wxString FormatHost(bool always_omit_port = false) const; 111 122 wxString FormatServer(const bool always_include_prefix = false) const; 112 123 … … 158 169 int m_timezoneOffset; 159 170 enum PasvMode m_pasvMode; 160 171 int m_maximumMultipleConnections; 172 int m_proxyType; 173 wxString m_proxyHost; 174 unsigned int m_proxyPort; 175 wxString m_proxyUser; 176 wxString m_proxyPass; 161 177 enum CharsetEncoding m_encodingType; 162 178 wxString m_customEncoding; 163 179 wxString m_name; -
src/interface/queue_storage.cpp
diff -Nur filezilla-3.9.0.6.orig/src/interface/queue_storage.cpp filezilla-3.9.0.6/src/interface/queue_storage.cpp
old new 48 48 encoding, 49 49 bypass_proxy, 50 50 post_login_commands, 51 name 51 name, 52 proxy_type, 53 proxy_host, 54 proxy_port, 55 proxy_user, 56 proxy_pass 52 57 }; 53 58 } 54 59 … … 68 73 { _T("encoding"), text, 0 }, 69 74 { _T("bypass_proxy"), integer, 0 }, 70 75 { _T("post_login_commands"), text, 0 }, 71 { _T("name"), text, 0 } 76 { _T("name"), text, 0 }, 77 { _T("proxy_type"), integer, 0 }, 78 { _T("proxy_host"), text, 0 }, 79 { _T("proxy_port"), integer, 0 }, 80 { _T("proxy_user"), text, 0 }, 81 { _T("proxy_pass"), text, 0 } 72 82 }; 73 83 74 84 namespace file_table_column_names … … 645 655 } 646 656 Bind(insertServerQuery_, server_table_column_names::max_connections, server.MaximumMultipleConnections()); 647 657 658 Bind(insertServerQuery_, server_table_column_names::proxy_type, static_cast<int>(server.GetProxyType())); 659 Bind(insertServerQuery_, server_table_column_names::proxy_host, server.GetProxyHost()); 660 Bind(insertServerQuery_, server_table_column_names::proxy_port, static_cast<int>(server.GetProxyPort())); 661 Bind(insertServerQuery_, server_table_column_names::proxy_user, server.GetProxyUser()); 662 Bind(insertServerQuery_, server_table_column_names::proxy_pass, server.GetProxyPass()); 663 648 664 switch (server.GetEncodingType()) 649 665 { 650 666 default: … … 912 928 return INVALID_DATA; 913 929 server.MaximumMultipleConnections(maximumMultipleConnections); 914 930 931 int proxyType = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_type); 932 server.SetProxyType(proxyType); 933 wxString proxyHost = GetColumnText(selectServersQuery_, server_table_column_names::proxy_host); 934 if (!server.SetProxyHost(proxyHost)) 935 return INVALID_DATA; 936 int proxyPort = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_port); 937 if (!server.SetProxyPort(proxyPort)) 938 return INVALID_DATA; 939 wxString proxyUser = GetColumnText(selectServersQuery_, server_table_column_names::proxy_user); 940 if (!server.SetProxyUser(proxyUser)) 941 return INVALID_DATA; 942 wxString proxyPass = GetColumnText(selectServersQuery_, server_table_column_names::proxy_pass); 943 if (!server.SetProxyPass(proxyPass)) 944 return INVALID_DATA; 945 915 946 wxString encodingType = GetColumnText(selectServersQuery_, server_table_column_names::encoding); 916 947 if (encodingType.empty() || encodingType == _T("Auto")) 917 948 server.SetEncodingType(ENCODING_AUTO); -
src/interface/resources/xrc/sitemanager.xrc
diff -Nur filezilla-3.9.0.6.orig/src/interface/resources/xrc/sitemanager.xrc filezilla-3.9.0.6/src/interface/resources/xrc/sitemanager.xrc
old new 445 445 </object> 446 446 </object> 447 447 <object class="notebookpage"> 448 <label>Generic proxy</label> 449 <object class="wxPanel"> 450 <object class="wxBoxSizer"> 451 <orient>wxVERTICAL</orient> 452 <object class="sizeritem"> 453 <object class="wxStaticBoxSizer"> 454 <label>Generic proxy</label> 455 <orient>wxHORIZONTAL</orient> 456 <object class="sizeritem"> 457 <object class="wxFlexGridSizer"> 458 <cols>1</cols> 459 <vgap>5</vgap> 460 <object class="sizeritem"> 461 <object class="wxStaticText"> 462 <label>Type of generic proxy:</label> 463 </object> 464 </object> 465 <object class="sizeritem"> 466 <object class="wxRadioButton" name="ID_PROXYTYPE_NONE"> 467 <label>&None</label> 468 </object> 469 </object> 470 <object class="sizeritem"> 471 <object class="wxRadioButton" name="ID_PROXYTYPE_HTTP"> 472 <label>&HTTP/1.1 using CONNECT method</label> 473 </object> 474 </object> 475 <object class="sizeritem"> 476 <object class="wxRadioButton" name="ID_PROXYTYPE_SOCKS5"> 477 <label>&SOCKS 5</label> 478 </object> 479 </object> 480 <object class="sizeritem"> 481 <object class="wxFlexGridSizer"> 482 <cols>2</cols> 483 <object class="sizeritem"> 484 <object class="wxStaticText"> 485 <label>P&roxy host:</label> 486 </object> 487 <flag>wxALIGN_CENTRE_VERTICAL</flag> 488 </object> 489 <object class="sizeritem"> 490 <object class="wxTextCtrl" name="ID_PROXY_HOST"/> 491 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 492 </object> 493 <object class="sizeritem"> 494 <object class="wxStaticText"> 495 <label>Proxy &port:</label> 496 </object> 497 <flag>wxALIGN_CENTRE_VERTICAL</flag> 498 </object> 499 <object class="sizeritem"> 500 <object class="wxTextCtrl" name="ID_PROXY_PORT"> 501 <size>50,-1</size> 502 </object> 503 <flag>wxALIGN_CENTRE_VERTICAL</flag> 504 </object> 505 <object class="sizeritem"> 506 <object class="wxStaticText"> 507 <label>Proxy &user:</label> 508 </object> 509 <flag>wxALIGN_CENTRE_VERTICAL</flag> 510 </object> 511 <object class="sizeritem"> 512 <object class="wxTextCtrl" name="ID_PROXY_USER"/> 513 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 514 </object> 515 <object class="sizeritem"> 516 <object class="wxStaticText"> 517 <label>Pro&xy password:</label> 518 </object> 519 <flag>wxALIGN_CENTRE_VERTICAL</flag> 520 </object> 521 <object class="sizeritem"> 522 <object class="wxTextCtrl" name="ID_PROXY_PASS"> 523 <style>wxTE_PASSWORD</style> 524 </object> 525 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 526 </object> 527 <vgap>5</vgap> 528 <hgap>5</hgap> 529 <growablecols>1</growablecols> 530 </object> 531 <flag>wxGROW</flag> 532 </object> 533 <growablecols>0</growablecols> 534 <object class="sizeritem"> 535 <object class="wxStaticText"> 536 <label>Note: Using a generic proxy forces passive mode on FTP connections.</label> 537 </object> 538 </object> 539 </object> 540 <option>1</option> 541 <flag>wxBOTTOM|wxLEFT|wxRIGHT|wxGROW</flag> 542 <border>5</border> 543 </object> 544 </object> 545 <option>1</option> 546 <flag>wxGROW</flag> 547 </object> 548 </object> 549 </object> 550 </object> 551 <object class="notebookpage"> 448 552 <label>Charset</label> 449 553 <object class="wxPanel"> 450 554 <object class="wxBoxSizer"> -
src/interface/sitemanager_dialog.cpp
diff -Nur filezilla-3.9.0.6.orig/src/interface/sitemanager_dialog.cpp filezilla-3.9.0.6/src/interface/sitemanager_dialog.cpp
old new 33 33 EVT_BUTTON(XRCID("ID_BROWSE"), CSiteManagerDialog::OnRemoteDirBrowse) 34 34 EVT_TREE_ITEM_ACTIVATED(XRCID("ID_SITETREE"), CSiteManagerDialog::OnItemActivated) 35 35 EVT_CHECKBOX(XRCID("ID_LIMITMULTIPLE"), CSiteManagerDialog::OnLimitMultipleConnectionsChanged) 36 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_NONE"), CSiteManagerDialog::OnProxyChange) 37 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_HTTP"), CSiteManagerDialog::OnProxyChange) 38 EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_SOCKS5"), CSiteManagerDialog::OnProxyChange) 36 39 EVT_RADIOBUTTON(XRCID("ID_CHARSET_AUTO"), CSiteManagerDialog::OnCharsetChange) 37 40 EVT_RADIOBUTTON(XRCID("ID_CHARSET_UTF8"), CSiteManagerDialog::OnCharsetChange) 38 41 EVT_RADIOBUTTON(XRCID("ID_CHARSET_CUSTOM"), CSiteManagerDialog::OnCharsetChange) … … 404 407 XRCCTRL(*this, "ID_TRANSFERMODE_ACTIVE", wxRadioButton)->Update(); 405 408 XRCCTRL(*this, "ID_TRANSFERMODE_PASSIVE", wxRadioButton)->Update(); 406 409 410 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxRadioButton)->Update(); 411 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->Update(); 412 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->Update(); 413 407 414 wxTreeItemId item = pTree->GetSelection(); 408 415 if (!item.IsOk()) 409 416 pTree->SelectItem(m_ownSites); … … 1390 1397 else 1391 1398 server.m_server.MaximumMultipleConnections(0); 1392 1399 1400 if (XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->GetValue()) 1401 server.m_server.SetProxyType(1); 1402 else if (XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->GetValue()) 1403 server.m_server.SetProxyType(2); 1404 else 1405 server.m_server.SetProxyType(0); 1406 server.m_server.SetProxyHost(XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->GetValue()); 1407 unsigned long proxyPort; 1408 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->GetValue().ToULong(&proxyPort); 1409 server.m_server.SetProxyPort(proxyPort); 1410 server.m_server.SetProxyUser(XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->GetValue()); 1411 server.m_server.SetProxyPass(XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->GetValue()); 1412 1393 1413 if (XRCCTRL(*this, "ID_CHARSET_UTF8", wxRadioButton)->GetValue()) 1394 1414 server.m_server.SetEncodingType(ENCODING_UTF8); 1395 1415 else if (XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxRadioButton)->GetValue()) … … 1638 1658 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1); 1639 1659 } 1640 1660 1661 int type = site_data->m_server.GetProxyType(); 1662 if (type == 1) 1663 { 1664 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->SetValue(true); 1665 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(false); 1666 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(true); 1667 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(true); 1668 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(true); 1669 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(true); 1670 } 1671 else if (type == 2) 1672 { 1673 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->SetValue(true); 1674 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(false); 1675 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(true); 1676 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(true); 1677 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(true); 1678 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(true); 1679 } 1680 else 1681 { 1682 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxRadioButton)->SetValue(true); 1683 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(true); 1684 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(false); 1685 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(false); 1686 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(false); 1687 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(false); 1688 } 1689 XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxWindow)->Enable(!predefined); 1690 XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxWindow)->Enable(!predefined); 1691 XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxWindow)->Enable(!predefined); 1692 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->SetValue(site_data->m_server.GetProxyHost()); 1693 unsigned int proxyPort = site_data->m_server.GetProxyPort(); 1694 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->SetValue(wxString::Format(_T("%d"), proxyPort)); 1695 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->SetValue(site_data->m_server.GetProxyUser()); 1696 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->SetValue(site_data->m_server.GetProxyPass()); 1697 1641 1698 switch (site_data->m_server.GetEncodingType()) 1642 1699 { 1643 1700 default: … … 1704 1761 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->Enable(checked); 1705 1762 } 1706 1763 1764 void CSiteManagerDialog::OnProxyChange(wxCommandEvent& event) 1765 { 1766 bool bUseProxy = false; 1767 if (XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->GetValue()) 1768 { 1769 bUseProxy = true; 1770 } 1771 else if (XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->GetValue()) 1772 { 1773 bUseProxy = true; 1774 } 1775 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->Enable(!bUseProxy); 1776 XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->Enable(bUseProxy); 1777 XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->Enable(bUseProxy); 1778 XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->Enable(bUseProxy); 1779 XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->Enable(bUseProxy); 1780 } 1781 1707 1782 void CSiteManagerDialog::OnProtocolSelChanged(wxCommandEvent& event) 1708 1783 { 1709 1784 wxChoice* pProtocol = XRCCTRL(*this, "ID_PROTOCOL", wxChoice); -
src/interface/sitemanager_dialog.h
diff -Nur filezilla-3.9.0.6.orig/src/interface/sitemanager_dialog.h filezilla-3.9.0.6/src/interface/sitemanager_dialog.h
old new 80 80 void OnItemActivated(wxTreeEvent& event); 81 81 void OnLimitMultipleConnectionsChanged(wxCommandEvent& event); 82 82 void OnCharsetChange(wxCommandEvent& event); 83 void OnProxyChange(wxCommandEvent& event); 83 84 void OnProtocolSelChanged(wxCommandEvent& event); 84 85 void OnBeginDrag(wxTreeEvent& event); 85 86 void OnChar(wxKeyEvent& event); -
src/interface/xmlfunctions.cpp
diff -Nur filezilla-3.9.0.6.orig/src/interface/xmlfunctions.cpp filezilla-3.9.0.6/src/interface/xmlfunctions.cpp
old new 550 550 int maximumMultipleConnections = GetTextElementInt(node, "MaximumMultipleConnections"); 551 551 server.MaximumMultipleConnections(maximumMultipleConnections); 552 552 553 int proxyType = GetTextElementInt(node, "ProxyType"); 554 server.SetProxyType(proxyType); 555 wxString proxyHost = GetTextElement(node, "ProxyHost"); 556 server.SetProxyHost(proxyHost); 557 int proxyPort = GetTextElementInt(node, "ProxyPort"); 558 if (proxyPort < 1 || proxyPort > 65535) 559 proxyPort = 8080; 560 server.SetProxyPort(proxyPort); 561 wxString proxyUser = GetTextElement(node, "ProxyUser"); 562 server.SetProxyUser(proxyUser); 563 wxString proxyPass = GetTextElement(node, "ProxyPass"); 564 server.SetProxyPass(proxyPass); 565 553 566 wxString encodingType = GetTextElement(node, "EncodingType"); 554 567 if (encodingType == _T("Auto")) 555 568 server.SetEncodingType(ENCODING_AUTO); … … 645 658 } 646 659 AddTextElement(node, "MaximumMultipleConnections", server.MaximumMultipleConnections()); 647 660 661 AddTextElement(node, "ProxyType", server.GetProxyType()); 662 AddTextElement(node, "ProxyHost", server.GetProxyHost()); 663 AddTextElement(node, "ProxyPort", server.GetProxyPort()); 664 AddTextElement(node, "ProxyUser", server.GetProxyUser()); 665 AddTextElement(node, "ProxyPass", server.GetProxyPass()); 666 648 667 switch (server.GetEncodingType()) 649 668 { 650 669 case ENCODING_AUTO: