summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorMatt K <mattkse@gmail.com>2021-02-26 10:24:38 -0600
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-27 12:31:38 +0200
commit95eb088802562b75f8b299908160145c7e88d763 (patch)
treedbabada569f125ca900906463a697b1e606dbae5 /uui
parentee1407608c0d228e4705215e9700af3200511cc8 (diff)
tdf#47065 Add new file open UI options and implement a new thread
Add new UI options when opening a locked or non-writeable document to allow the user to be notified when such a document becomes editable . If the user selects "Notify", then that document is added to a list of open documents to be checked by a thread every 60 seconds for read/write access and whether lock file is available/obtainable. If access is allowed for a document, then show UI dialog to the user asking to Reload that document. If Reload is selected by the user then that document is reloaded with read/write access. The checking thread is spawned only once no matter how many "Notify" documents there are. The thread is spawned if not already running when a new "Notify" document is opened, and it terminates when all "Notify" documents have been closed or the application terminates. Also update badstatics clang plugin to ignore new global variables introduced. Change-Id: I7555ce6f5df79c2c87216e0129ef3b2883c7d921 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111654 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uui')
-rw-r--r--uui/Library_uui.mk2
-rw-r--r--uui/inc/strings.hrc21
-rw-r--r--uui/source/alreadyopen.cxx1
-rw-r--r--uui/source/iahndl-locking.cxx104
-rw-r--r--uui/source/iahndl.cxx6
-rw-r--r--uui/source/iahndl.hxx6
-rw-r--r--uui/source/lockcorrupt.cxx1
-rw-r--r--uui/source/lockfailed.cxx1
-rw-r--r--uui/source/openlocked.cxx1
-rw-r--r--uui/source/readonlyopen.cxx38
-rw-r--r--uui/source/readonlyopen.hxx35
-rw-r--r--uui/source/reloadeditable.cxx37
-rw-r--r--uui/source/reloadeditable.hxx35
13 files changed, 282 insertions, 6 deletions
diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk
index 4daad8403dcb..4f664ac20dba 100644
--- a/uui/Library_uui.mk
+++ b/uui/Library_uui.mk
@@ -62,6 +62,8 @@ $(eval $(call gb_Library_add_exception_objects,uui,\
uui/source/openlocked \
uui/source/passwordcontainer \
uui/source/passworddlg \
+ uui/source/readonlyopen \
+ uui/source/reloadeditable \
uui/source/requeststringresolver \
uui/source/secmacrowarnings \
uui/source/sslwarndlg \
diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc
index 364175298db7..096d7ef977a1 100644
--- a/uui/inc/strings.hrc
+++ b/uui/inc/strings.hrc
@@ -30,8 +30,9 @@
#define STR_PASSWORD_MISMATCH NC_("STR_PASSWORD_MISMATCH", "The confirmation password did not match the password. Set the password again by entering the same password in both boxes.")
#define STR_ALREADYOPEN_TITLE NC_("STR_ALREADYOPEN_TITLE", "Document in Use")
-#define STR_ALREADYOPEN_MSG NC_("STR_ALREADYOPEN_MSG", "Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nOpen document read-only, or ignore own file locking and open the document for editing.")
+#define STR_ALREADYOPEN_MSG NC_("STR_ALREADYOPEN_MSG", "Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nOpen document read-only, or ignore own file locking and open the document for editing.\nSelect Notify to open read-only and get notified when the document becomes editable.")
#define STR_ALREADYOPEN_READONLY_BTN NC_("STR_ALREADYOPEN_READONLY_BTN", "Open ~Read-Only")
+#define STR_ALREADYOPEN_READONLY_NOTIFY_BTN NC_("STR_ALREADYOPEN_READONLY_NOTIFY_BTN", "~Notify")
#define STR_ALREADYOPEN_OPEN_BTN NC_("STR_ALREADYOPEN_OPEN_BTN", "~Open")
#define STR_ALREADYOPEN_SAVE_MSG NC_("STR_ALREADYOPEN_SAVE_MSG", "Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nClose document on other system and retry saving or ignore own file locking and save current document.")
#define STR_ALREADYOPEN_RETRY_SAVE_BTN NC_("STR_ALREADYOPEN_RETRY_SAVE_BTN", "~Retry Saving")
@@ -42,13 +43,15 @@
#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE NC_("STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE", "Non-Encrypted Streams")
#define STR_LOCKFAILED_TITLE NC_("STR_LOCKFAILED_TITLE", "Document Could Not Be Locked")
-#define STR_LOCKFAILED_MSG NC_("STR_LOCKFAILED_MSG", "The lock file could not be created for exclusive access by %PRODUCTNAME, due to missing permission to create a lock file on that file location or lack of free disk space.")
+#define STR_LOCKFAILED_MSG NC_("STR_LOCKFAILED_MSG", "The lock file could not be created for exclusive access by %PRODUCTNAME, due to missing permission to create a lock file on that file location or lack of free disk space.\n\nSelect Notify to open read-only and get notified when the document becomes editable.")
#define STR_LOCKFAILED_OPENREADONLY_BTN NC_("STR_LOCKFAILED_OPENREADONLY_BTN", "Open ~Read-Only")
+#define STR_LOCKFAILED_OPENREADONLY_NOTIFY_BTN NC_("STR_LOCKFAILED_OPENREADONLY_NOTIFY_BTN", "~Notify")
#define STR_OPENLOCKED_TITLE NC_("STR_OPENLOCKED_TITLE", "Document in Use")
-#define STR_OPENLOCKED_MSG NC_("STR_OPENLOCKED_MSG", "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nOpen document read-only or open a copy of the document for editing.$(ARG3)")
+#define STR_OPENLOCKED_MSG NC_("STR_OPENLOCKED_MSG", "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nOpen document read-only or open a copy of the document for editing.\nSelect Notify to open read-only and get notified when the document becomes editable.$(ARG3)")
#define STR_OPENLOCKED_ALLOWIGNORE_MSG NC_("STR_OPENLOCKED_ALLOWIGNORE_MSG", "\nYou may also ignore the file locking and open the document for editing.")
#define STR_OPENLOCKED_OPENREADONLY_BTN NC_("STR_OPENLOCKED_OPENREADONLY_BTN", "Open ~Read-Only")
+#define STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN NC_("STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN", "~Notify")
#define STR_OPENLOCKED_OPENCOPY_BTN NC_("STR_OPENLOCKED_OPENCOPY_BTN", "Open ~Copy")
#define STR_UNKNOWNUSER NC_("STR_UNKNOWNUSER", "Unknown User")
@@ -73,7 +76,17 @@
#define STR_ERROR_PASSWORDS_NOT_IDENTICAL NC_("STR_ERROR_PASSWORDS_NOT_IDENTICAL", "The password confirmation does not match.")
#define STR_LOCKCORRUPT_TITLE NC_("STR_LOCKCORRUPT_TITLE", "Lock file is corrupted")
-#define STR_LOCKCORRUPT_MSG NC_("STR_LOCKCORRUPT_MSG", "The lock file is corrupted and probably empty. Opening the document read-only and closing it again removes the corrupted lock file.")
+#define STR_LOCKCORRUPT_MSG NC_("STR_LOCKCORRUPT_MSG", "The lock file is corrupted and probably empty. Opening the document read-only and closing it again removes the corrupted lock file.\n\nSelect Notify to open read-only and get notified when the document becomes editable.")
#define STR_LOCKCORRUPT_OPENREADONLY_BTN NC_("STR_LOCKCORRUPT_OPENREADONLY_BTN", "Open ~Read-Only")
+#define STR_LOCKCORRUPT_OPENREADONLY_NOTIFY_BTN NC_("STR_LOCKCORRUPT_OPENREADONLY_NOTIFY_BTN", "~Notify")
+
+#define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable")
+#define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?")
+#define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload")
+
+#define STR_READONLYOPEN_TITLE NC_("STR_READONLYOPEN_TITLE", "Document is read-only")
+#define STR_READONLYOPEN_MSG NC_("STR_READONLYOPEN_MSG", "Document file '$(ARG1)' is read-only.\n\nOpen read-only or select Notify to open read-only and get notified when the document becomes editable.")
+#define STR_READONLYOPEN_BTN NC_("STR_READONLYOPEN_BTN", "Open ~Read-Only")
+#define STR_READONLYOPEN_NOTIFY_BTN NC_("STR_READONLYOPEN_NOTIFY_BTN", "~Notify")
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx
index 2fe5dcbc424f..7c387d8b7a7c 100644
--- a/uui/source/alreadyopen.cxx
+++ b/uui/source/alreadyopen.cxx
@@ -35,6 +35,7 @@ AlreadyOpenQueryBox::AlreadyOpenQueryBox(weld::Window* pParent, const std::local
else
{
m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_READONLY_BTN, rLocale), RET_YES);
+ m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_READONLY_NOTIFY_BTN, rLocale), RET_RETRY);
m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rLocale), RET_NO);
}
m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index 52b9d2108347..23493c16053c 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -23,6 +23,8 @@
#include <com/sun/star/document/LockFileIgnoreRequest.hpp>
#include <com/sun/star/document/LockFileCorruptRequest.hpp>
#include <com/sun/star/document/OwnLockOnDocumentRequest.hpp>
+#include <com/sun/star/document/ReadOnlyOpenRequest.hpp>
+#include <com/sun/star/document/ReloadEditableRequest.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionDisapprove.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
@@ -41,6 +43,8 @@
#include "filechanged.hxx"
#include "lockfailed.hxx"
#include "lockcorrupt.hxx"
+#include "readonlyopen.hxx"
+#include "reloadeditable.hxx"
#include "iahndl.hxx"
@@ -53,6 +57,66 @@ using namespace com::sun::star;
namespace {
+void handleReadOnlyOpenRequest_(
+ weld::Window* pParent, const OUString& aDocumentURL,
+ uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& rContinuations)
+{
+ uno::Reference<task::XInteractionApprove> xApprove;
+ uno::Reference<task::XInteractionAbort> xAbort;
+ getContinuations(rContinuations, &xApprove, &xAbort);
+
+ if (!xApprove.is() || !xAbort.is())
+ return;
+
+ SolarMutexGuard aGuard;
+ std::locale aResLocale = Translate::Create("uui");
+
+ OUString aMessage;
+ std::vector<OUString> aArguments;
+ aArguments.push_back(aDocumentURL);
+
+ aMessage = Translate::get(STR_READONLYOPEN_MSG, aResLocale);
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, aArguments);
+
+ ReadOnlyOpenQueryBox aDialog(pParent, aResLocale, aMessage);
+ int nResult = aDialog.run();
+
+ if (nResult == RET_YES)
+ xApprove->select();
+ else if (nResult != RET_RETRY)
+ xAbort->select();
+}
+
+void handleReloadEditableRequest_(
+ weld::Window* pParent, const OUString& aDocumentURL,
+ uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& rContinuations)
+{
+ uno::Reference<task::XInteractionApprove> xApprove;
+ uno::Reference<task::XInteractionAbort> xAbort;
+ getContinuations(rContinuations, &xApprove, &xAbort);
+
+ if (!xApprove.is() || !xAbort.is())
+ return;
+
+ SolarMutexGuard aGuard;
+ std::locale aResLocale = Translate::Create("uui");
+
+ OUString aMessage;
+ std::vector<OUString> aArguments;
+ aArguments.push_back(aDocumentURL);
+
+ aMessage = Translate::get(STR_RELOADEDITABLE_MSG, aResLocale);
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, aArguments);
+
+ ReloadEditableQueryBox aDialog(pParent, aResLocale, aMessage);
+ int nResult = aDialog.run();
+
+ if (nResult == RET_YES)
+ xApprove->select();
+ else
+ xAbort->select();
+}
+
void
handleLockedDocumentRequest_(
weld::Window * pParent,
@@ -132,7 +196,7 @@ handleLockedDocumentRequest_(
xDisapprove->select();
else if ( nResult == RET_IGNORE && xRetry.is() )
xRetry->select();
- else
+ else if ( nResult != RET_RETRY )
xAbort->select();
}
@@ -196,7 +260,7 @@ handleLockFileProblemRequest_(
if ( nResult == RET_OK )
xApprove->select();
- else
+ else if ( nResult != RET_RETRY )
xAbort->select();
}
@@ -293,5 +357,41 @@ UUIInteractionHelper::handleLockFileProblemRequest(
return false;
}
+bool UUIInteractionHelper::handleReadOnlyOpenRequest(
+ uno::Reference<task::XInteractionRequest> const& rRequest)
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::ReadOnlyOpenRequest aReadOnlyOpenRequest;
+ if (aAnyRequest >>= aReadOnlyOpenRequest)
+ {
+ uno::Reference<awt::XWindow> xParent = getParentXWindow();
+ handleReadOnlyOpenRequest_(Application::GetFrameWeld(xParent),
+ aReadOnlyOpenRequest.DocumentURL,
+ rRequest->getContinuations());
+ return true;
+ }
+
+ return false;
+}
+
+bool UUIInteractionHelper::handleReloadEditableRequest(
+ uno::Reference<task::XInteractionRequest> const& rRequest)
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::ReloadEditableRequest aReloadEditableRequest;
+ if (aAnyRequest >>= aReloadEditableRequest)
+ {
+ uno::Reference<awt::XWindow> xParent = getParentXWindow();
+ handleReloadEditableRequest_(
+ Application::GetFrameWeld(xParent), aReloadEditableRequest.DocumentURL,
+ rRequest->getContinuations());
+ return true;
+ }
+
+ return false;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index ec8cb02258db..2897a582c3e9 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -815,6 +815,12 @@ UUIInteractionHelper::handleRequest_impl(
if ( handleLockFileProblemRequest( rRequest ) )
return true;
+ if ( handleReloadEditableRequest( rRequest ) )
+ return true;
+
+ if ( handleReadOnlyOpenRequest( rRequest ) )
+ return true;
+
task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
if (aAnyRequest >>= aMacroConfirmRequest)
{
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index ff6973245dad..8dc828a7dd5f 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -231,6 +231,12 @@ private:
bool handleLockFileProblemRequest(
css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
+ bool handleReloadEditableRequest(
+ css::uno::Reference<css::task::XInteractionRequest> const& rRequest);
+
+ bool
+ handleReadOnlyOpenRequest(css::uno::Reference<css::task::XInteractionRequest> const& rRequest);
+
bool handleCustomRequest(
const css::uno::Reference< css::task::XInteractionRequest >& i_rRequest,
const OUString& i_rServiceName
diff --git a/uui/source/lockcorrupt.cxx b/uui/source/lockcorrupt.cxx
index 28e8e71f00c4..d3abee07a185 100644
--- a/uui/source/lockcorrupt.cxx
+++ b/uui/source/lockcorrupt.cxx
@@ -29,6 +29,7 @@ LockCorruptQueryBox::LockCorruptQueryBox(weld::Window* pParent, const std::local
{
m_xQueryBox->set_title(Translate::get(STR_LOCKCORRUPT_TITLE, rResLocale));
m_xQueryBox->add_button(Translate::get(STR_LOCKCORRUPT_OPENREADONLY_BTN, rResLocale), RET_OK);
+ m_xQueryBox->add_button(Translate::get(STR_LOCKCORRUPT_OPENREADONLY_NOTIFY_BTN, rResLocale), RET_RETRY);
m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
m_xQueryBox->set_default_response(RET_OK);
}
diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx
index 8254b19e509b..340cc9638806 100644
--- a/uui/source/lockfailed.cxx
+++ b/uui/source/lockfailed.cxx
@@ -29,6 +29,7 @@ LockFailedQueryBox::LockFailedQueryBox(weld::Window* pParent, const std::locale&
{
m_xQueryBox->set_title(Translate::get(STR_LOCKFAILED_TITLE, rLocale));
m_xQueryBox->add_button(Translate::get(STR_LOCKFAILED_OPENREADONLY_BTN, rLocale), RET_OK);
+ m_xQueryBox->add_button(Translate::get(STR_LOCKFAILED_OPENREADONLY_NOTIFY_BTN, rLocale), RET_RETRY);
m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
m_xQueryBox->set_default_response(RET_OK);
}
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index fa2a4616c7c1..a0284b194b14 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -29,6 +29,7 @@ OpenLockedQueryBox::OpenLockedQueryBox(weld::Window* pParent, const std::locale&
{
m_xQueryBox->set_title(Translate::get(STR_OPENLOCKED_TITLE, rResLocale));
m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES);
+ m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN, rResLocale), RET_RETRY);
m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO);
if (bEnableOverride && officecfg::Office::Common::Misc::AllowOverrideLocking::get())
{
diff --git a/uui/source/readonlyopen.cxx b/uui/source/readonlyopen.cxx
new file mode 100644
index 000000000000..72a3b989e079
--- /dev/null
+++ b/uui/source/readonlyopen.cxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <strings.hrc>
+#include "readonlyopen.hxx"
+#include <officecfg/Office/Common.hxx>
+#include <unotools/resmgr.hxx>
+#include <vcl/stdtext.hxx>
+#include <vcl/svapp.hxx>
+
+ReadOnlyOpenQueryBox::ReadOnlyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& rMessage)
+ : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question,
+ VclButtonsType::NONE, rMessage))
+{
+ m_xQueryBox->set_title(Translate::get(STR_READONLYOPEN_TITLE, rResLocale));
+ m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_BTN, rResLocale), RET_YES);
+ m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_NOTIFY_BTN, rResLocale), RET_RETRY);
+ m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/uui/source/readonlyopen.hxx b/uui/source/readonlyopen.hxx
new file mode 100644
index 000000000000..08063d10be0e
--- /dev/null
+++ b/uui/source/readonlyopen.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/weld.hxx>
+
+class ReadOnlyOpenQueryBox
+{
+private:
+ std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+
+public:
+ ReadOnlyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& rMessage);
+ int run() { return m_xQueryBox->run(); }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/uui/source/reloadeditable.cxx b/uui/source/reloadeditable.cxx
new file mode 100644
index 000000000000..9dad2e183abf
--- /dev/null
+++ b/uui/source/reloadeditable.cxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <strings.hrc>
+#include "reloadeditable.hxx"
+#include <officecfg/Office/Common.hxx>
+#include <unotools/resmgr.hxx>
+#include <vcl/stdtext.hxx>
+#include <vcl/svapp.hxx>
+
+ReloadEditableQueryBox::ReloadEditableQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& rMessage)
+ : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question,
+ VclButtonsType::NONE, rMessage))
+{
+ m_xQueryBox->set_title(Translate::get(STR_RELOADEDITABLE_TITLE, rResLocale));
+ m_xQueryBox->add_button(Translate::get(STR_RELOADEDITABLE_BTN, rResLocale), RET_YES);
+ m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/uui/source/reloadeditable.hxx b/uui/source/reloadeditable.hxx
new file mode 100644
index 000000000000..00a15f7ba89c
--- /dev/null
+++ b/uui/source/reloadeditable.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/weld.hxx>
+
+class ReloadEditableQueryBox
+{
+private:
+ std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+
+public:
+ ReloadEditableQueryBox(weld::Window* pParent, const std::locale& rResLocale,
+ const OUString& rMessage);
+ int run() { return m_xQueryBox->run(); }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */