Contribute Source-Code?

Moderator: Project members

Post Reply
Message
Author
schittli
500 Command not understood
Posts: 5
Joined: 2014-04-10 14:58

Contribute Source-Code?

#1 Post by schittli » 2014-04-10 23:44

:?: Hello,

i programmed some improvements:

Small improvement: Use wxSpinCtrl in settings Dialog:
Small improvement: Use wxSpinCtrl in settings Dialog
Small improvement: Use wxSpinCtrl in settings Dialog
Config-wxSpinCtrls.png (30.38 KiB) Viewed 15522 times
The probably most used settings maximum simultaneous downloads, enable Speed Limit, Download Speed Limit and Upload Speed Limit are now directly accessible in the toolbar:
The probably most used settings maximum simultaneous downloads, enable Speed Limit, Download Speed Limit and Upload Speed Limit are now directly accessible in the toolbar
The probably most used settings maximum simultaneous downloads, enable Speed Limit, Download Speed Limit and Upload Speed Limit are now directly accessible in the toolbar
Toolbar.png (41.88 KiB) Viewed 15522 times
I like this one veeeeeerrrry much: The LocalListView and RemoteListView have a new context Menu: "Create new Directory and enter it":
The LocalListView and RemoteListView have a new context Menu: "Create new Directory and enter it"
The LocalListView and RemoteListView have a new context Menu: "Create new Directory and enter it"
New Contextmenu.png (67.95 KiB) Viewed 15522 times

Are you interested in the code? I think it's well written and in the spirit of the other code.

If I can send the code: can I just check it into subversion?

Thanks a lot,
kind regards,
Tom

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

Re: Contribute Source-Code?

#2 Post by botg » 2014-04-11 06:35

This looks great, of course I am interested in the code. Please provide it in form of unified context diffs (one for each new feature) against the trunk head from FileZilla's SVN repository.

schittli
500 Command not understood
Posts: 5
Joined: 2014-04-10 14:58

Re: Contribute Source-Code?

#3 Post by schittli » 2014-04-14 20:05

Hi Site Admin

Thanks a lot for your answer, i have added the following files:
src.zip
(8.38 KiB) Downloaded 232 times
Contains:
trunk_contextMenu_CreateNewDirectoryAndEnterIt.diff
Is self-explaining

trunk_wxSpinCtrl_in_settings_Dialog.diff
Is self-explaining

trunk_contextMenu_CreateNewDirectoryAndEnterIt.diff
src\interface\resources\iconmonstr-download-6-icon-48.png
src\interface\resources\iconmonstr-sort-27-icon-48.png
src\interface\resources\iconmonstr-upload-6-icon-48.png

The extended Toolbar and the icons.

I hope all diffs are ok - I had to split them into the three parts because I had made all changes in the same source code.

Kind regards,
Thomas

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

Re: Contribute Source-Code?

#4 Post by botg » 2014-04-14 21:18

Thanks.

I couldn't yet look into the patches itself, but already noticed two important issues from the filenames alone:

First and foremost, the iconmonstr license is incompatible with the GPL. You cannot use icons from that site in programs such as FileZilla. In particular it says this:
The icons may not be sub-licensed, resold, rented, redistributed or detached from a template, application or web page. The icons may not be included in any online or offline archive or archived downloadable format.
On the technical side, toolbar icons are themed in FileZilla based on the used icon set. Please use the art provider to access toolbar icons and put the new icons into the respective directory of the default theme. Have a look at how the other toolbar icons are being used.

schittli
500 Command not understood
Posts: 5
Joined: 2014-04-10 14:58

Re: Contribute Source-Code?

#5 Post by schittli » 2014-04-15 21:08

Good evening,

