cui/source/options/optgdlg.cxx              |   22 ++++
 cui/source/options/optgdlg.hxx              |   10 +
 cui/uiconfig/ui/optlanguagespage.ui         |  141 ++++++++++++++++++++++++----
 include/unotools/syslocaleoptions.hxx       |    4 
 unotools/source/config/syslocaleoptions.cxx |   10 +
 5 files changed, 169 insertions(+), 18 deletions(-)

New commits:
commit 07590ff83e03077cf0d755f698b5b6bb36bb54d2
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Fri Nov 3 14:20:15 2023 +0100
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Sat Nov 4 10:58:42 2023 +0100

    tdf#158001 - UI: Part 18 - Unify lockdown behavior of Options dialog
    
    for Languages Page.
    
    Change-Id: I3f4cf27980dd6d06da13f554feaca192ebd0b671
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158882
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ee727e074e51..9e32e2fc9ea6 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1170,19 +1170,28 @@ 
OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon
     , m_xUserInterfaceLB(m_xBuilder->weld_combo_box("userinterface"))
     , m_xLocaleSettingFT(m_xBuilder->weld_label("localesettingFT"))
     , m_xLocaleSettingLB(new 
SvxLanguageBox(m_xBuilder->weld_combo_box("localesetting")))
+    , m_xLocaleSettingImg(m_xBuilder->weld_widget("locklocalesetting"))
+    , m_xDecimalSeparatorFT(m_xBuilder->weld_label("label6"))
     , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button("decimalseparator"))
+    , m_xDecimalSeparatorImg(m_xBuilder->weld_widget("lockdecimalseparator"))
     , m_xCurrencyFT(m_xBuilder->weld_label("defaultcurrency"))
     , m_xCurrencyLB(m_xBuilder->weld_combo_box("currencylb"))
+    , m_xCurrencyImg(m_xBuilder->weld_widget("lockcurrencylb"))
     , m_xDatePatternsFT(m_xBuilder->weld_label("dataaccpatterns"))
     , m_xDatePatternsED(m_xBuilder->weld_entry("datepatterns"))
+    , m_xDatePatternsImg(m_xBuilder->weld_widget("lockdatepatterns"))
     , m_xWesternLanguageLB(new 
SvxLanguageBox(m_xBuilder->weld_combo_box("westernlanguage")))
     , m_xWesternLanguageFT(m_xBuilder->weld_label("western"))
+    , m_xWesternLanguageImg(m_xBuilder->weld_widget("lockwesternlanguage"))
     , m_xAsianLanguageLB(new 
SvxLanguageBox(m_xBuilder->weld_combo_box("asianlanguage")))
     , m_xComplexLanguageLB(new 
SvxLanguageBox(m_xBuilder->weld_combo_box("complexlanguage")))
     , m_xCurrentDocCB(m_xBuilder->weld_check_button("currentdoc"))
     , m_xAsianSupportCB(m_xBuilder->weld_check_button("asiansupport"))
+    , m_xAsianSupportImg(m_xBuilder->weld_widget("lockasiansupport"))
     , m_xCTLSupportCB(m_xBuilder->weld_check_button("ctlsupport"))
+    , m_xCTLSupportImg(m_xBuilder->weld_widget("lockctlsupport"))
     , 
m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button("ignorelanguagechange"))
+    , 
m_xIgnoreLanguageChangeImg(m_xBuilder->weld_widget("lockignorelanguagechange"))
 {
     // tdf#125483 save original default label
     m_sDecimalSeparatorLabel = m_xDecimalSeparatorCB->get_label();
@@ -1321,6 +1330,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* 
pPage, weld::DialogCon
     m_xAsianSupportCB->save_state();
     bool bReadonly = SvtCJKOptions::IsAnyReadOnly();
     m_xAsianSupportCB->set_sensitive(!bReadonly);
+    m_xAsianSupportImg->set_visible(bReadonly);
     SupportHdl(*m_xAsianSupportCB);
 
     m_bOldCtl = SvtCTLOptions::IsCTLFontEnabled();
@@ -1328,6 +1338,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* 
pPage, weld::DialogCon
     m_xCTLSupportCB->save_state();
     bReadonly = 
pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT);
     m_xCTLSupportCB->set_sensitive(!bReadonly);
