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 Fri, Aug 2, 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.Fri, Aug 2, 12:59 PM
asensi created this revision.
abika requested changes to this revision.Sun, Aug 4, 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.Sun, Aug 4, 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 :-?