Some strange issues with GUI working in FileZilla

Moderator: Project members

Post Reply
Message
Author
test
550 File not found
Posts: 34
Joined: 2020-03-24 06:36

Some strange issues with GUI working in FileZilla

#1 Post by test » 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:

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 165 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 165 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 165 times
Last edited by test on 2020-04-21 15:45, edited 2 times in total.

User avatar
botg
Site Admin
Posts: 32907
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Some strange issues with GUI working in FileZilla

#2 Post by botg » 2020-04-21 15:20

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.

test
550 File not found
Posts: 34
Joined: 2020-03-24 06:36

Re: Some strange issues with GUI working in FileZilla

#3 Post by test » 2020-04-21 15:43

PS: I have uploaded 3 images

test
550 File not found
Posts: 34
Joined: 2020-03-24 06:36

Re: Some strange issues with GUI working in FileZilla

#4 Post by test » 2020-04-21 15:44

Okay, would try the "enum" method.

Thanks for your precious help!

test
550 File not found
Posts: 34
Joined: 2020-03-24 06:36

Re: Some strange issues with GUI working in FileZilla

#5 Post by test » 2020-04-22 14:57

I tried using LogonType::anonymous with some modifications & it worked

Thanks!

User avatar
botg
Site Admin
Posts: 32907
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Some strange issues with GUI working in FileZilla

#6 Post by botg » 2020-04-22 21:57

Do not re-use the anonymous logon type for non-anonymous logins.

Post Reply