+    m_xCTLSupportImg->set_visible(bReadonly);
     SupportHdl(*m_xCTLSupportCB);
 
     m_xIgnoreLanguageChangeCB->set_active( 
pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange() );
@@ -1633,12 +1644,20 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet 
)
     bool bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Locale);
     m_xLocaleSettingLB->set_sensitive(!bReadonly);
     m_xLocaleSettingFT->set_sensitive(!bReadonly);
+    m_xLocaleSettingImg->set_visible(bReadonly);
 
 
     m_xDecimalSeparatorCB->set_active( 
pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale());
+    bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::DecimalSeparator);
+    m_xDecimalSeparatorCB->set_sensitive(!bReadonly);
+    m_xDecimalSeparatorFT->set_sensitive(!bReadonly);
+    m_xDecimalSeparatorImg->set_visible(bReadonly);
     m_xDecimalSeparatorCB->save_state();
 
     m_xIgnoreLanguageChangeCB->set_active( 
pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange());
+    bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::IgnoreLanguageChange);
+    m_xIgnoreLanguageChangeCB->set_sensitive(!bReadonly);
+    m_xIgnoreLanguageChangeImg->set_visible(bReadonly);
     m_xIgnoreLanguageChangeCB->save_state();
 
     // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support
@@ -1662,6 +1681,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
     bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Currency);
     m_xCurrencyLB->set_sensitive(!bReadonly);
     m_xCurrencyFT->set_sensitive(!bReadonly);
+    m_xCurrencyImg->set_visible(bReadonly);
 
     // date acceptance patterns
     OUString aDatePatternsString = 
pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
@@ -1683,6 +1703,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
     bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::DatePatterns);
     m_xDatePatternsED->set_sensitive(!bReadonly);
     m_xDatePatternsFT->set_sensitive(!bReadonly);
+    m_xDatePatternsImg->set_visible(bReadonly);
     m_xDatePatternsED->save_value();
 
     //western/CJK/CLK language
@@ -1767,6 +1788,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
     bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( u"DefaultLocale" );
     m_xWesternLanguageFT->set_sensitive( bEnable );
     m_xWesternLanguageLB->set_sensitive( bEnable );
+    m_xWesternLanguageImg->set_visible( !bEnable );
 
     // check the box "For the current document only"
     // set the focus to the Western Language box
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 57e2bb9def34..0e09597ae268 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -181,20 +181,30 @@ class OfaLanguagesTabPage : public SfxTabPage
     std::unique_ptr<weld::ComboBox> m_xUserInterfaceLB;
     std::unique_ptr<weld::Label> m_xLocaleSettingFT;
     std::unique_ptr<SvxLanguageBox> m_xLocaleSettingLB;
+    std::unique_ptr<weld::Widget> m_xLocaleSettingImg;
+    std::unique_ptr<weld::Label> m_xDecimalSeparatorFT;
     std::unique_ptr<weld::CheckButton> m_xDecimalSeparatorCB;
+    std::unique_ptr<weld::Widget> m_xDecimalSeparatorImg;
     std::unique_ptr<weld::Label> m_xCurrencyFT;
     std::unique_ptr<weld::ComboBox> m_xCurrencyLB;
+    std::unique_ptr<weld::Widget> m_xCurrencyImg;
     std::unique_ptr<weld::Label> m_xDatePatternsFT;
     std::unique_ptr<weld::Entry> m_xDatePatternsED;
+    std::unique_ptr<weld::Widget> m_xDatePatternsImg;
 
     std::unique_ptr<SvxLanguageBox> m_xWesternLanguageLB;
     std::unique_ptr<weld::Label> m_xWesternLanguageFT;
+    std::unique_ptr<weld::Widget> m_xWesternLanguageImg;
     std::unique_ptr<SvxLanguageBox> m_xAsianLanguageLB;
     std::unique_ptr<SvxLanguageBox> m_xComplexLanguageLB;
     std::unique_ptr<weld::CheckButton> m_xCurrentDocCB;
