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

feat: toggle "read only" attribute to modify read only file or lock modification to file #636

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

soumyamahunt
Copy link
Contributor

@soumyamahunt soumyamahunt commented Aug 2, 2020

This pr aims to implement modifying files with readonly attribute.

PR Type

What kind of change does this PR introduce?

  • Feature

Other information

While Windows Notepad doesn't allow modifying files with readonly attribute, Notepad++ allows editing them once this flag is removed.

@soumyamahunt soumyamahunt marked this pull request as draft August 2, 2020 04:40
@soumyamahunt
Copy link
Contributor Author

@Jasonstein Notepad++ doesn't allow editing readonly files by default, but after removing readonly flag it allows editing and user than can save the file. Should we implement this behavior?? Or, should we prompt user when trying to save a readonly file and if user accepts remove the readonly attribute??

@soumyamahunt
Copy link
Contributor Author

soumyamahunt commented Aug 2, 2020

@Jasonstein this is the behavior I have come up with for editing normal vs read-only files:

Normal

Read-Only

ApplicationFrameHost_a9vdeKJHlh ApplicationFrameHost_7Ho0hOMPrl
ApplicationFrameHost_L8tJ5ic4tW ApplicationFrameHost_U98Fk7JAP8
ApplicationFrameHost_slyQ40nEgE ApplicationFrameHost_EJPpQZGQTA
ApplicationFrameHost_rwcf7wkwAS ApplicationFrameHost_SB2YD43fe4

@soumyamahunt soumyamahunt marked this pull request as ready for review August 2, 2020 09:57
@0x7c13
Copy link
Owner

0x7c13 commented Aug 2, 2020

Two cents:

  1. Display a lock icon right after the path indicator so it is more intuitive.
  2. Whenever user changes any text or add/delete any text, show normal notification saying that "File is read-only!". Let user change the attribute of the file so we do not need to implement anything.

Btw, how could you import those win32 dlls? Will they work in production? What about future compatibility with Windows 10x?

@soumyamahunt
Copy link
Contributor Author

  1. Display a lock icon right after the path indicator so it is more intuitive.

Will do that.

  1. Whenever user changes any text or add/delete any text, show normal notification saying that "File is read-only!". Let user change the attribute of the file so we do not need to implement anything.

Wouldn't displaying notification be too intrusive?? Currently I am showing the modified icon in the tab in grey/disabled color when file is read only.

Btw, how could you import those win32 dlls? Will they work in production? What about future compatibility with Windows 10x?

..FromApp methods are made with uwp security model so they will work in production and there won't be any future incompatibility.

@0x7c13
Copy link
Owner

0x7c13 commented Aug 2, 2020

  1. Display a lock icon right after the path indicator so it is more intuitive.

Will do that.

  1. Whenever user changes any text or add/delete any text, show normal notification saying that "File is read-only!". Let user change the attribute of the file so we do not need to implement anything.

Wouldn't displaying notification be too intrusive?? Currently I am showing the modified icon in the tab in grey/disabled color when file is read only.

Btw, how could you import those win32 dlls? Will they work in production? What about future compatibility with Windows 10x?

..FromApp methods are made with uwp security model so they will work in production and there won't be any future incompatibility.

What about the file that user dragged into notepads? (They are read-only to notepads but they do not have read-only attribute)

@soumyamahunt
Copy link
Contributor Author

What about the file that user dragged into notepads? (They are read-only to notepads but they do not have read-only attribute)

They would work like normal files. None of the StorageFile annoyances apply to ..FromApp methods.

@soumyamahunt
Copy link
Contributor Author

@Jasonstein I have modified the behavior as you said:

Normal

Read-Only

ApplicationFrameHost_a9vdeKJHlh ApplicationFrameHost_iVJ6G9BoYg
ApplicationFrameHost_L8tJ5ic4tW ApplicationFrameHost_c5d036RQms
ApplicationFrameHost_slyQ40nEgE ApplicationFrameHost_6WSOc2ApVE
ApplicationFrameHost_rwcf7wkwAS ApplicationFrameHost_R8L6V8oJnq

@soumyamahunt soumyamahunt changed the title Implement modifying files with readonly attribute feat: Toggle "read only" attribute and modify read only file Mar 29, 2021
@soumyamahunt soumyamahunt changed the title feat: Toggle "read only" attribute and modify read only file feat: toggle "read only" attribute to modify read only file or lock modification to file Apr 18, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants