When a new directory created, focus the new directory in listviews
|Reported by:||dudu||Owned by:|
|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()