Rename function doesn't respect the selected file?

English support forum

Moderators: Stefan2, white, sheep, Hacker

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Rename function doesn't respect the selected file?

Post by *hiccup » 2018-05-15, 14:56 UTC

I want to perform a rename action on a selected file by means of a button in the buttonbar.

The problem is that the rename command doesn't seem to apply itself to the selected (highlighted) file, but whatever file in the pane the mousecursor was over last.

I can imagine that the command 'Rename file under cursor' would behave like that, but in my case the command 'RenameOnly' also doesn't stick to the selected file, but will also perform it's action on the file the mouse just happened to be over last.

Am I missing something here?

User avatar
HerbieH
Member
Member
Posts: 105
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH » 2018-05-15, 19:18 UTC

It seems that the to commands 'cm_RenameOnly' and 'cm_RenameSingleFile' has a bit unlogic action pattern.

If you select one file with the right mouse button and another with the left button, both commands works identically =only on the file, selected with the left button.

If you select TWO files with the right button and one file with the left, 'cm_RenameOnly' will work on the two right selected files, and NOT the file, selected with the left button.
'cm_RenameSingleFile' on the other hand will then work only with the left button selected file.

(TC 9.12 x64)

A bit odd, but I can live with it :)
HerbieH*
-Keep on makin' music!

User avatar
Dalai
Power Member
Power Member
Posts: 6674
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-15, 19:33 UTC

It doesn't matter how the files have been selected. cm_RenameSingleFile always operates on the focused file, not the selected ones. cm_RenameOnly operates on selected files (if any) or the focused file (no selection). I don't see any odd behavior there, also because cm_RenameSingleFile is described as "Rename file under cursor" and F5 & F6 operate the same way: on selection if any or selected file (no selection).

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
HerbieH
Member
Member
Posts: 105
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH » 2018-05-15, 19:44 UTC

The odd thing for me is, that there is the different behaviour of 'cm_RenameOnly' if you select either ONE or TWO files with the right button in combination with a third one on with the left button (=under cursor).
HerbieH*
-Keep on makin' music!

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Post by *hiccup » 2018-05-15, 19:49 UTC

The problem for me is this:

Suppose you have selected (right-clicked) a file somewhere in the middle of the panel.
Then you want to click a buttonbar you have setup for renaming.

When after selecting the file, you then move your mouse from the selected file towards the rename button and click it, you will find that TC wants to rename the file that just happened to be at the top of the list, since that was the last location where your mouse was in the path towards the button.
I find that very odd and inconvenient.

And to be honest it feels like a bug to me.
What is the use of selecting the file then?

User avatar
HerbieH
Member
Member
Posts: 105
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH » 2018-05-15, 20:06 UTC

To Hiccup.

I agree with you. 'cm_RenameOnly' should always work ONLY with the (right click) selected file(s).

An as explained it actually will, but only if you select two or more files. Therefore it could be considered as a bug, that it doesn't use the selected file, if only one file is selected with the right button- and another is left selected (=under the cursor.)

I think, you will NOT be able to make a button with 'cm_RenameOnly' that works to your satisfaction, until the behaviour of 'cm_RenameOnly' is changed.

PS: Perhaps a new command 'cm_RenameOnlySelected' was an idea :)
HerbieH*
-Keep on makin' music!

User avatar
Dalai
Power Member
Power Member
Posts: 6674
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-15, 20:14 UTC

2HerbieH
It's true that if one file is selected (marked) cm_RenameSingleFile and cm_RenameOnly behave the same, renaming the file under the cursor, not the selected/marked one. Apart from that unexpected behavior - that I call a bug - my statement above remains true.

One thing: please don't write something like "select files with the left mouse button", because that's ambiguous as it depends on where you click; if clicking on the file name only the cursor is moved, but clicking on the file icon marks/selects the file. It's better to refer to as selected or marked files vs. file under the cursor.

2hiccup
Do you use single-click mode to start programs? Did you set TC so that the cursor follows the mouse? The solution is simple, add 4 to SingleClick start option, as mentioned on the TC help:

Code: Select all

SingleClickStart=0
0: Double click starts programs (default)
1: A single click starts programs and opens files (Win98 WEB style)
2: A single click only opens folders. For files, a double click is needed
4 added: The text cursor no longer follows the mouse cursor
But, as I said: it's a bug that both commands behave the same with only one selected file.

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
HerbieH
Member
Member
Posts: 105
Joined: 2003-02-11, 10:04 UTC

Post by *HerbieH » 2018-05-15, 20:24 UTC

To Dalai.

Thanks for your advise about my 'selection/mouse click' semantics :)

I hope that mr. Ghisler fixes the behaviour of 'cm_RenameOnly'
HerbieH*
-Keep on makin' music!

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Post by *hiccup » 2018-05-15, 20:49 UTC

Dalai wrote: 1. Do you use single-click mode to start programs?
2. Did you set TC so that the cursor follows the mouse?
3. The solution is simple, add 4 to SingleClick start option, as mentioned on the TC help:

Code: Select all

SingleClickStart=0
0: Double click starts programs (default)
1: A single click starts programs and opens files (Win98 WEB style)
2: A single click only opens folders. For files, a double click is needed
4 added: The text cursor no longer follows the mouse cursor
Dalai
1. By means of Configuration>Operation I have checked "Open files and directories with a single click".
2. I have no idea where I can find "Cursor follows the mouse".
3. Not so simple for me ;-)
In wincmd.ini I have found the line "SingleClickStart=1"
What does "add 4" mean exactly?
1+4 makes 5?
Should I somehow add a line with '4'?
Should I replace the '=1' with '=4'?

User avatar
Dalai
Power Member
Power Member
Posts: 6674
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-15, 21:07 UTC

