masneyb / gftp

gFTP is a free multithreaded file transfer client for *NIX based machines. 56 language translations available.
http://www.gftp.org
MIT License
116 stars 21 forks source link

Imported wdlkmpx GtkTreeView Transfer Window implementation #161

Closed sedwards closed 1 year ago

sedwards commented 1 year ago

This imports your work and leaves the existing gtk2 code in place until we can complete the migration to GtkTreeView.

NOTE: This patch also only contains your code and what minor modifications I had to make to get it to work, not all of my various garbage, as it is implied that your patch is only for gtk3 but the rest of the gtk3 work is nowhere near ready to go in.

My idea was to take what work you did, get it working on GTK3 and then backport it to GTK2 and then we can dump the old clist/ctree code.

wdlkmpx commented 1 year ago

I see a few issues, I'll edit this PR

wdlkmpx commented 1 year ago

I fixed issues introduced by the PR, it might be ready to merge.

Something possibly unrelated happened while I was testing

I limited the transfer speed, and I was trying to resize the filename tab, and this happened:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gftp-gtk: xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted
sedwards commented 1 year ago

I think it would be easier to read and for us to implement if we broke this in to two different commits and then we could make it easy to test and switch back and forth. So like this:

  1. First, I'll submit a PR where we just commit the horrid #ifdef's so the clist/ctree stuff is disabled on GTK3 but can be enabled with a #define in gftp-gtk.h like NEW_GTK_TREEVIEW. I'll send a patch that isolates all the old code with something like

if defined(GTK_MAJOR_VERSION == 2) && !defined(NEW_GTK_TREEVIEW)

(dunno if this works or not)

  1. Next I'll merge in the GTK Treeview Commit with changes you've pushed in here as a separate PR.

So by default NEW_GTK_TREEVIEW will be disabled. Since it might take a while for us to fully implement this do you think we ought to also add a configure switch like --enable-new-treeview or something?

wdlkmpx commented 1 year ago

Maybe define TRANSFER_GTK_TREEVIEW in gftp-gtk.h

Something like this:

// uncomment #if.. #endif 
#if GTK_MAJOR_VERSION > 2
#define TRANSFER_GTK_TREEVIEW 1
#endif

I'll push a commit in a few minutes

wdlkmpx commented 1 year ago

So it's possible to comment out 2 lines in gftp-gtk.h to force using a gtktreeview in the transfer "window"

Hmm I'll merge it now, there are other changes to apply

Now, there are technical difficulties to overcome in order to make the treeview work as expected. I was planning to add a status bar and so on, but it never happened

wdlkmpx commented 1 year ago

I fixed compilation with gtk3 but I see the "log window" eats all the space and must be resized in order to see the other "windows"

The new file transfer "window" was meant to be a simple list with a progress bar and an icon representing download/upload, transfer info, remote location.

The global info was meant to be in the status bar, the ability to remember unfinished downloads was planned. Problem is, stuff has to be redesigned and the gtk guru level must be increased

In the past I certainly wrote a lot about my plans and rants, the evil organization that must be destroyed, etc..