Page 1 of 1

Option to rename entire file by default

Posted: Mon Jan 03, 2011 2:10 pm
by twinsen
When renaming a file you can press F2 to cycle renaming the filename only, extension only or both. But selecting filename without extension is the default. I often use renaming to copy the entire filename, so I want with the extension the default.

Could there be an option to change between initially selecting the file part or the entire file with extension?

At the moment I've just done this to get the desired behaviour:

In:
explorer++_1.2_src\Explorer++\Explorer++\ListViewHandler.cpp

Code: Select all

BOOL CContainer::OnListViewBeginLabelEdit(LPARAM lParam)
Change:

Code: Select all

	m_ListViewEditingStage = LISTVIEW_RENAME_FILENAME;
To:

Code: Select all

	m_ListViewEditingStage = LISTVIEW_RENAME_ENTIRE;
In

Code: Select all

CContainer::ListViewEditProc
Change

Code: Select all

					if(bExtensionFound)
					{
						wParam = 0;
						lParam = i;
					}
To:

Code: Select all

					if(bExtensionFound && m_ListViewEditingStage == LISTVIEW_RENAME_FILENAME)
					{
						wParam = 0;
						lParam = i;
					}

Re: Option to rename entire file by default

Posted: Mon Jan 03, 2011 3:59 pm
by ajs
Hi twinsen,
I didn't know about the "cycling renaming" pressing F2 multiple times. Thanks.

Related to your request, what about this idea:
1) pressing F2 keeps working as it is now
2) pressing Shift-F2 will select the full filename+extension, which is what you want.

If you like it, I will implement that as soon as David has merged all the pending patches.

Re: Option to rename entire file by default

Posted: Mon Jan 03, 2011 6:52 pm
by twinsen
I'd rather just a groupbox "initial renaming selection", with radio buttons "entire file", "file name only" in options and the value saved.
F2 can work exactly as it currently does.

I just want clicking a file to work like windows explorer does, without having to press F2 or shift F2. So clicking the "entire file" radio button would make it work like I expect (and I can still use F2).

It should be fairly trivial to make the gui change the value of m_ListViewEditingStage for the initial selection. But it might be best to wait for all the other changes to be merged first.

Re: Option to rename entire file by default

Posted: Mon Jan 03, 2011 9:34 pm
by ajs
ok, i got your point. I will do two things:
1) add a radio button or checkbox for "initial renaming selection" (full or name only) as you suggested, keeping F2 functionality as it is.
2) implement the Shift-F2 key to do the other action.
Sometimes I need full selection, sometimes only the name, so having both options available on the same key would be good I think.

Re: Option to rename entire file by default

Posted: Tue Jan 04, 2011 2:26 am
by neminem
I like it, for the record (I agree, sometimes I like the default file rename action, and sometimes it bugs me, so having both available with different keybindings would be optimal. The ability to set which is plain-f2 is good, too).

Re: Option to rename entire file by default

Posted: Sun Jan 09, 2011 11:17 pm
by ajs