Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace not enabled #709

Closed
mdell-seradex opened this issue Jul 19, 2022 · 8 comments
Closed

Replace not enabled #709

mdell-seradex opened this issue Jul 19, 2022 · 8 comments

Comments

@mdell-seradex
Copy link

I can't seem to get Replace to work when doing a text search. I did not try any other types as yet.
I tried entering the "Replace" text before I performed the Search, and after.
I even closed dngrep with the "Replace" not filled in, re-opened it, performed the search, and then entered the replace text.

No matter what I have tried, it will not enable the Replace button.

@mdell-seradex
Copy link
Author

I just tried regex.
It doesn't work either.

@mdell-seradex
Copy link
Author

I just found out, the files are marked as read-only.
I guess there is no built-in method to enable over-writting those.

@doug24
Copy link
Contributor

doug24 commented Jul 19, 2022

My feeling is the application should respect the read-only state of the file. It could have been set that way for endless reasons. If you want to modify it, then change the state.

Between this and the other recent request to modify files without changing the modified date, you could modify a read-only file, reset the modified date and change it back to read-only - and no one would know the file had been changed. Maybe I'm imposing my opinion too much, but this just doesn't sound like the behavior of a good application.

@mdell-seradex
Copy link
Author

mdell-seradex commented Jul 19, 2022

I didn't realize the files were marked as read-only at the time.
Generally speaking I would agree with you, however it would be nice if it showed that somewhere, and allowed us to decide to override the read-only flag.
I don't think overriding that flag should ever be automatic. If it were a prompt, it should occur for each set of files being replaced, and NOT have a permanent override option, in my opinion.

@doug24
Copy link
Contributor

doug24 commented Jul 19, 2022

The results list does show you files that are read only.

If all the results are read only or if you are mixing regular expressions with Boolean operators (dnGrep cannot do replace in this combination), then the replace button is inactive. I admit may not be obvious why it is disabled.

If some are read only and some are writable, when you click the Replace button a message box says "Some of the files cannot be modified. If you continue, these files will be skipped".

In addition to the operating system flag, files may be marked read-only because dnGrep is not able to modify binary files, files in archives, or document files (PDF, Word, Excel, PowerPoint). So, we would be in the state where you could override read only for some files, but not all files.

@mdell-seradex
Copy link
Author

mdell-seradex commented Jul 19, 2022

OMG. I'm blind.

Also, you are correct, that we could only override for the flag, not for permissions.

@mdell-seradex
Copy link
Author

As always, I leave this for you to decide what to do.

One thing I have done in the past is to put a tooltip to describe this when applicable.
It is a little difficult putting it on a disabled control, but I think what I did was to put it in a frame and put the tool tip on the frame.

@doug24
Copy link
Contributor

doug24 commented Aug 20, 2022

Added in release v3.0.136

@doug24 doug24 closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants