Opened 11 years ago

Last modified 9 years ago

#8406 new Patch

When a new directory created, focus the new directory in listviews

Reported by: dudu Owned by:
Priority: normal Component: FileZilla Client
Keywords: Cc: dudu
Component version: Operating system type:
Operating system version:


When a new directory created, filezilla refreshes the corresponding local or remote listview and leaves the focus where it was before. I think it should set the focus to the newly created directory since the user most likely will want to go in that directory.

The attached patch implements this behaviour for both the local and the remote listviews, also it adds the [ctrl]+[shift]+[n] keyboard shortcut for the "New Directory" menu item (does the same thing in windows explorer or nautilus and Thunar on linux).

The remote side implemented extending the facilities added in r4868 with setters and a new conditional. Maybe these functions/member variables need a new name.
Since i'm not 100% sure on the remote side's implementation, i'm attaching a patch only for the local side and the keyboard shortcuts.

On my system, i couldn't compile a clean r4872, compile failed with:

src/interface/listctrlex.cpp:1179 col 36: error: passing ‘const wxListCtrlEx’ as ‘this’ argument of ‘wxScrolledWindow* wxListCtrlEx::GetMainWindow()’ discards qualifiers [-fpermissive]

This can be fixed easily enough with a cons_cast<> like this:

-    wxRect windowRect = GetMainWindow()->GetClientRect();
+    wxRect windowRect = const_cast<wxListCtrlEx*>(this)->GetMainWindow()->GetClientRect()

Attachments (2)

focus_newly_created_directory_local_only.patch (4.2 KB ) - added by dudu 11 years ago.
Patch implementing the ticket, only on the local side
focus_newly_created_directory.patch (5.8 KB ) - added by dudu 9 years ago.
focus after mkdir patch re-done with full paths and parent checks

Download all attachments as: .zip

Change History (6)

by dudu, 11 years ago

Patch implementing the ticket, only on the local side

comment:1 by Tim Kosse, 9 years ago

Status: newmoreinfo

Thanks, I've applied the Ctrl+Shift+N part.

Unfortunately the highlighting isn't quite right. It is possible to enter relative paths. Just taking and highlighting the last segment of the path can highlight the wrong directory. You need to check that the rest of the new path matches the currently displayed path.

Could you please update the patch?

comment:2 by dudu, 9 years ago

Thanks for the reply!
I'll try to prepare a new patch against the current trunk, however sadly i can't promise an ETA now.
I'm not sure if this is the right place, but the ./ seems to be missing from trunk. I've grabbed it from the 3.3.5-rc1 svn tag and it seemed to be run fine.

comment:3 by Tim Kosse, 9 years ago

To (re)generate configure, you can use the standard autoreconf tool:

autoreconf -i

by dudu, 9 years ago

focus after mkdir patch re-done with full paths and parent checks

comment:4 by dudu, 9 years ago

Status: moreinfonew

I've updated the focus_newly_created_directory.patch file.
Now it uses full paths for the previously focused directories and explicitly checks parent directories before using those for focusing (not just when creating new directories but when going up a level).
This should make it more robust against jumping around multiple levels.

I've also removed the ClearPreviouslyVisitedRemoteSubdir() and ClearPreviouslyVisitedLocalSubdir() nothing seemed to be using them.

Note: See TracTickets for help on using tickets.