2hiccup
The quoted part is from TC help, section 4.b. To apply the value select menu Configuration > Change Settings Files Directly, search for SingleClickStart in the Notepad window that was opened, and set the value you want there. Which value you set is up to you.

Add 4 means that the sum depends on the other flags you want. Example: a value of 5 (1+4) means single-click start in Win98 WEB style and text cursor doesn't follow mouse cursor, and a value of 6 (2+4) means single-clicks tart only for folders and text cursor doesn't follow mouse cursor. Quite a number of TC settings are built up like this where you can enable/disable specific flags for a single setting. I hope that I explained it simple enough; if not, feel free to ask :).

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
tuska
Power Member
Power Member
Posts: 1544
Joined: 2007-05-21, 12:17 UTC

Re: Rename function doesn't respect the selected file?

Post by *tuska » 2018-05-15, 21:34 UTC

hiccup wrote:I want to perform a rename action on a selected file by means of a button in the buttonbar.

The problem is that the rename command doesn't seem to apply itself to the selected (highlighted) file,
but whatever file in the pane the mousecursor was over last.
1. Create a pattern for a rename: Menu "Files" - "Multi-Rename Tool... Ctrl+M" --> [Y]-[M]-[D]_[N] (<-- file name)
1.1 F2 Load/save settings -> Save settings, e.g. YYYY-MM-DD_Filename
2. Make a button with command: MULTIRENAME YYYY-MM-DD_Filename
3. Select one or more files
4. Press the button with command: MULTIRENAME YYYY-MM-DD_Filename

Only marked file(s) are proposed for renaming.

EDIT - Added: --> [Y]-[M]-[D]_[N] (<-- Rename mask: file name)
Last edited by tuska on 2018-05-15, 21:46 UTC, edited 1 time in total.

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Post by *hiccup » 2018-05-15, 21:38 UTC

Dalai wrote: Add 4 means that the sum depends on the other flags you want. Example: a value of 5 (1+4) means single-click start in Win98 WEB style and text cursor doesn't follow mouse cursor, and a value of 6 (2+4) means single-clicks tart only for folders and text cursor doesn't follow mouse cursor.
Dalai
Thanks for explaining this Dalai.
I wouldn't have figured out the current rather cryptic explanation myself.
"4 added" is quite ambiguous and a bit vague in my opinion. I was thinking that perhaps an =4 option had been added, or you should perhaps add a line containing "=4".

Something like this would have been clearer (to me):

1: A single click starts programs and opens files (Win98 WEB style)
2: A single click only opens folders. For files, a double click is needed
5: same as 1: except the text cursor no longer follows the mouse cursor
6: same as 2: except the text cursor no longer follows the mouse cursor

(and then, why not 3: and 4: instead of 5: and 6: ?)

Anyway, just venting and sharing my confusion as a newbie here ;-)

Most importantly, I do believe this indeed fixed the issue I was having, so thanks a lot for your insight and help!

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Re: Rename function doesn't respect the selected file?

Post by *hiccup » 2018-05-15, 21:40 UTC

tuska wrote: 1. Create a pattern for a rename: Menu "Files" - "Multi-Rename Tool... Ctrl+M"
1.1 F2 Load/save settings -> Save settings, e.g. YYYY-MM-DD_Filename
2. Make a button with command: MULTIRENAME YYYY-MM-DD_Filename
3. Select one or more files
4. Press the button with command: MULTIRENAME YYYY-MM-DD_Filename
Only marked file(s) are proposed for renaming.
Thanks tuska, but my eyes are square and my brain is mushy right now.
I'll study your proposal soon.
Cheers!

User avatar
Dalai
Power Member
Power Member
Posts: 6674
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-05-15, 21:51 UTC

hiccup wrote:Something like this would have been clearer (to me):

1: A single click starts programs and opens files (Win98 WEB style)
2: A single click only opens folders. For files, a double click is needed
5: same as 1: except the text cursor no longer follows the mouse cursor
6: same as 2: except the text cursor no longer follows the mouse cursor
Maybe it would've been clearer, but imagine that there's more flags in the same setting, like 8, 16, 32 and so on. Writing down all possible combinations/sums is quite cumbersome and error-prone.
(and then, why not 3: and 4: instead of 5: and 6: ?)
Simple: they're flags that are either enabled or disabled, i.e. 1 or 0 - commonly called binary. If you rewrite a decimal number like 5 into binary it becomes 101 which means that two flags are enabled (1) and one is disabled (0). You can't use that same mechanism when using sequential decimal numbers because the flags would not be clear without ambiguity.

Adding 4 sets the flag at the third position from the right to 1, enabling it, but leaving all other flags alone regardless of their flag value. Subtracting 4 disables the flag the same way.

Again, I hope I explained it correct as well as simple enough to understand :).

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

hiccup
Junior Member
Junior Member
Posts: 63
Joined: 2018-05-13, 08:04 UTC

Re: Rename function doesn't respect the selected file?

Post by *hiccup » 2018-05-16, 07:57 UTC

tuska wrote: 1. Create a pattern for a rename: Menu "Files" - "Multi-Rename Tool... Ctrl+M"
1.1 F2 Load/save settings -> Save settings, e.g. YYYY-MM-DD_Filename
2. Make a button with command: MULTIRENAME YYYY-MM-DD_Filename
3. Select one or more files
4. Press the button with command: MULTIRENAME YYYY-MM-DD_Filename
Only marked file(s) are proposed for renaming.
That's a feature I could certainly have some use for.
Thanks for pointing me at it Tuska.

But it is not related to the issue I raised, and in hindsight, the cause of the issue I experienced was that by default TC has "text cursor follows mouse cursor" enbled.
Disabling that solved my problem.

Post Reply