sc/source/ui/inc/tpprint.hxx    |    3 +
 sc/source/ui/optdlg/tpprint.cxx |   14 ++++++-
 sc/uiconfig/scalc/ui/optdlg.ui  |   78 +++++++++++++++++++++++++++++-----------
 3 files changed, 74 insertions(+), 21 deletions(-)

New commits:
commit 5e8c0575e877795aaca91346548cd0136fa22048
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Fri Dec 8 20:04:16 2023 +0100
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Mon Dec 11 08:27:26 2023 +0100

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

diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 3dc7d36e5304..5cb33891b835 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -24,8 +24,11 @@
 class ScTpPrintOptions : public SfxTabPage
 {
     std::unique_ptr<weld::CheckButton>       m_xSkipEmptyPagesCB;
+    std::unique_ptr<weld::Widget>            m_xSkipEmptyPagesImg;
     std::unique_ptr<weld::CheckButton>       m_xSelectedSheetsCB;
+    std::unique_ptr<weld::Widget>            m_xSelectedSheetsImg;
     std::unique_ptr<weld::CheckButton>       m_xForceBreaksCB;
+    std::unique_ptr<weld::Widget>            m_xForceBreaksImg;
 
 public:
     ScTpPrintOptions(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rCoreSet);
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index 44324ffc2aa6..fbcafe299ef5 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -25,13 +25,17 @@
 #include <printopt.hxx>
 #include <scmod.hxx>
 #include <sc.hrc>
+#include <officecfg/Office/Calc.hxx>
 
 ScTpPrintOptions::ScTpPrintOptions( weld::Container* pPage, 
weld::DialogController* pController,
                                     const SfxItemSet& rCoreAttrs )
     : SfxTabPage(pPage, pController, "modules/scalc/ui/optdlg.ui", 
"optCalcPrintPage", &rCoreAttrs )
     , m_xSkipEmptyPagesCB(m_xBuilder->weld_check_button("suppressCB"))
+    , m_xSkipEmptyPagesImg(m_xBuilder->weld_widget("locksuppressCB"))
     , m_xSelectedSheetsCB(m_xBuilder->weld_check_button("printCB"))
+    , m_xSelectedSheetsImg(m_xBuilder->weld_widget("lockprintCB"))
     , m_xForceBreaksCB(m_xBuilder->weld_check_button("forceBreaksCB"))
+    , m_xForceBreaksImg(m_xBuilder->weld_widget("lockforceBreaksCB"))
 {
 }
 
@@ -75,9 +79,17 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet )
     }
 
     m_xSkipEmptyPagesCB->set_active( aOptions.GetSkipEmpty() );
+    m_xForceBreaksCB->set_active(aOptions.GetForceBreaks());
+
+    
m_xSkipEmptyPagesCB->set_sensitive(!officecfg::Office::Calc::Print::Page::EmptyPages::isReadOnly());
+    
m_xSkipEmptyPagesImg->set_visible(officecfg::Office::Calc::Print::Page::EmptyPages::isReadOnly());
+    
m_xSelectedSheetsCB->set_sensitive(!officecfg::Office::Calc::Print::Other::AllSheets::isReadOnly());
+    
m_xSelectedSheetsImg->set_visible(officecfg::Office::Calc::Print::Other::AllSheets::isReadOnly());
+    
m_xForceBreaksCB->set_sensitive(!officecfg::Office::Calc::Print::Page::ForceBreaks::isReadOnly());
+    
m_xForceBreaksImg->set_visible(officecfg::Office::Calc::Print::Page::ForceBreaks::isReadOnly());
+
     m_xSkipEmptyPagesCB->save_state();
     m_xSelectedSheetsCB->save_state();
-    m_xForceBreaksCB->set_active( aOptions.GetForceBreaks() );
     m_xForceBreaksCB->save_state();
 }
 
diff --git a/sc/uiconfig/scalc/ui/optdlg.ui b/sc/uiconfig/scalc/ui/optdlg.ui
index bbbad94a4f76..8dd869f817af 100644
--- a/sc/uiconfig/scalc/ui/optdlg.ui
+++ b/sc/uiconfig/scalc/ui/optdlg.ui
@@ -15,46 +15,71 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <object class="GtkBox" id="box2">
+          <!-- n-columns=2 n-rows=2 -->
+          <object class="GtkGrid">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="margin-start">12</property>
             <property name="margin-top">6</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
+            <property name="row-spacing">6</property>
+            <property name="column-spacing">6</property>
             <child>
-              <object class="GtkCheckButton" id="forceBreaksCB">
-                <property name="label" translatable="yes" 
context="optdlg|forceBreaksCB">_Always apply manual breaks</property>
+              <object class="GtkCheckButton" id="suppressCB">
+                <property name="label" translatable="yes" 
context="optdlg|suppressCB">_Suppress output of empty pages</property>
                 <property name="visible">True</property>
                 <property name="can-focus">True</property>
                 <property name="receives-default">False</property>
                 <property name="use-underline">True</property>
                 <property name="draw-indicator">True</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="suppressCB-atkobject">
+                    <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|suppressCB">Specifies that empty pages 
that have no cell contents or draw objects are not printed.</property>
+                  </object>
+                </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="left-attach">1</property>
+                <property name="top-attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkCheckButton" id="suppressCB">
-                <property name="label" translatable="yes" 
context="optdlg|suppressCB">_Suppress output of empty pages</property>
+              <object class="GtkCheckButton" id="forceBreaksCB">
+                <property name="label" translatable="yes" 
context="optdlg|forceBreaksCB">_Always apply manual breaks</property>
                 <property name="visible">True</property>
                 <property name="can-focus">True</property>
                 <property name="receives-default">False</property>
                 <property name="use-underline">True</property>
                 <property name="draw-indicator">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="suppressCB-atkobject">
-                    <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|suppressCB">Specifies that empty pages 
that have no cell contents or draw objects are not printed.</property>
-                  </object>
-                </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="left-attach">1</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockforceBreaksCB">
+                <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>
+            <child>
+              <object class="GtkImage" id="locksuppressCB">
+                <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">1</property>
               </packing>
             </child>
           </object>
@@ -88,8 +113,21 @@
             <property name="can-focus">False</property>
             <property name="margin-start">12</property>
             <property name="margin-top">6</property>
-            <property name="orientation">vertical</property>
             <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="lockprintCB">
+                <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="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkCheckButton" id="printCB">
                 <property name="label" translatable="yes" 
context="optdlg|printCB">_Print only selected sheets</property>
@@ -107,7 +145,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>

Reply via email to