Ignore:
Timestamp:
Jan 9, 2017, 11:09:38 AM (3 years ago)
Author:
jrpelegrina
Message:

Update new version: 3.15.02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • filezilla/trunk/fuentes/src/interface/sitemanager_dialog.cpp

    r130 r3185  
    907907}
    908908
    909 void CSiteManagerDialog::OnNewFolder(wxCommandEvent&event)
     909void CSiteManagerDialog::OnNewFolder(wxCommandEvent&)
    910910{
    911911        wxTreeCtrlEx *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrlEx);
     
    10591059                wxString keyFile, keyFileComment, keyFileData;
    10601060                if (logon_type == KEY) {
    1061                         keyFile = XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->GetValue();
     1061                        keyFile = xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::GetValue);
    10621062                        if (keyFile.empty()) {
    10631063                                wxMessageBox(_("You have to enter a key file path"), _("Site Manager - Invalid data"), wxICON_EXCLAMATION, this);
     
    10691069                        CFZPuttyGenInterface cfzg(this);
    10701070                        if (cfzg.LoadKeyFile(keyFile, false, keyFileComment, keyFileData))
    1071                                 XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->ChangeValue(keyFile);
     1071                                xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::ChangeValue, keyFile);
    10721072                        else {
    10731073                                xrc_call(*this, "ID_KEYFILE", &wxWindow::SetFocus);
     
    12051205}
    12061206
    1207 void CSiteManagerDialog::OnRename(wxCommandEvent& event)
     1207void CSiteManagerDialog::OnRename(wxCommandEvent&)
    12081208{
    12091209        wxTreeCtrl *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrl);
     
    12181218}
    12191219
    1220 void CSiteManagerDialog::OnDelete(wxCommandEvent& event)
     1220void CSiteManagerDialog::OnDelete(wxCommandEvent&)
    12211221{
    12221222        wxTreeCtrlEx *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrlEx);
     
    12651265}
    12661266
    1267 void CSiteManagerDialog::OnSelChanged(wxTreeEvent& event)
     1267void CSiteManagerDialog::OnSelChanged(wxTreeEvent&)
    12681268{
    12691269        SetCtrlState();
    12701270}
    12711271
    1272 void CSiteManagerDialog::OnNewSite(wxCommandEvent& event)
     1272void CSiteManagerDialog::OnNewSite(wxCommandEvent&)
    12731273{
    12741274        wxTreeCtrl *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrl);
     
    13061306        SetControlVisibility(GetProtocol(), GetLogonType());
    13071307
    1308         XRCCTRL(*this, "ID_USER", wxTextCtrl)->Enable(event.GetString() != _("Anonymous"));
    1309         XRCCTRL(*this, "ID_PASS", wxTextCtrl)->Enable(event.GetString() == _("Normal") || event.GetString() == _("Account"));
    1310         XRCCTRL(*this, "ID_ACCOUNT", wxTextCtrl)->Enable(event.GetString() == _("Account"));
    1311         XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->Enable(event.GetString() == _("Key file"));
    1312         XRCCTRL(*this, "ID_KEYFILE_BROWSE", wxButton)->Enable(event.GetString() == _("Key file"));
     1308        xrc_call(*this, "ID_USER", &wxTextCtrl::Enable, event.GetString() != _("Anonymous"));
     1309        xrc_call(*this, "ID_PASS", &wxTextCtrl::Enable, event.GetString() == _("Normal") || event.GetString() == _("Account"));
     1310        xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::Enable, event.GetString() == _("Account"));
     1311        xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::Enable, event.GetString() == _("Key file"));
     1312        xrc_call(*this, "ID_KEYFILE_BROWSE", &wxButton::Enable, event.GetString() == _("Key file"));
    13131313}
    13141314
     
    13791379        server.m_server.SetAccount(xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::GetValue));
    13801380
    1381         server.m_server.SetKeyFile(XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->GetValue());
     1381        server.m_server.SetKeyFile(xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::GetValue));
    13821382
    13831383        server.m_comments = xrc_call(*this, "ID_COMMENTS", &wxTextCtrl::GetValue);
     
    14661466}
    14671467
    1468 void CSiteManagerDialog::OnKeyFileBrowse(wxCommandEvent& event)
     1468void CSiteManagerDialog::OnKeyFileBrowse(wxCommandEvent&)
    14691469{
    14701470        wxTreeCtrl *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrl);
     
    14981498        }
    14991499}
    1500 void CSiteManagerDialog::OnRemoteDirBrowse(wxCommandEvent& event)
     1500void CSiteManagerDialog::OnRemoteDirBrowse(wxCommandEvent&)
    15011501{
    15021502        wxTreeCtrl *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrl);
     
    15181518}
    15191519
    1520 void CSiteManagerDialog::OnItemActivated(wxTreeEvent& event)
     1520void CSiteManagerDialog::OnItemActivated(wxTreeEvent&)
    15211521{
    15221522        wxTreeCtrl *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrl);
     
    15661566                const bool root_or_predefined = (item == pTree->GetRootItem() || item == m_ownSites || predefined);
    15671567
    1568                 XRCCTRL(*this, "ID_RENAME", wxWindow)->Enable(!root_or_predefined);
    1569                 XRCCTRL(*this, "ID_DELETE", wxWindow)->Enable(!root_or_predefined);
    1570                 XRCCTRL(*this, "ID_COPY", wxWindow)->Enable(false);
     1568                xrc_call(*this, "ID_RENAME", &wxWindow::Enable, !root_or_predefined);
     1569                xrc_call(*this, "ID_DELETE", &wxWindow::Enable, !root_or_predefined);
     1570                xrc_call(*this, "ID_COPY", &wxWindow::Enable, false);
    15711571                m_pNotebook_Site->Enable(false);
    1572                 XRCCTRL(*this, "ID_NEWFOLDER", wxWindow)->Enable(!predefined);
    1573                 XRCCTRL(*this, "ID_NEWSITE", wxWindow)->Enable(!predefined);
    1574                 XRCCTRL(*this, "ID_NEWBOOKMARK", wxWindow)->Enable(false);
    1575                 XRCCTRL(*this, "ID_CONNECT", wxButton)->Enable(false);
     1572                xrc_call(*this, "ID_NEWFOLDER", &wxWindow::Enable, !predefined);
     1573                xrc_call(*this, "ID_NEWSITE", &wxWindow::Enable, !predefined);
     1574                xrc_call(*this, "ID_NEWBOOKMARK", &wxWindow::Enable, false);
     1575                xrc_call(*this, "ID_CONNECT", &wxButton::Enable, false);
    15761576
    15771577                // Empty all site information
    1578                 XRCCTRL(*this, "ID_HOST", wxTextCtrl)->ChangeValue(wxString());
    1579                 XRCCTRL(*this, "ID_PORT", wxTextCtrl)->ChangeValue(wxString());
     1578                xrc_call(*this, "ID_HOST", &wxTextCtrl::ChangeValue, wxString());
     1579                xrc_call(*this, "ID_PORT", &wxTextCtrl::ChangeValue, wxString());
    15801580                SetProtocol(FTP);
    1581                 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(false);
    1582                 XRCCTRL(*this, "ID_LOGONTYPE", wxChoice)->SetStringSelection(_("Anonymous"));
    1583                 XRCCTRL(*this, "ID_USER", wxTextCtrl)->ChangeValue(wxString());
    1584                 XRCCTRL(*this, "ID_PASS", wxTextCtrl)->ChangeValue(wxString());
    1585                 XRCCTRL(*this, "ID_ACCOUNT", wxTextCtrl)->ChangeValue(wxString());
    1586                 XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->ChangeValue(wxString());
    1587                 XRCCTRL(*this, "ID_COMMENTS", wxTextCtrl)->ChangeValue(wxString());
     1581                xrc_call(*this, "ID_BYPASSPROXY", &wxCheckBox::SetValue, false);
     1582                xrc_call(*this, "ID_LOGONTYPE", &wxChoice::SetStringSelection, _("Anonymous"));
     1583                xrc_call(*this, "ID_USER", &wxTextCtrl::ChangeValue, wxString());
     1584                xrc_call(*this, "ID_PASS", &wxTextCtrl::ChangeValue, wxString());
     1585                xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::ChangeValue, wxString());
     1586                xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::ChangeValue, wxString());
     1587                xrc_call(*this, "ID_COMMENTS", &wxTextCtrl::ChangeValue, wxString());
    15881588
    15891589                SetControlVisibility(FTP, ANONYMOUS);
    15901590
    1591                 XRCCTRL(*this, "ID_SERVERTYPE", wxChoice)->SetSelection(0);
    1592                 XRCCTRL(*this, "ID_LOCALDIR", wxTextCtrl)->ChangeValue(wxString());
    1593                 XRCCTRL(*this, "ID_REMOTEDIR", wxTextCtrl)->ChangeValue(wxString());
    1594                 XRCCTRL(*this, "ID_SYNC", wxCheckBox)->SetValue(false);
    1595                 XRCCTRL(*this, "ID_TIMEZONE_HOURS", wxSpinCtrl)->SetValue(0);
    1596                 XRCCTRL(*this, "ID_TIMEZONE_MINUTES", wxSpinCtrl)->SetValue(0);
    1597 
    1598                 XRCCTRL(*this, "ID_TRANSFERMODE_DEFAULT", wxRadioButton)->SetValue(true);
    1599                 XRCCTRL(*this, "ID_LIMITMULTIPLE", wxCheckBox)->SetValue(false);
    1600                 XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1);
    1601 
    1602                 XRCCTRL(*this, "ID_CHARSET_AUTO", wxRadioButton)->SetValue(true);
    1603                 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->ChangeValue(wxString());
     1591                xrc_call(*this, "ID_SERVERTYPE", &wxChoice::SetSelection, 0);
     1592                xrc_call(*this, "ID_LOCALDIR", &wxTextCtrl::ChangeValue, wxString());
     1593                xrc_call(*this, "ID_REMOTEDIR", &wxTextCtrl::ChangeValue, wxString());
     1594                xrc_call(*this, "ID_SYNC", &wxCheckBox::SetValue, false);
     1595                xrc_call<wxSpinCtrl, int>(*this, "ID_TIMEZONE_HOURS", &wxSpinCtrl::SetValue, 0);
     1596                xrc_call<wxSpinCtrl, int>(*this, "ID_TIMEZONE_MINUTES", &wxSpinCtrl::SetValue, 0);
     1597
     1598                xrc_call(*this, "ID_TRANSFERMODE_DEFAULT", &wxRadioButton::SetValue, true);
     1599                xrc_call(*this, "ID_LIMITMULTIPLE", &wxCheckBox::SetValue, false);
     1600                xrc_call<wxSpinCtrl, int>(*this, "ID_MAXMULTIPLE", &wxSpinCtrl::SetValue, 1);
     1601
     1602                xrc_call(*this, "ID_CHARSET_AUTO", &wxRadioButton::SetValue, true);
     1603                xrc_call(*this, "ID_ENCODING", &wxTextCtrl::ChangeValue, wxString());
    16041604#ifdef __WXGTK__
    1605                 XRCCTRL(*this, "wxID_OK", wxButton)->SetDefault();
     1605                xrc_call(*this, "wxID_OK", &wxButton::SetDefault);
    16061606#endif
    16071607        }
     
    16141614
    16151615                // Set the control states according if it's possible to use the control
    1616                 XRCCTRL(*this, "ID_RENAME", wxWindow)->Enable(!predefined);
    1617                 XRCCTRL(*this, "ID_DELETE", wxWindow)->Enable(!predefined);
    1618                 XRCCTRL(*this, "ID_COPY", wxWindow)->Enable(true);
     1616                xrc_call(*this, "ID_RENAME", &wxWindow::Enable, !predefined);
     1617                xrc_call(*this, "ID_DELETE", &wxWindow::Enable, !predefined);
     1618                xrc_call(*this, "ID_COPY", &wxWindow::Enable, true);
    16191619                m_pNotebook_Site->Enable(true);
    1620                 XRCCTRL(*this, "ID_NEWFOLDER", wxWindow)->Enable(!predefined);
    1621                 XRCCTRL(*this, "ID_NEWSITE", wxWindow)->Enable(!predefined);
    1622                 XRCCTRL(*this, "ID_NEWBOOKMARK", wxWindow)->Enable(!predefined);
    1623                 XRCCTRL(*this, "ID_CONNECT", wxButton)->Enable(true);
    1624 
    1625                 XRCCTRL(*this, "ID_HOST", wxWindow)->Enable(!predefined);
    1626                 XRCCTRL(*this, "ID_HOST", wxTextCtrl)->ChangeValue(site_data->m_server.FormatHost(true));
     1620                xrc_call(*this, "ID_NEWFOLDER", &wxWindow::Enable, !predefined);
     1621                xrc_call(*this, "ID_NEWSITE", &wxWindow::Enable, !predefined);
     1622                xrc_call(*this, "ID_NEWBOOKMARK", &wxWindow::Enable, !predefined);
     1623                xrc_call(*this, "ID_CONNECT", &wxButton::Enable, true);
     1624
     1625                xrc_call(*this, "ID_HOST", &wxWindow::Enable, !predefined);
     1626                xrc_call(*this, "ID_HOST", &wxTextCtrl::ChangeValue, site_data->m_server.FormatHost(true));
    16271627                unsigned int port = site_data->m_server.GetPort();
    16281628
    16291629                if (port != CServer::GetDefaultPort(site_data->m_server.GetProtocol()))
    1630                         XRCCTRL(*this, "ID_PORT", wxTextCtrl)->ChangeValue(wxString::Format(_T("%d"), port));
     1630                        xrc_call(*this, "ID_PORT", &wxTextCtrl::ChangeValue, wxString::Format(_T("%d"), port));
    16311631                else
    1632                         XRCCTRL(*this, "ID_PORT", wxTextCtrl)->ChangeValue(wxString());
    1633                 XRCCTRL(*this, "ID_PORT", wxWindow)->Enable(!predefined);
     1632                        xrc_call(*this, "ID_PORT", &wxTextCtrl::ChangeValue, wxString());
     1633                xrc_call(*this, "ID_PORT", &wxWindow::Enable, !predefined);
    16341634
    16351635                SetProtocol(site_data->m_server.GetProtocol());
    1636                 XRCCTRL(*this, "ID_PROTOCOL", wxWindow)->Enable(!predefined);
    1637                 XRCCTRL(*this, "ID_ENCRYPTION", wxWindow)->Enable(!predefined);
    1638                 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(site_data->m_server.GetBypassProxy());
    1639 
    1640                 XRCCTRL(*this, "ID_USER", wxTextCtrl)->Enable(!predefined && site_data->m_server.GetLogonType() != ANONYMOUS);
    1641                 XRCCTRL(*this, "ID_PASS", wxTextCtrl)->Enable(!predefined && (site_data->m_server.GetLogonType() == NORMAL || site_data->m_server.GetLogonType() == ACCOUNT));
    1642                 XRCCTRL(*this, "ID_ACCOUNT", wxTextCtrl)->Enable(!predefined && site_data->m_server.GetLogonType() == ACCOUNT);
    1643                 XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->Enable(!predefined && site_data->m_server.GetLogonType() == KEY);
    1644                 XRCCTRL(*this, "ID_KEYFILE_BROWSE", wxButton)->Enable(!predefined && site_data->m_server.GetLogonType() == KEY);
     1636                xrc_call(*this, "ID_PROTOCOL", &wxWindow::Enable, !predefined);
     1637                xrc_call(*this, "ID_ENCRYPTION", &wxWindow::Enable, !predefined);
     1638                xrc_call(*this, "ID_BYPASSPROXY", &wxCheckBox::SetValue, site_data->m_server.GetBypassProxy());
     1639
     1640                xrc_call(*this, "ID_USER", &wxTextCtrl::Enable, !predefined && site_data->m_server.GetLogonType() != ANONYMOUS);
     1641                xrc_call(*this, "ID_PASS", &wxTextCtrl::Enable, !predefined && (site_data->m_server.GetLogonType() == NORMAL || site_data->m_server.GetLogonType() == ACCOUNT));
     1642                xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::Enable, !predefined && site_data->m_server.GetLogonType() == ACCOUNT);
     1643                xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::Enable, !predefined && site_data->m_server.GetLogonType() == KEY);
     1644                xrc_call(*this, "ID_KEYFILE_BROWSE", &wxButton::Enable, !predefined && site_data->m_server.GetLogonType() == KEY);
    16451645
    16461646                SetControlVisibility(site_data->m_server.GetProtocol(), site_data->m_server.GetLogonType());
    16471647
    1648                 XRCCTRL(*this, "ID_LOGONTYPE", wxChoice)->SetStringSelection(CServer::GetNameFromLogonType(site_data->m_server.GetLogonType()));
    1649                 XRCCTRL(*this, "ID_LOGONTYPE", wxWindow)->Enable(!predefined);
    1650 
    1651                 XRCCTRL(*this, "ID_USER", wxTextCtrl)->ChangeValue(site_data->m_server.GetUser());
    1652                 XRCCTRL(*this, "ID_ACCOUNT", wxTextCtrl)->ChangeValue(site_data->m_server.GetAccount());
    1653                 XRCCTRL(*this, "ID_PASS", wxTextCtrl)->ChangeValue(site_data->m_server.GetPass());
    1654                 XRCCTRL(*this, "ID_KEYFILE", wxTextCtrl)->ChangeValue(site_data->m_server.GetKeyFile());
    1655                 XRCCTRL(*this, "ID_COMMENTS", wxTextCtrl)->ChangeValue(site_data->m_comments);
    1656                 XRCCTRL(*this, "ID_COMMENTS", wxWindow)->Enable(!predefined);
    1657 
    1658                 XRCCTRL(*this, "ID_SERVERTYPE", wxChoice)->SetSelection(site_data->m_server.GetType());
    1659                 XRCCTRL(*this, "ID_SERVERTYPE", wxWindow)->Enable(!predefined);
    1660                 XRCCTRL(*this, "ID_LOCALDIR", wxTextCtrl)->ChangeValue(site_data->m_localDir);
    1661                 XRCCTRL(*this, "ID_LOCALDIR", wxWindow)->Enable(!predefined);
    1662                 XRCCTRL(*this, "ID_REMOTEDIR", wxTextCtrl)->ChangeValue(site_data->m_remoteDir.GetPath());
    1663                 XRCCTRL(*this, "ID_REMOTEDIR", wxWindow)->Enable(!predefined);
    1664                 XRCCTRL(*this, "ID_SYNC", wxCheckBox)->Enable(!predefined);
    1665                 XRCCTRL(*this, "ID_SYNC", wxCheckBox)->SetValue(site_data->m_sync);
    1666                 XRCCTRL(*this, "ID_COMPARISON", wxCheckBox)->Enable(!predefined);
    1667                 XRCCTRL(*this, "ID_COMPARISON", wxCheckBox)->SetValue(site_data->m_comparison);
    1668                 XRCCTRL(*this, "ID_TIMEZONE_HOURS", wxSpinCtrl)->SetValue(site_data->m_server.GetTimezoneOffset() / 60);
    1669                 XRCCTRL(*this, "ID_TIMEZONE_HOURS", wxWindow)->Enable(!predefined);
    1670                 XRCCTRL(*this, "ID_TIMEZONE_MINUTES", wxSpinCtrl)->SetValue(site_data->m_server.GetTimezoneOffset() % 60);
    1671                 XRCCTRL(*this, "ID_TIMEZONE_MINUTES", wxWindow)->Enable(!predefined);
     1648                xrc_call(*this, "ID_LOGONTYPE", &wxChoice::SetStringSelection, CServer::GetNameFromLogonType(site_data->m_server.GetLogonType()));
     1649                xrc_call(*this, "ID_LOGONTYPE", &wxWindow::Enable, !predefined);
     1650
     1651                xrc_call(*this, "ID_USER", &wxTextCtrl::ChangeValue, site_data->m_server.GetUser());
     1652                xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::ChangeValue, site_data->m_server.GetAccount());
     1653                xrc_call(*this, "ID_PASS", &wxTextCtrl::ChangeValue, site_data->m_server.GetPass());
     1654                xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::ChangeValue, site_data->m_server.GetKeyFile());
     1655                xrc_call(*this, "ID_COMMENTS", &wxTextCtrl::ChangeValue, site_data->m_comments);
     1656                xrc_call(*this, "ID_COMMENTS", &wxWindow::Enable, !predefined);
     1657
     1658                xrc_call(*this, "ID_SERVERTYPE", &wxChoice::SetSelection, site_data->m_server.GetType());
     1659                xrc_call(*this, "ID_SERVERTYPE", &wxWindow::Enable, !predefined);
     1660                xrc_call(*this, "ID_LOCALDIR", &wxTextCtrl::ChangeValue, site_data->m_localDir);
     1661                xrc_call(*this, "ID_LOCALDIR", &wxWindow::Enable, !predefined);
     1662                xrc_call(*this, "ID_REMOTEDIR", &wxTextCtrl::ChangeValue, site_data->m_remoteDir.GetPath());
     1663                xrc_call(*this, "ID_REMOTEDIR", &wxWindow::Enable, !predefined);
     1664                xrc_call(*this, "ID_SYNC", &wxCheckBox::Enable, !predefined);
     1665                xrc_call(*this, "ID_SYNC", &wxCheckBox::SetValue, site_data->m_sync);
     1666                xrc_call(*this, "ID_COMPARISON", &wxCheckBox::Enable, !predefined);
     1667                xrc_call(*this, "ID_COMPARISON", &wxCheckBox::SetValue, site_data->m_comparison);
     1668                xrc_call<wxSpinCtrl, int>(*this, "ID_TIMEZONE_HOURS", &wxSpinCtrl::SetValue, site_data->m_server.GetTimezoneOffset() / 60);
     1669                xrc_call(*this, "ID_TIMEZONE_HOURS", &wxWindow::Enable, !predefined);
     1670                xrc_call<wxSpinCtrl, int>(*this, "ID_TIMEZONE_MINUTES", &wxSpinCtrl::SetValue, site_data->m_server.GetTimezoneOffset() % 60);
     1671                xrc_call(*this, "ID_TIMEZONE_MINUTES", &wxWindow::Enable, !predefined);
    16721672
    16731673                enum PasvMode pasvMode = site_data->m_server.GetPasvMode();
    16741674                if (pasvMode == MODE_ACTIVE)
    1675                         XRCCTRL(*this, "ID_TRANSFERMODE_ACTIVE", wxRadioButton)->SetValue(true);
     1675                        xrc_call(*this, "ID_TRANSFERMODE_ACTIVE", &wxRadioButton::SetValue, true);
    16761676                else if (pasvMode == MODE_PASSIVE)
    1677                         XRCCTRL(*this, "ID_TRANSFERMODE_PASSIVE", wxRadioButton)->SetValue(true);
     1677                        xrc_call(*this, "ID_TRANSFERMODE_PASSIVE", &wxRadioButton::SetValue, true);
    16781678                else
    1679                         XRCCTRL(*this, "ID_TRANSFERMODE_DEFAULT", wxRadioButton)->SetValue(true);
    1680                 XRCCTRL(*this, "ID_TRANSFERMODE_ACTIVE", wxWindow)->Enable(!predefined);
    1681                 XRCCTRL(*this, "ID_TRANSFERMODE_PASSIVE", wxWindow)->Enable(!predefined);
    1682                 XRCCTRL(*this, "ID_TRANSFERMODE_DEFAULT", wxWindow)->Enable(!predefined);
     1679                        xrc_call(*this, "ID_TRANSFERMODE_DEFAULT", &wxRadioButton::SetValue, true);
     1680                xrc_call(*this, "ID_TRANSFERMODE_ACTIVE", &wxWindow::Enable, !predefined);
     1681                xrc_call(*this, "ID_TRANSFERMODE_PASSIVE", &wxWindow::Enable, !predefined);
     1682                xrc_call(*this, "ID_TRANSFERMODE_DEFAULT", &wxWindow::Enable, !predefined);
    16831683
    16841684                int maxMultiple = site_data->m_server.MaximumMultipleConnections();
    1685                 XRCCTRL(*this, "ID_LIMITMULTIPLE", wxCheckBox)->SetValue(maxMultiple != 0);
    1686                 XRCCTRL(*this, "ID_LIMITMULTIPLE", wxWindow)->Enable(!predefined);
     1685                xrc_call(*this, "ID_LIMITMULTIPLE", &wxCheckBox::SetValue, maxMultiple != 0);
     1686                xrc_call(*this, "ID_LIMITMULTIPLE", &wxWindow::Enable, !predefined);
    16871687                if (maxMultiple != 0) {
    1688                         XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->Enable(!predefined);
    1689                         XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(maxMultiple);
     1688                        xrc_call(*this, "ID_MAXMULTIPLE", &wxSpinCtrl::Enable, !predefined);
     1689                        xrc_call<wxSpinCtrl, int>(*this, "ID_MAXMULTIPLE", &wxSpinCtrl::SetValue, maxMultiple);
    16901690                }
    16911691                else {
    1692                         XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->Enable(false);
    1693                         XRCCTRL(*this, "ID_MAXMULTIPLE", wxSpinCtrl)->SetValue(1);
     1692                        xrc_call(*this, "ID_MAXMULTIPLE", &wxSpinCtrl::Enable, false);
     1693                        xrc_call<wxSpinCtrl, int>(*this, "ID_MAXMULTIPLE", &wxSpinCtrl::SetValue, 1);
    16941694                }
    16951695
     
    16971697                default:
    16981698                case ENCODING_AUTO:
    1699                         XRCCTRL(*this, "ID_CHARSET_AUTO", wxRadioButton)->SetValue(true);
     1699                        xrc_call(*this, "ID_CHARSET_AUTO", &wxRadioButton::SetValue, true);
    17001700                        break;
    17011701                case ENCODING_UTF8:
    1702                         XRCCTRL(*this, "ID_CHARSET_UTF8", wxRadioButton)->SetValue(true);
     1702                        xrc_call(*this, "ID_CHARSET_UTF8", &wxRadioButton::SetValue, true);
    17031703                        break;
    17041704                case ENCODING_CUSTOM:
    1705                         XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxRadioButton)->SetValue(true);
     1705                        xrc_call(*this, "ID_CHARSET_CUSTOM", &wxRadioButton::SetValue, true);
    17061706                        break;
    17071707                }
    1708                 XRCCTRL(*this, "ID_CHARSET_AUTO", wxWindow)->Enable(!predefined);
    1709                 XRCCTRL(*this, "ID_CHARSET_UTF8", wxWindow)->Enable(!predefined);
    1710                 XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxWindow)->Enable(!predefined);
    1711                 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->Enable(!predefined && site_data->m_server.GetEncodingType() == ENCODING_CUSTOM);
    1712                 XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->ChangeValue(site_data->m_server.GetCustomEncoding());
     1708                xrc_call(*this, "ID_CHARSET_AUTO", &wxWindow::Enable, !predefined);
     1709                xrc_call(*this, "ID_CHARSET_UTF8", &wxWindow::Enable, !predefined);
     1710                xrc_call(*this, "ID_CHARSET_CUSTOM", &wxWindow::Enable, !predefined);
     1711                xrc_call(*this, "ID_ENCODING", &wxTextCtrl::Enable, !predefined && site_data->m_server.GetEncodingType() == ENCODING_CUSTOM);
     1712                xrc_call(*this, "ID_ENCODING", &wxTextCtrl::ChangeValue, site_data->m_server.GetCustomEncoding());
    17131713#ifdef __WXGTK__
    1714                 XRCCTRL(*this, "ID_CONNECT", wxButton)->SetDefault();
     1714                xrc_call(*this, "ID_CONNECT", &wxButton::SetDefault);
    17151715#endif
    17161716        }
     
    17211721
    17221722                // Set the control states according if it's possible to use the control
    1723                 XRCCTRL(*this, "ID_RENAME", wxWindow)->Enable(!predefined);
    1724                 XRCCTRL(*this, "ID_DELETE", wxWindow)->Enable(!predefined);
    1725                 XRCCTRL(*this, "ID_COPY", wxWindow)->Enable(true);
    1726                 XRCCTRL(*this, "ID_NEWFOLDER", wxWindow)->Enable(!predefined);
    1727                 XRCCTRL(*this, "ID_NEWSITE", wxWindow)->Enable(!predefined);
    1728                 XRCCTRL(*this, "ID_NEWBOOKMARK", wxWindow)->Enable(!predefined);
    1729                 XRCCTRL(*this, "ID_CONNECT", wxButton)->Enable(true);
    1730 
    1731                 XRCCTRL(*this, "ID_BOOKMARK_LOCALDIR", wxTextCtrl)->ChangeValue(data->m_localDir);
    1732                 XRCCTRL(*this, "ID_BOOKMARK_LOCALDIR", wxWindow)->Enable(!predefined);
    1733                 XRCCTRL(*this, "ID_BOOKMARK_REMOTEDIR", wxTextCtrl)->ChangeValue(data->m_remoteDir.GetPath());
    1734                 XRCCTRL(*this, "ID_BOOKMARK_REMOTEDIR", wxWindow)->Enable(!predefined);
    1735 
    1736                 XRCCTRL(*this, "ID_BOOKMARK_SYNC", wxCheckBox)->Enable(!predefined);
    1737                 XRCCTRL(*this, "ID_BOOKMARK_SYNC", wxCheckBox)->SetValue(data->m_sync);
    1738                 XRCCTRL(*this, "ID_BOOKMARK_COMPARISON", wxCheckBox)->Enable(!predefined);
    1739                 XRCCTRL(*this, "ID_BOOKMARK_COMPARISON", wxCheckBox)->SetValue(data->m_comparison);
     1723                xrc_call(*this, "ID_RENAME", &wxWindow::Enable, !predefined);
     1724                xrc_call(*this, "ID_DELETE", &wxWindow::Enable, !predefined);
     1725                xrc_call(*this, "ID_COPY", &wxWindow::Enable, true);
     1726                xrc_call(*this, "ID_NEWFOLDER", &wxWindow::Enable, !predefined);
     1727                xrc_call(*this, "ID_NEWSITE", &wxWindow::Enable, !predefined);
     1728                xrc_call(*this, "ID_NEWBOOKMARK", &wxWindow::Enable, !predefined);
     1729                xrc_call(*this, "ID_CONNECT", &wxButton::Enable, true);
     1730
     1731                xrc_call(*this, "ID_BOOKMARK_LOCALDIR", &wxTextCtrl::ChangeValue, data->m_localDir);
     1732                xrc_call(*this, "ID_BOOKMARK_LOCALDIR", &wxWindow::Enable, !predefined);
     1733                xrc_call(*this, "ID_BOOKMARK_REMOTEDIR", &wxTextCtrl::ChangeValue, data->m_remoteDir.GetPath());
     1734                xrc_call(*this, "ID_BOOKMARK_REMOTEDIR", &wxWindow::Enable, !predefined);
     1735
     1736                xrc_call(*this, "ID_BOOKMARK_SYNC", &wxCheckBox::Enable, !predefined);
     1737                xrc_call(*this, "ID_BOOKMARK_SYNC", &wxCheckBox::SetValue, data->m_sync);
     1738                xrc_call(*this, "ID_BOOKMARK_COMPARISON", &wxCheckBox::Enable, !predefined);
     1739                xrc_call(*this, "ID_BOOKMARK_COMPARISON", &wxCheckBox::SetValue, data->m_comparison);
    17401740        }
    17411741#ifdef __WXGTK__
     
    17431743                for (wxWindow* pParent = pFocus->GetParent(); pParent; pParent = pParent->GetParent()) {
    17441744                        if (pParent == this) {
    1745                                 XRCCTRL(*this, "wxID_OK", wxButton)->SetFocus();
     1745                                xrc_call(*this, "wxID_OK", &wxButton::SetFocus);
    17461746                                break;
    17471747                        }
     
    17511751}
    17521752
    1753 void CSiteManagerDialog::OnCharsetChange(wxCommandEvent& event)
    1754 {
    1755         bool checked = XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxRadioButton)->GetValue();
    1756         XRCCTRL(*this, "ID_ENCODING", wxTextCtrl)->Enable(checked);
    1757 }
    1758 
    1759 void CSiteManagerDialog::OnProtocolSelChanged(wxCommandEvent& event)
     1753void CSiteManagerDialog::OnCharsetChange(wxCommandEvent&)
     1754{
     1755        bool checked = xrc_call(*this, "ID_CHARSET_CUSTOM", &wxRadioButton::GetValue);
     1756        xrc_call(*this, "ID_ENCODING", &wxTextCtrl::Enable, checked);
     1757}
     1758
     1759void CSiteManagerDialog::OnProtocolSelChanged(wxCommandEvent&)
    17601760{
    17611761        SetControlVisibility(GetProtocol(), GetLogonType());
     
    17961796        xrc_call(*this, "ID_KEYFILE_BROWSE", &wxButton::Show, protocol == SFTP && type == KEY);
    17971797
    1798         xrc_call(*this, "ID_KEYFILE_DESC", &wxStaticText::GetContainingSizer)->CalcMin();
    1799         xrc_call(*this, "ID_KEYFILE_DESC", &wxStaticText::GetContainingSizer)->Layout();
    1800 }
    1801 
    1802 void CSiteManagerDialog::OnCopySite(wxCommandEvent& event)
     1798        auto keyfileSizer = xrc_call(*this, "ID_KEYFILE_DESC", &wxStaticText::GetContainingSizer);
     1799        if (keyfileSizer) {
     1800                keyfileSizer->CalcMin();
     1801                keyfileSizer->Layout();
     1802        }
     1803}
     1804
     1805void CSiteManagerDialog::OnCopySite(wxCommandEvent&)
    18031806{
    18041807        wxTreeCtrlEx *pTree = XRCCTRL(*this, "ID_SITETREE", wxTreeCtrlEx);
Note: See TracChangeset for help on using the changeset viewer.