+    std::unique_ptr<weld::Widget> m_xCurrentDocImg;
     std::unique_ptr<weld::CheckButton> m_xAsianSupportCB;
+    std::unique_ptr<weld::Widget> m_xAsianSupportImg;
     std::unique_ptr<weld::CheckButton> m_xCTLSupportCB;
+    std::unique_ptr<weld::Widget> m_xCTLSupportImg;
     std::unique_ptr<weld::CheckButton> m_xIgnoreLanguageChangeCB;
+    std::unique_ptr<weld::Widget> m_xIgnoreLanguageChangeImg;
 
     DECL_LINK(SupportHdl, weld::Toggleable&, void);
     DECL_LINK(LocaleSettingHdl, weld::ComboBox&, void);
diff --git a/cui/uiconfig/ui/optlanguagespage.ui 
b/cui/uiconfig/ui/optlanguagespage.ui
index 71b8b8c6fdd1..85ddf5494fd1 100644
--- a/cui/uiconfig/ui/optlanguagespage.ui
+++ b/cui/uiconfig/ui/optlanguagespage.ui
@@ -112,7 +112,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=4 -->
+          <!-- n-columns=3 n-rows=4 -->
           <object class="GtkGrid" id="grid2">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -149,7 +149,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -181,7 +181,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -213,7 +213,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -233,7 +233,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -252,7 +252,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -271,7 +271,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -284,11 +284,53 @@
                 <property name="mnemonic-widget">westernlanguage</property>
                 <property name="xalign">0</property>
               </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockwesternlanguage">
+                <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="lockasiansupport">
+                <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>
+            <child>
+              <object class="GtkImage" id="lockctlsupport">
+                <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">2</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
             <child>
               <placeholder/>
             </child>
@@ -317,7 +359,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=1 n-rows=1 -->
+          <!-- n-columns=2 n-rows=1 -->
           <object class="GtkGrid" id="grid3">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -338,6 +380,19 @@
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockignorelanguagechange">
+                <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>
@@ -369,7 +424,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=4 -->
+          <!-- n-columns=3 n-rows=4 -->
           <object class="GtkGrid" id="grid4">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -388,7 +443,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -402,7 +457,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -416,7 +471,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -430,7 +485,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -447,7 +502,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -464,7 +519,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -483,7 +538,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -502,10 +557,62 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locklocalesetting">
+                <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="lockcurrencylb">
+                <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>
+            <child>
+              <object class="GtkImage" id="lockdecimalseparator">
+                <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">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkImage" id="lockdatepatterns">
+                <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">3</property>
+              </packing>
+            </child>
           </object>
         </child>
         <child type="label">
diff --git a/include/unotools/syslocaleoptions.hxx 
b/include/unotools/syslocaleoptions.hxx
index 5f5e57540485..c0fab39a76c6 100644
--- a/include/unotools/syslocaleoptions.hxx
+++ b/include/unotools/syslocaleoptions.hxx
@@ -43,7 +43,9 @@ public:
     {
         Locale,
         Currency,
-        DatePatterns
+        DatePatterns,
+        DecimalSeparator,
+        IgnoreLanguageChange
     };
                                 SvtSysLocaleOptions();
                                 virtual ~SvtSysLocaleOptions() override;
diff --git a/unotools/source/config/syslocaleoptions.cxx 
b/unotools/source/config/syslocaleoptions.cxx
index 0438402139cf..70177c5c0593 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -302,6 +302,16 @@ bool SvtSysLocaleOptions_Impl::IsReadOnly( 
SvtSysLocaleOptions::EOption eOption
                 bReadOnly = m_bRODatePatterns;
                 break;
             }
+        case SvtSysLocaleOptions::EOption::DecimalSeparator:
+            {
+                bReadOnly = m_bRODecimalSeparator;
+                break;
+            }
+        case SvtSysLocaleOptions::EOption::IgnoreLanguageChange:
+            {
+                bReadOnly = m_bROIgnoreLanguageChange;
+                break;
+            }
     }
     return bReadOnly;
 }

Reply via email to