diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-02 18:49:41 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-03 10:51:09 +0100 |
commit | d7d89a47e9e50254469d957b86f0e16bec22fe62 (patch) | |
tree | 2011508cf3fccf2c6ea900f8bd5aca517c7d8d51 /cui | |
parent | 349fa2b19de296bdc19206f6d4b9bc78a194a7f6 (diff) |
tdf#157862 - UI: Part 16 - Unify lockdown behavior of Options dialog
for Load/Save - HTML Page.
Change-Id: I8e9599c25eba62f7b82d8e3f56de031a1c6366fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158849
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/opthtml.cxx | 94 | ||||
-rw-r--r-- | cui/source/options/opthtml.hxx | 14 | ||||
-rw-r--r-- | cui/uiconfig/ui/opthtmlpage.ui | 226 |
3 files changed, 311 insertions, 23 deletions
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx index 7cd8788dd1d2..6880ec4b2e33 100644 --- a/cui/source/options/opthtml.cxx +++ b/cui/source/options/opthtml.cxx @@ -26,19 +26,33 @@ OfaHtmlTabPage::OfaHtmlTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) : SfxTabPage(pPage, pController, "cui/ui/opthtmlpage.ui", "OptHtmlPage", &rSet) , m_xSize1NF(m_xBuilder->weld_spin_button("size1")) + , m_xSize1Img(m_xBuilder->weld_widget("locksize1")) , m_xSize2NF(m_xBuilder->weld_spin_button("size2")) + , m_xSize2Img(m_xBuilder->weld_widget("locksize2")) , m_xSize3NF(m_xBuilder->weld_spin_button("size3")) + , m_xSize3Img(m_xBuilder->weld_widget("locksize3")) , m_xSize4NF(m_xBuilder->weld_spin_button("size4")) + , m_xSize4Img(m_xBuilder->weld_widget("locksize4")) , m_xSize5NF(m_xBuilder->weld_spin_button("size5")) + , m_xSize5Img(m_xBuilder->weld_widget("locksize5")) , m_xSize6NF(m_xBuilder->weld_spin_button("size6")) + , m_xSize6Img(m_xBuilder->weld_widget("locksize6")) , m_xSize7NF(m_xBuilder->weld_spin_button("size7")) + , m_xSize7Img(m_xBuilder->weld_widget("locksize7")) , m_xNumbersEnglishUSCB(m_xBuilder->weld_check_button("numbersenglishus")) + , m_xNumbersEnglishUSImg(m_xBuilder->weld_widget("locknumbersenglishus")) , m_xUnknownTagCB(m_xBuilder->weld_check_button("unknowntag")) + , m_xUnknownTagImg(m_xBuilder->weld_widget("lockunknowntag")) , m_xIgnoreFontNamesCB(m_xBuilder->weld_check_button("ignorefontnames")) + , m_xIgnoreFontNamesImg(m_xBuilder->weld_widget("lockignorefontnames")) , m_xStarBasicCB(m_xBuilder->weld_check_button("starbasic")) + , m_xStarBasicImg(m_xBuilder->weld_widget("lockstarbasic")) , m_xStarBasicWarningCB(m_xBuilder->weld_check_button("starbasicwarning")) + , m_xStarBasicWarningImg(m_xBuilder->weld_widget("lockstarbasicwarning")) , m_xPrintExtensionCB(m_xBuilder->weld_check_button("printextension")) + , m_xPrintExtensionImg(m_xBuilder->weld_widget("lockprintextension")) , m_xSaveGrfLocalCB(m_xBuilder->weld_check_button("savegrflocal")) + , m_xSaveGrfLocalImg(m_xBuilder->weld_widget("locksavegrflocal")) { // replace placeholder with UI string from language list OUString aText(m_xNumbersEnglishUSCB->get_label()); @@ -151,21 +165,99 @@ bool OfaHtmlTabPage::FillItemSet( SfxItemSet* ) void OfaHtmlTabPage::Reset( const SfxItemSet* ) { m_xSize1NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_1::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_1::isReadOnly()) + { + m_xSize1NF->set_sensitive(false); + m_xSize1Img->set_visible(true); + } + m_xSize2NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_2::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_2::isReadOnly()) + { + m_xSize2NF->set_sensitive(false); + m_xSize2Img->set_visible(true); + } + m_xSize3NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_3::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_3::isReadOnly()) + { + m_xSize3NF->set_sensitive(false); + m_xSize3Img->set_visible(true); + } + m_xSize4NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_4::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_4::isReadOnly()) + { + m_xSize4NF->set_sensitive(false); + m_xSize4Img->set_visible(true); + } + m_xSize5NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_5::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_5::isReadOnly()) + { + m_xSize5NF->set_sensitive(false); + m_xSize5Img->set_visible(true); + } + m_xSize6NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_6::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_6::isReadOnly()) + { + m_xSize6NF->set_sensitive(false); + m_xSize6Img->set_visible(true); + } + m_xSize7NF->set_value(officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_7::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_7::isReadOnly()) + { + m_xSize7NF->set_sensitive(false); + m_xSize7Img->set_visible(true); + } + m_xNumbersEnglishUSCB->set_active(officecfg::Office::Common::Filter::HTML::Import::NumbersEnglishUS::get()); + if (officecfg::Office::Common::Filter::HTML::Import::NumbersEnglishUS::isReadOnly()) + { + m_xNumbersEnglishUSCB->set_sensitive(false); + m_xNumbersEnglishUSImg->set_visible(true); + } + m_xUnknownTagCB->set_active(officecfg::Office::Common::Filter::HTML::Import::UnknownTag::get()); + if (officecfg::Office::Common::Filter::HTML::Import::UnknownTag::isReadOnly()) + { + m_xUnknownTagCB->set_sensitive(false); + m_xUnknownTagImg->set_visible(true); + } + m_xIgnoreFontNamesCB->set_active(officecfg::Office::Common::Filter::HTML::Import::FontSetting::get()); + if (officecfg::Office::Common::Filter::HTML::Import::FontSetting::isReadOnly()) + { + m_xIgnoreFontNamesCB->set_sensitive(false); + m_xIgnoreFontNamesImg->set_visible(true); + } m_xStarBasicCB->set_active(officecfg::Office::Common::Filter::HTML::Export::Basic::get()); + if (officecfg::Office::Common::Filter::HTML::Export::Basic::isReadOnly()) + { + m_xStarBasicCB->set_sensitive(false); + m_xStarBasicImg->set_visible(true); + } + m_xStarBasicWarningCB->set_active(officecfg::Office::Common::Filter::HTML::Export::Warning::get()); - m_xStarBasicWarningCB->set_sensitive(!m_xStarBasicCB->get_active()); + m_xStarBasicWarningCB->set_sensitive(!m_xStarBasicCB->get_active() && !officecfg::Office::Common::Filter::HTML::Export::Warning::isReadOnly()); + m_xStarBasicWarningImg->set_visible(officecfg::Office::Common::Filter::HTML::Export::Warning::isReadOnly()); + m_xSaveGrfLocalCB->set_active(officecfg::Office::Common::Filter::HTML::Export::LocalGraphic::get()); + if (officecfg::Office::Common::Filter::HTML::Export::LocalGraphic::isReadOnly()) + { + m_xSaveGrfLocalCB->set_sensitive(false); + m_xSaveGrfLocalImg->set_visible(true); + } + m_xPrintExtensionCB->set_active(officecfg::Office::Common::Filter::HTML::Export::PrintLayout::get()); + if (officecfg::Office::Common::Filter::HTML::Export::PrintLayout::isReadOnly()) + { + m_xPrintExtensionCB->set_sensitive(false); + m_xPrintExtensionImg->set_visible(true); + } m_xPrintExtensionCB->save_state(); m_xStarBasicCB->save_state(); diff --git a/cui/source/options/opthtml.hxx b/cui/source/options/opthtml.hxx index 7cd3a5eaa674..2f389a7af571 100644 --- a/cui/source/options/opthtml.hxx +++ b/cui/source/options/opthtml.hxx @@ -25,21 +25,35 @@ class OfaHtmlTabPage : public SfxTabPage { std::unique_ptr<weld::SpinButton> m_xSize1NF; + std::unique_ptr<weld::Widget> m_xSize1Img; std::unique_ptr<weld::SpinButton> m_xSize2NF; + std::unique_ptr<weld::Widget> m_xSize2Img; std::unique_ptr<weld::SpinButton> m_xSize3NF; + std::unique_ptr<weld::Widget> m_xSize3Img; std::unique_ptr<weld::SpinButton> m_xSize4NF; + std::unique_ptr<weld::Widget> m_xSize4Img; std::unique_ptr<weld::SpinButton> m_xSize5NF; + std::unique_ptr<weld::Widget> m_xSize5Img; std::unique_ptr<weld::SpinButton> m_xSize6NF; + std::unique_ptr<weld::Widget> m_xSize6Img; std::unique_ptr<weld::SpinButton> m_xSize7NF; + std::unique_ptr<weld::Widget> m_xSize7Img; std::unique_ptr<weld::CheckButton> m_xNumbersEnglishUSCB; + std::unique_ptr<weld::Widget> m_xNumbersEnglishUSImg; std::unique_ptr<weld::CheckButton> m_xUnknownTagCB; + std::unique_ptr<weld::Widget> m_xUnknownTagImg; std::unique_ptr<weld::CheckButton> m_xIgnoreFontNamesCB; + std::unique_ptr<weld::Widget> m_xIgnoreFontNamesImg; std::unique_ptr<weld::CheckButton> m_xStarBasicCB; + std::unique_ptr<weld::Widget> m_xStarBasicImg; std::unique_ptr<weld::CheckButton> m_xStarBasicWarningCB; + std::unique_ptr<weld::Widget> m_xStarBasicWarningImg; std::unique_ptr<weld::CheckButton> m_xPrintExtensionCB; + std::unique_ptr<weld::Widget> m_xPrintExtensionImg; std::unique_ptr<weld::CheckButton> m_xSaveGrfLocalCB; + std::unique_ptr<weld::Widget> m_xSaveGrfLocalImg; DECL_LINK(CheckBoxHdl_Impl, weld::Toggleable&, void); diff --git a/cui/uiconfig/ui/opthtmlpage.ui b/cui/uiconfig/ui/opthtmlpage.ui index 3ab74c532545..30ffc5a78a20 100644 --- a/cui/uiconfig/ui/opthtmlpage.ui +++ b/cui/uiconfig/ui/opthtmlpage.ui @@ -70,7 +70,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=7 --> + <!-- n-columns=3 n-rows=7 --> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -88,7 +88,7 @@ <property name="mnemonic-widget">size7</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">6</property> </packing> </child> @@ -105,7 +105,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">6</property> </packing> </child> @@ -118,7 +118,7 @@ <property name="mnemonic-widget">size6</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">5</property> </packing> </child> @@ -135,7 +135,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">5</property> </packing> </child> @@ -148,7 +148,7 @@ <property name="mnemonic-widget">size5</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">4</property> </packing> </child> @@ -165,7 +165,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">4</property> </packing> </child> @@ -178,7 +178,7 @@ <property name="mnemonic-widget">size4</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">3</property> </packing> </child> @@ -195,7 +195,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">3</property> </packing> </child> @@ -208,7 +208,7 @@ <property name="mnemonic-widget">size3</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">2</property> </packing> </child> @@ -225,7 +225,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">2</property> </packing> </child> @@ -238,7 +238,7 @@ <property name="mnemonic-widget">size2</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -255,7 +255,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">1</property> </packing> </child> @@ -268,7 +268,7 @@ <property name="mnemonic-widget">size1</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -285,10 +285,101 @@ </child> </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="locksize1"> + <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="locksize2"> + <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="locksize3"> + <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="locksize4"> + <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> + <child> + <object class="GtkImage" id="locksize5"> + <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">4</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locksize6"> + <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">5</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locksize7"> + <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">6</property> + </packing> + </child> </object> </child> <child type="label"> @@ -330,7 +421,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=3 --> + <!-- n-columns=2 n-rows=3 --> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -354,7 +445,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">2</property> </packing> </child> @@ -374,7 +465,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -394,10 +485,49 @@ </child> </object> <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locknumbersenglishus"> + <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="lockunknowntag"> + <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="lockignorefontnames"> + <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> </object> </child> <child type="label"> @@ -425,7 +555,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=4 --> + <!-- n-columns=2 n-rows=4 --> <object class="GtkGrid" id="grid3"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -449,7 +579,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">3</property> </packing> </child> @@ -469,7 +599,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">2</property> </packing> </child> @@ -490,7 +620,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -510,10 +640,62 @@ </child> </object> <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockstarbasic"> + <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="lockstarbasicwarning"> + <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="lockprintextension"> + <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="locksavegrflocal"> + <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"> |