sc/source/ui/inc/tpcompatibility.hxx         |    2 +
 sc/source/ui/optdlg/tpcompatibility.cxx      |    7 +++++
 sc/uiconfig/scalc/ui/optcompatibilitypage.ui |   36 +++++++++++++++++++++++----
 3 files changed, 40 insertions(+), 5 deletions(-)

New commits:
commit 67fcf1388976c11b1c0a688403e7323326a56e82
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Fri Dec 8 19:07:20 2023 +0100
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Mon Dec 11 08:26:25 2023 +0100

    tdf#158471 - UI: Part 53 - Unify lockdown behavior of Options dialog
    
    for Calc - Compatibility Page.
    
    Change-Id: I43780c8b29de42a765b1d1110dbfe90efb173b4d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160499
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/sc/source/ui/inc/tpcompatibility.hxx 
b/sc/source/ui/inc/tpcompatibility.hxx
index 4efdbc172b10..0ab84d4d93e8 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -26,7 +26,9 @@ public:
 
 private:
     std::unique_ptr<weld::ComboBox> m_xLbKeyBindings;
+    std::unique_ptr<weld::Widget> m_xLbKeyBindingsImg;
     std::unique_ptr<weld::CheckButton> m_xBtnLink;
+    std::unique_ptr<weld::Widget> m_xBtnLinkImg;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx 
b/sc/source/ui/optdlg/tpcompatibility.cxx
index cc54635f3300..64221cd2a9da 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -11,6 +11,7 @@
 
 #include <svl/intitem.hxx>
 #include <svl/eitem.hxx>
+#include <officecfg/Office/Calc.hxx>
 
 #include <tpcompatibility.hxx>
 #include <sc.hrc>
@@ -19,7 +20,9 @@
 ScTpCompatOptions::ScTpCompatOptions(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet &rCoreAttrs)
     : SfxTabPage(pPage, pController, 
"modules/scalc/ui/optcompatibilitypage.ui", "OptCompatibilityPage", &rCoreAttrs)
     , m_xLbKeyBindings(m_xBuilder->weld_combo_box("keybindings"))
+    , m_xLbKeyBindingsImg(m_xBuilder->weld_widget("lockkeybindings"))
     , m_xBtnLink(m_xBuilder->weld_check_button("cellLinkCB"))
+    , m_xBtnLinkImg(m_xBuilder->weld_widget("lockcellLinkCB"))
 {
 }
 
@@ -86,12 +89,16 @@ void ScTpCompatOptions::Reset(const SfxItemSet *rCoreAttrs)
                 ;
         }
     }
+    
m_xLbKeyBindings->set_sensitive(!officecfg::Office::Calc::Compatibility::KeyBindings::BaseGroup::isReadOnly());
+    
m_xLbKeyBindingsImg->set_visible(officecfg::Office::Calc::Compatibility::KeyBindings::BaseGroup::isReadOnly());
     m_xLbKeyBindings->save_value();
 
     if (const SfxBoolItem* pbItem = rCoreAttrs->GetItemIfSet(SID_SC_OPT_LINKS))
     {
         m_xBtnLink->set_active(pbItem->GetValue());
     }
+    
m_xBtnLink->set_sensitive(!officecfg::Office::Calc::Compatibility::Links::isReadOnly());
+    
m_xBtnLinkImg->set_visible(officecfg::Office::Calc::Compatibility::Links::isReadOnly());
     m_xBtnLink->save_state();
 }
 
diff --git a/sc/uiconfig/scalc/ui/optcompatibilitypage.ui 
b/sc/uiconfig/scalc/ui/optcompatibilitypage.ui
index f45996294ad7..b48bfeb70c20 100644
--- a/sc/uiconfig/scalc/ui/optcompatibilitypage.ui
+++ b/sc/uiconfig/scalc/ui/optcompatibilitypage.ui
@@ -16,7 +16,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=1 -->
+          <!-- n-columns=3 n-rows=1 -->
           <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -40,7 +40,7 @@
                 <property name="yalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -55,7 +55,20 @@
                 </items>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockkeybindings">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -87,7 +100,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=1 -->
+          <!-- n-columns=3 n-rows=1 -->
           <object class="GtkGrid" id="grid2">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -112,11 +125,24 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">0</property>
                 <property name="width">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkImage" id="lockcellLinkCB">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
           </object>
         </child>
         <child type="label">

Reply via email to