diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-02-08 18:06:06 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-02-09 05:48:58 +0100 |
commit | 2a7057250c8f73fdfb4c65a7525d17e9770459df (patch) | |
tree | 2fb8b54e2e00f731818041449362ec2163f908ad /uui/source/openlocked.cxx | |
parent | 7d56128654457bfc859217c23a957d1712fd6e1c (diff) |
tdf#108210: Allow to ignore a lock file if there's no filesystem lock
Two cases are handled: when a file is being opened, and when it was
opened read-only already, and one tries to reopen it in edit mode.
The option to ignore locking and open the file anyway is only offered
when there is no filesystem lock present on the file.
Change-Id: I377d3cae4c949ae64d449634acea8fb3f68a5700
Reviewed-on: https://gerrit.libreoffice.org/49448
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uui/source/openlocked.cxx')
-rw-r--r-- | uui/source/openlocked.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index 074242b964b8..3267610b78d1 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -21,7 +21,7 @@ #include "openlocked.hxx" #include <unotools/resmgr.hxx> -OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage ) : +OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage, bool bEnableOverride ) : MessBox(pParent, MessBoxStyle::NONE, 0, Translate::get(STR_OPENLOCKED_TITLE, rResLocale), aMessage ) @@ -30,13 +30,19 @@ OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& AddButton(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES, ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus); + SetButtonHelpText(RET_YES, OUString()); AddButton(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO); + SetButtonHelpText(RET_NO, OUString()); - AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel ); - SetButtonHelpText( RET_YES, OUString() ); - SetButtonHelpText( RET_NO, OUString() ); + if (bEnableOverride) + { + // Present option to ignore the (stale?) lock file and open the document + AddButton(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rResLocale), RET_IGNORE); + SetButtonHelpText(RET_IGNORE, OUString()); + } + AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel ); } OpenLockedQueryBox::~OpenLockedQueryBox() |