Page 1 of 1

Some strange issues with GUI working in FileZilla

Posted: 2020-04-21 13:19
by test
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:

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);
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.

Code: Select all

int CSiteManagerSite::GetAccessType()
{
	return xrc_call(*this, "ID_SERIALIZED", &wxChoice::GetSelection);
}
Added that declaration in /filezilla/src/sitemanager_site.h also

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_);
		}
	}
}
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!
Initially
Initially
1.png (56.59 KiB) Viewed 513 times
After clicking on &quot;Serialized Key&quot; drop down method, nothing happens instantly
After clicking on "Serialized Key" drop down method, nothing happens instantly
2.png (59.36 KiB) Viewed 513 times
Ideally this should happen instantly (This happens actually after firstly single clicking on other site(i.e. StorjMethod1) &amp; then again on main site(i.e. StorjMethod2))
Ideally this should happen instantly (This happens actually after firstly single clicking on other site(i.e. StorjMethod1) & then again on main site(i.e. StorjMethod2))
3.png (59.81 KiB) Viewed 513 times

Re: Some strange issues with GUI working in FileZilla

Posted: 2020-04-21 15:20
by botg
Yes, I guess you could extend the LogonType enum, making sure to also check each and every place in the software where it is used.

Re: Some strange issues with GUI working in FileZilla

Posted: 2020-04-21 15:43
by test
PS: I have uploaded 3 images

Re: Some strange issues with GUI working in FileZilla

Posted: 2020-04-21 15:44
by test
Okay, would try the "enum" method.

Thanks for your precious help!

Re: Some strange issues with GUI working in FileZilla

Posted: 2020-04-22 14:57
by test
I tried using LogonType::anonymous with some modifications & it worked

Thanks!

Re: Some strange issues with GUI working in FileZilla

Posted: 2020-04-22 21:57
by botg
Do not re-use the anonymous logon type for non-anonymous logins.