sfx2/source/dialog/backingwindow.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 2fdcdad742bc26be509dde53f061f96a9620fd0a
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Fri May 3 11:10:57 2024 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon May 6 21:56:58 2024 +0200

    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.mehrbr...@allotropia.de>
    Tested-by: Jenkins

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));

Reply via email to