summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2024-05-03 11:10:57 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-05-06 21:56:58 +0200
commit2fdcdad742bc26be509dde53f061f96a9620fd0a (patch)
tree1afe3a8e9676f66a3b286d39dffbd844c3af543b /sfx2
parentf840d3c9399cd257c8cfb757bd7666fe2e827773 (diff)
tdf#160961: hide open remote file button from startcenter if the
.uno:OpenRemote command is not available (e.g disabled in a config file). We also hide the Open remote file (and other) buttons in the Menubar if they are settled to disable. Change-Id: Ieb45c63b5d6aaf81d0eb7fa8947a9e109bee86f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167040 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/backingwindow.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index efa18f452d51..b1eb7a31f7e9 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -28,6 +28,7 @@
#include <unotools/historyoptions.hxx>
#include <unotools/moduleoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#include <unotools/configmgr.hxx>
#include <svtools/openfiledroptargetlistener.hxx>
#include <svtools/colorcfg.hxx>
@@ -307,7 +308,14 @@ void BackingWindow::initControls()
mxExtensionsButton->connect_clicked(LINK(this, BackingWindow, ExtLinkClickHdl));
mxOpenButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
- mxRemoteButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
+
+ // Hide OpenRemote button on startpage if the OpenRemote uno command is not available
+ SvtCommandOptions aCmdOptions;
+ if (SvtCommandOptions().HasEntriesDisabled() && aCmdOptions.LookupDisabled("OpenRemote"))
+ mxRemoteButton->set_visible(false);
+ else
+ mxRemoteButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
+
mxWriterAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
mxDrawAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
mxCalcAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));