Opened 7 years ago

Last modified 5 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:

Description

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.

Sidenote:
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 7 years ago.
Patch implementing the ticket, only on the local side
focus_newly_created_directory.patch (5.8 KB) - added by dudu 5 years ago.
focus after mkdir patch re-done with full paths and parent checks

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by dudu

Patch implementing the ticket, only on the local side

comment:1 Changed 5 years ago by Tim Kosse

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 Changed 5 years ago by dudu

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 ./autogen.sh 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 Changed 5 years ago by Tim Kosse

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

autoreconf -i

Changed 5 years ago by dudu

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

comment:4 Changed 5 years ago by dudu

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.