Some strange issues with GUI working in FileZilla
Posted: 2020-04-21 13:19
Hi!
I am developing a customised FileZilla Client application for connecting to Storj RC 1.0.
Now, Storj RC1.0 offers 2 login methods:
1) URL+API key+Password
2) Serialized Access Key
I have successfully implemented the backend of these 2 methods, but there are some strange issues coming in implementing GUI of 2nd method.
In bool CSiteManagerSite::Load(wxWindow* parent) function in filezilla/src/interface/sitemanager_site.cpp, I had added a dropdown field as follows:
Now, I want to change certain display items in Site Manager window
i.e. when I click on API Credentials, the default front end remains as it is.
When I click on Serialized Key, the Port No., Logon Type, Username, password fields should get disabled. The issue is coming in this approach.
Added that declaration in /filezilla/src/sitemanager_site.h also
Now, in the Site Manager, when I click on Serialized Key by drop down, nothing happens. However, if I have another site saved earlier & single click on that & then single click again on my site, the front end display gets edited as per requirements. But ideally, it should happen instantly.
Is it even possible to add my own Logon Type in Logon Type drop down ?
Kindly help
Thanks!
I am developing a customised FileZilla Client application for connecting to Storj RC 1.0.
Now, Storj RC1.0 offers 2 login methods:
1) URL+API key+Password
2) Serialized Access Key
I have successfully implemented the backend of these 2 methods, but there are some strange issues coming in implementing GUI of 2nd method.
In bool CSiteManagerSite::Load(wxWindow* parent) function in filezilla/src/interface/sitemanager_site.cpp, I had added a dropdown field as follows:
Code: Select all
lay.gbNewRow(bag);
lay.gbAdd(bag, new wxStaticText(generalPage, XRCID("ID_SERIALIZED_DESC"), _("Login by:")), lay.valign)->Show(false);
auto * row = lay.createFlex(0, 1);
auto * choice = new wxChoice(generalPage, XRCID("ID_SERIALIZED"));
choice->Append(_("API Credentials"));
choice->Append(_("Serialized Key"));
choice->SetSelection(0);
lay.gbAdd(bag, choice, lay.valign)->Show(false);
i.e. when I click on API Credentials, the default front end remains as it is.
When I click on Serialized Key, the Port No., Logon Type, Username, password fields should get disabled. The issue is coming in this approach.
Code: Select all
int CSiteManagerSite::GetAccessType()
{
return xrc_call(*this, "ID_SERIALIZED", &wxChoice::GetSelection);
}
Code: Select all
void CSiteManagerSite::SetLogonTypeCtrlState()
{
LogonType const t = GetLogonType();
int accessType = GetAccessType();
xrc_call(*this, "ID_USER", &wxTextCtrl::Enable, !predefined_ && t != LogonType::anonymous && accessType == 0 );
xrc_call(*this, "ID_PASS", &wxTextCtrl::Enable, !predefined_ && (t == LogonType::normal || t == LogonType::account) && accessType == 0);
xrc_call(*this, "ID_ACCOUNT", &wxTextCtrl::Enable, !predefined_ && t == LogonType::account);
xrc_call(*this, "ID_KEYFILE", &wxTextCtrl::Enable, !predefined_ && t == LogonType::key);
xrc_call(*this, "ID_KEYFILE_BROWSE", &wxButton::Enable, !predefined_ && t == LogonType::key);
for (int i = 0; i < ParameterSection::section_count; ++i) {
for (auto & pair : extraParameters_[i]) {
pair.second->Enable(!predefined_);
}
}
}
Is it even possible to add my own Logon Type in Logon Type drop down ?
Kindly help
Thanks!