[TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

(This doesn't occur when using TC 32-bit)

(* Enable UAC if not enabled)
* Start TC 64-bit (restart if TC is already running)
* Go to a drive which needs admin right to change the volume label (normally your internal hard drive)
* Select menu Commands/Volume Label...
* Change the text of the volume label
* Click OK
* The error "Access denied on file" is displayed. Click "As administrator"
* The UAC message pops up asking for permission for the app to make changes to the system.
* Click "Yes" and quickly press the Esc key.
The volume label of the drive is changed, but the volume label displayed above the file panel is not changed.

Instead of pressing Esc, you can also click Cancel in the Set volume label dialog. You can easily test that by positioning the mouse cursor over the Cancel button, use the keyboard to confirm the volume label change and enable admin rights, click the Cancel button.

When you click the OK button this way you get 2 extra dialogs, one of which is never in dark mode. Screenshot

In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

Not confirmed. I hammered on the ESC button like a fool after confirming the UAC dialog, but the label was re-read every time I tried.
Maybe it's a timing problem, but it sounds like you are dismissing the dialog with ESC, so TC only sees that you clicked cancel and doesn't re-read the label.
In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
I can try disabling the Cancel button while asking for elevation, but I see this as a minor problem.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

ghisler(Author) wrote: 2023-10-26, 09:26 UTC Not confirmed. I hammered on the ESC button like a fool after confirming the UAC dialog...
Video please :P
ghisler(Author) wrote: 2023-10-26, 09:26 UTC Maybe it's a timing problem, but it sounds like you are dismissing the dialog with ESC, so TC only sees that you clicked cancel and doesn't re-read the label.
Correct, that seems to happen.
ghisler(Author) wrote: 2023-10-26, 09:26 UTC
In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
I can try disabling the Cancel button while asking for elevation, but I see this as a minor problem.
Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.
OK, I will add that too.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

history.txt wrote: 26.10.23 Fixed: Commands - Volume label: Disable Cancel button while asking for administrative rights (32/64)
Tested OK using TC 11.02rc5 64-bit, the label is now always re-loaded.
The changelog mentions 32-bit as well, but 32-bit TC didn't have a problem.
ghisler(Author) wrote: 2023-10-26, 09:58 UTC
Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.
OK, I will add that too.
Doesn't seem to be added, or the check for the flag is not done for the OK button. When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice, I still get this:
white wrote: 2023-10-25, 18:12 UTC When you click the OK button this way you get 2 extra dialogs, one of which is never in dark mode. Screenshot
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice
How do you do that? I cannot press Enter or click OK while the UAC dialog is up.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

ghisler(Author) wrote: 2023-10-30, 13:56 UTC
When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice
How do you do that? I cannot press Enter or click OK while the UAC dialog is up.
First Enter closes the UAC dialog. Second Enter activates the OK button.
So, it is not when the UAC dialog is up, but right after it was closed. Sorry, if that was not clear.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

I see - that's not what I added when I confirmed "Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.". I now set a flag (ok clicked) when the user clicks on OK, so when he later sends cancel, it is still interpreted as OK.
What you describe here is trying to close the dialog again with OK when it has already been closed. The only way to prevent this is to disable the OK button too, just like the cancel button.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

ghisler(Author) wrote: 2023-10-30, 14:22 UTC I see - that's not what I added when I confirmed "Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.". I now set a flag (ok clicked) when the user clicks on OK, so when he later sends cancel, it is still interpreted as OK.
What you describe here is trying to close the dialog again with OK when it has already been closed. The only way to prevent this is to disable the OK button too, just like the cancel button.
That certainly would do it. But why isn't it possible when OK is activated a second time to check the flag (ok clicked) and do nothing?
Out of curiosity: why does this only happen with 64-bit TC? Is this a Lazarus thing?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

I don't know why it only happens in 64-bit. What happens is that TC gets a second "OK" event after the close event was already sent, so it tries to close the dialog box twice (which results in the white error message).
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

ghisler(Author) wrote: 2023-10-31, 08:22 UTC What happens is that TC gets a second "OK" event after the close event was already sent, so it tries to close the dialog box twice (which results in the white error message).
Can't you simply cancel the closing the second time around using the OnCloseQuery event?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

No, that doesn't seem to work, but setting the OnClick event of the OK button to nil seems to work.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *ghisler(Author) »

This should be fixed in RC6, please test it!
30.10.23 Fixed: Commands - Volume label: Disable OK button while asking for administrative rights (32/64)
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label

Post by *white »

Tested OK using TC 11.02rc6 32-bit and 64-bit.

Moderator message from: white » 2023-11-06, 16:03 UTC

Moved to Fixed bugs forum.
Post Reply