thanks for your Answer!, I have read the iconmonstr license and interpreted it the wrong way :-(

Therefore, I re-designed the Icons and created them for each size from 16x16 up to 48x48. If you the Icon-Source Files which I created with the Greenfish Icon Editor Pro freeware.
On the technical side, toolbar icons are themed in FileZilla based on the used icon set. Please use the art provider to access toolbar icons and put the new icons into the respective directory of the default theme. Have a look at how the other toolbar icons are being used.
Thanks for this information, too. The change was easy and I added the diff-File and the Icons in:
trunk_toolbar_SetSimultaneousDownloadsAndSpeedLimits.zip
diff-File for extended Toolbar and self-created icon-files
(14.11 KiB) Downloaded 209 times
It contains only the files for the extended toolbar.

Kind regards, Tom

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

Re: Contribute Source-Code?

#6 Post by botg » 2014-04-20 09:26

I've applied the patch for the settings dialog changes.

Reviewing the create-and-enter patch, I noticed the following:
  • Missing keyboard mnemonic in the context menu entries
  • You're needlessly refreshing the local file list by calling DisplayDir, even if you want to enter the new directory afterwards
  • The helper functions return the text from the dialog, which is not normalized. The normalized should be returned
Regarding the toolbar patch, I noticed that you're calling CMainFrame::CheckChangedSettings. While it works, it is an artifact of prior bad design choices of mine. I'm going to refactor the code so that the queue too uses COptionChangeEventHandler. It will have the benefit that CMainFrame does not need to be involved at all for the new toolbar functionality. Once I've committed the refactored code, could you please update your patch?

schittli
500 Command not understood
Posts: 5
Joined: 2014-04-10 14:58

Re: Contribute Source-Code?

#7 Post by schittli » 2014-04-21 21:03

Good evening Site Admin

thanks a lot for your answer!,
because I'm not a c++ programmer, usually don't work with linux and
never used wxwidgets before, I was happy to get a compilable, warning-free solution :-).

Reviewing the create-and-enter patch, I noticed the following:

Missing keyboard mnemonic in the context menu entries
You're needlessly refreshing the local file list by calling DisplayDir, even if you want to enter the new directory afterwards
I was not sure if I have to refresh... and did it just in case...
The helper functions return the text from the dialog, which is not normalized. The normalized should be returned
What do you mean by "normalized"? Is it related to the character set?
Is there any function to normalize it?


Regarding the toolbar patch, I noticed that you're calling CMainFrame::CheckChangedSettings. While it works, it is an artifact of prior bad design choices of mine. I'm going to refactor the code so that the queue too uses COptionChangeEventHandler. It will have the benefit that CMainFrame does not need to be involved at all for the new toolbar functionality. Once I've committed the refactored code, could you please update your patch?
I'll try it, please let me know as soon as I can get the refactored code.

Kind regards,
Tom

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

Re: Contribute Source-Code?

#8 Post by botg » 2014-04-22 06:02

What do you mean by "normalized"? Is it related to the character set?
Is there any function to normalize it?
Imagine we're currently in the directory /home/user/pictures, and the user enters data/../../foo/./../bar

After normalization, the entered path is /home/user/bar

There's already code doing the normalization in the directory creation functions, you only need to return the normalized path instead of the value from the dialog.
I'll try it, please let me know as soon as I can get the refactored code.
It's in the repository.

schittli
500 Command not understood
Posts: 5
Joined: 2014-04-10 14:58

Re: Contribute Source-Code?

#9 Post by schittli » 2014-05-03 22:57

Good evening

I finally had time to change the code. I have added the following files:
140427_trunk_CreateDirectoryAndEnterIt.zip
diff-File for the "Create directory and enter it" command
(3.06 KiB) Downloaded 260 times
This zip just contains the diff file.
140503_trunk_toolbar.zip
diff-File and the icons for the extended Toolbar
(13.32 KiB) Downloaded 195 times
This zip contains the diff file and the icons.

I like the concept of COptionChangeEventHandler.

Please let me know if the code is OK for you.

Kind regards,
Tom

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

Re: Contribute Source-Code?

#10 Post by botg » 2014-05-11 09:07

I've applied the create-and-enter patch with a few minor changes, mostly related to coding style to make it more in-line with the rest of the code.

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

Re: Contribute Source-Code?

#11 Post by botg » 2014-05-11 18:02

There are further problems with the toolbar patch:

You're passing the wrong type to several of the XRCCTRL macros, leading to crashes.

The new icons in the toolbar are tools, yet they serve no purpose as a tool. You may want to use wxStaticBitmap instead.

Post Reply