This is an "Easy" Hack for somebody who likes more advanced hacking ;-)
When you open a document that is already open by a different user, you get a warning like "Document file '$(ARG1)' is locked for editing by:" (see STR_OPENLOCKED_MSG in uui/source/openlocked.src). You have the choice to open it read-only, or a copy. In case of opening it read-only, it would be great to get a notification when the document has been closed by the other person again.
The dialog is effectively created in sfx2/source/doc/docfile.cxx, SfxMedium::ShowLockedDocumentDialog(). In the case that it is opened read-only, you should trigger a thread that will wake up every minute, and check for the presence of the lock file. If the lock file disappeared, it should create a notification dialog that the file is not in use any more; if possible, with an offer a reload of the file.
This feature seems really interesting and I would like to give it a try as a first easy (but interesting) hack.
Let me know if you have some advices or objections,
I start to try this bug. I debug the code to see where is more appropriated to start the thread. I think the SfxMedium::ShowLockedDocumentDialog is inappropriate place to do it. This function only show the user dialog and return the user choose, right?
The function SfxMedium::LockOrigFileOnDemand is appropriated?
The LibreOffice has some own thread API or can I use pthread.h API?
Today I back to work in this bug. I tried but I could not simulate this bug on version 126.96.36.199.alpha1.
When I open the same file with second instance of writer, any message is showed. Is the right behavior?
Please, desconsidere my last comment
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.
see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
ASSIGNED->NEW: No change since 2013 apparently ...
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp TopicUI)
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC)
Assigning to myself. Will also implement Windows specific behavior for detecting security permissions changes.
Matt K committed a patch related to this issue.
It has been pushed to "master":
tdf#47065 Add new file open UI options and implement a new thread
It will be available in 7.2.0.
The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
Cannot open any of my LibreOffice files & documents. Locked out since May 15.
Please help. Please do not send a bible to read through to solve the problem.
(In reply to jcorrerocaballo from comment #12)
> Cannot open any of my LibreOffice files & documents. Locked out since May 15.
> Please help. Please do not send a bible to read through to solve the
> Jay Lindley
Please ask for help in the user support forum: https://ask.libreoffice.org/
I encountered this dialog for the first time today after installing 7.2RC2. Without commenting on the merits of the idea, I find the implementation problematic. The problem is that every time I open an attachment from an email (something that happens several times a day), I now have a new dialog to click through before opening the file - and that extra click serves absolutely no purpose whatsoever, because I still have to active editing once the file opens (if I need it).
Is there a way to bypass or deactivate the new dialog for those of us who do not need this feature? I never open a read-only file that is in use elsewhere - it is always read-only because of the storage location (using Linux), and I can easily activate editing and save elsewhere if I need to using the existing systems.
Matt, haven't seen the dialog (a bit confused by the fact that this ticket request information when the locked file becomes unlocked) but how about a "[ ] Don't show again" checkbox?
(In reply to Heiko Tietze from comment #15)
I think this can be improved. If a file is initally read-only, it is not likely that it will be available for editing later. It is only possible to be edited only if it is "locked" at the time of openning.
I think initially read-only is different from been locked for a file?
I'm looking into addressing this in Bug 143971.
(In reply to Matt K from comment #18)
> I'm looking into addressing this in Bug 143971.
This is now fixed with https://git.libreoffice.org/core/+/f9ab31366dbe466ef739015734bb5b6a1a0deca4%5E%21
Thank you. I can confirm that the fix works for me in the latest daily build - no more dialog pop-up from a read-only location.