From 0f9599b687c10f3887c8cc5f419278aa4375889a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 5 Jul 2019 17:56:38 +1000 Subject: Show who has locked the document when reopening a read-only document Pass the locking data from SfxMedium::LockOrigFileOnDemand, to allow clients to show it themselves when required. Change-Id: I6afe46a1896e1b60771c080efa2f58794dbed8a6 Reviewed-on: https://gerrit.libreoffice.org/75113 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/sfx2/docfile.hxx | 3 ++- include/sfx2/strings.hrc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include/sfx2') diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index 77950a473197..c5fc22c511bb 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -166,7 +166,8 @@ public: FailedLockFile, // there was only lock file that prevented success - no syslock or IO error Succeeded, }; - LockFileResult LockOrigFileOnDemand( bool bLoading, bool bNoUI, bool bTryIgnoreLockFile = false ); + LockFileResult LockOrigFileOnDemand(bool bLoading, bool bNoUI, bool bTryIgnoreLockFile = false, + LockFileEntry* pLockData = nullptr); void DisableUnlockWebDAV( bool bDisableUnlockWebDAV = true ); void UnlockFile( bool bReleaseLockStream ); /// Lets Transfer_Impl() not fsync the output file. diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index 98e547d2b515..96883a2384b0 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -238,7 +238,8 @@ #define STR_ERROR_SEND_MAIL_CODE NC_("STR_ERROR_SEND_MAIL_CODE", "An error occurred in sending the message. Possible errors could be a missing user account or a defective setup.\n\nError code is $1") #define STR_ERROR_SEND_MAIL_HEADER NC_("STR_ERROR_SEND_MAIL_HEADER", "Error sending mail") #define STR_QUERY_OPENASTEMPLATE NC_("STR_QUERY_OPENASTEMPLATE", "This document cannot be edited, possibly due to missing access rights. Do you want to edit a copy of the document?") -#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "This document cannot be edited, because it is locked in another session. Do you want to edit a copy of the document?\n\nYou can also try to ignore the lock and open the file for editing.") +#define STR_QUERY_OPENASTEMPLATE_LOCKED NC_("STR_QUERY_OPENASTEMPLATE_LOCKED", "This document cannot be edited, because it is locked in another session.%LOCKINFO\nDo you want to edit a copy of the document?") +#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "You can also try to ignore the lock and open the file for editing.") #define STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN NC_("STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN", "Open ~Copy") #define STR_QUERY_OPENASTEMPLATE_OPEN_BTN NC_("STR_QUERY_OPENASTEMPLATE_OPEN_BTN", "~Open") #define STR_REPAIREDDOCUMENT NC_("STR_REPAIREDDOCUMENT", " (repaired document)") -- cgit