If an item that is going to be renamed is also going to be hidden by default, then warn the user
Needs RevisionPublic

Authored by asensi on Aug 2 2019, 12:59 PM.

Details

Reviewers
abika
Group Reviewers
Krusader
Summary

Sometimes users stop seeing a file just because they unintentionally add a dot at the beginning of the name of that file.

Dolphin users had it solved in https://phabricator.kde.org/D15980, in Krusader I tried adding a confirmation dialog, although there is a drawback: after the renaming, if the confirmation dialog has been shown, then the focus is moved (that can be checked e.g. moving the up arrow key). Perhaps someone can solve that easily.

Test Plan

Rename a file whose name doesn't begin with a dot.
Rename a file whose name begins with a dot.

Rename having selected more than one file.

Rename having enabled "View > Show Hidden Files".
Rename having disabled "View > Show Hidden Files".

Rename using Default view and Brief view
(Note: That's because void KrInterDetailedView::renameCurrentItem() exists, but also void KrInterBriefView::renameCurrentItem())

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
asensi requested review of this revision.Aug 2 2019, 12:59 PM
asensi created this revision.
abika requested changes to this revision.Aug 4 2019, 4:03 PM
abika added a subscriber: abika.

I'm unsure about this. In contrast to Dolphin the target audience of Krusader are more advanced users. We should have more confidence in them imo. On the other hand a confirmation doesn't hurt...

But I would like to demand at least adding a "dontAskAgainName" argument to the KMessageBox::warningContinueCancel call.
And only showing the dialog if the "Show hidden files" option is not checked is also my preference.

This revision now requires changes to proceed.Aug 4 2019, 4:03 PM

the target audience of Krusader are more advanced users

I would like to comment that I started using Krusader when I started using Linux, although I wasn't an advanced Linux user (but I was used to the Norton/Midnight/Total Commander style of doing things). For me working a lot with Krusader was easier than e.g. with Konqueror, though I understand what you mean, new users usually start using e.g. Dolphin.

But I would like to demand at least adding a "dontAskAgainName" argument to the KMessageBox::warningContinueCancel call.

I thought about it, and I considered that putting a dot in front of a file is such an uncommon operation that instead of getting into the issues of saved options, establishing means to disable/enable the preference if the user changes his mind, and maintaining all the related stuff in the future, we'd be better using our resources to solve other problems. But other alternatives can be considered.

And only showing the dialog if the "Show hidden files" option is not checked is also my preference.

I also thought about it, although as I considered that putting a dot in front of a file is such an uncommon operation, then asking for a confirmation would stop some cases where e.g. the user accidentally "hides" files to other coworkers :-(, or to himself when he later uses e.g. the dialog of Libreoffice to browse a folder and open a file :-?

asensi added a comment.Sun, Sep 1, 6:53 PM

Kindly ping

abika added a comment.Sun, Sep 15, 6:40 PM

Sorry, but not being able to have a way to disable the warning message is not acceptable for me. There may be users who do this renaming very often to filter folders in their list view.
Dolphin has the option to disable it, Krusader should have it too.

I guess we need a third opinion...

nmel added a subscriber: nmel.Mon, Sep 16, 4:24 AM

3rd opinion. I agree it should be shown only if the file is actually going to be hidden (Show Hidden is off in settings), otherwise Krusader looks dumb. I agree that users should be able to disable the warning, because for us it may look like an uncommon operation, however some users may work with dot files extensively. This kind of attention to small details make a huge difference in user experience.

krusader/Panel/panelfunc.cpp
645

Q_OS_WIN