sc/source/ui/inc/opredlin.hxx | 4 + sc/source/ui/optdlg/opredlin.cxx | 13 ++++++ sc/uiconfig/scalc/ui/optchangespage.ui | 70 ++++++++++++++++++++++++++++----- 3 files changed, 78 insertions(+), 9 deletions(-)
New commits: commit 60cb604efe742a69b0e701515324833e300043c1 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Fri Dec 8 18:34:13 2023 +0100 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Sun Dec 10 17:57:54 2023 +0100 tdf#158470 - UI: Part 52 - Unify lockdown behavior of Options dialog for Calc - Changes Page. Change-Id: I2d352915b2804411f0bbee62c967de77ad4bbba7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160496 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx index 4cd5660be4df..b31504212ae3 100644 --- a/sc/source/ui/inc/opredlin.hxx +++ b/sc/source/ui/inc/opredlin.hxx @@ -25,9 +25,13 @@ class ColorListBox; class ScRedlineOptionsTabPage : public SfxTabPage { std::unique_ptr<ColorListBox> m_xContentColorLB; + std::unique_ptr<weld::Widget> m_xContentColorImg; std::unique_ptr<ColorListBox> m_xRemoveColorLB; + std::unique_ptr<weld::Widget> m_xRemoveColorImg; std::unique_ptr<ColorListBox> m_xInsertColorLB; + std::unique_ptr<weld::Widget> m_xInsertColorImg; std::unique_ptr<ColorListBox> m_xMoveColorLB; + std::unique_ptr<weld::Widget> m_xMoveColorImg; public: ScRedlineOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet ); diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx index 5aa904536433..9d3c1835dfc3 100644 --- a/sc/source/ui/optdlg/opredlin.cxx +++ b/sc/source/ui/optdlg/opredlin.cxx @@ -25,6 +25,7 @@ #include <scmod.hxx> #include <docsh.hxx> #include <svx/svxids.hrc> +#include <officecfg/Office/Calc.hxx> #include <opredlin.hxx> @@ -32,12 +33,16 @@ ScRedlineOptionsTabPage::ScRedlineOptionsTabPage(weld::Container* pPage, weld::D : SfxTabPage(pPage, pController, "modules/scalc/ui/optchangespage.ui", "OptChangesPage", &rSet) , m_xContentColorLB(new ColorListBox(m_xBuilder->weld_menu_button("changes"), [this]{ return GetDialogController()->getDialog(); })) + , m_xContentColorImg(m_xBuilder->weld_widget("lockchanges")) , m_xRemoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button("deletions"), [this]{ return GetDialogController()->getDialog(); })) + , m_xRemoveColorImg(m_xBuilder->weld_widget("lockdeletions")) , m_xInsertColorLB(new ColorListBox(m_xBuilder->weld_menu_button("entries"), [this]{ return GetDialogController()->getDialog(); })) + , m_xInsertColorImg(m_xBuilder->weld_widget("lockentries")) , m_xMoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button("insertions"), [this]{ return GetDialogController()->getDialog(); })) + , m_xMoveColorImg(m_xBuilder->weld_widget("lockinsertions")) { m_xContentColorLB->SetSlotId(SID_AUTHOR_COLOR); m_xRemoveColorLB->SetSlotId(SID_AUTHOR_COLOR); @@ -105,15 +110,23 @@ void ScRedlineOptionsTabPage::Reset( const SfxItemSet* /* rSet */ ) Color nColor = aAppOptions.GetTrackContentColor(); m_xContentColorLB->SelectEntry(nColor); + m_xContentColorLB->set_sensitive(!officecfg::Office::Calc::Revision::Color::Change::isReadOnly()); + m_xContentColorImg->set_visible(officecfg::Office::Calc::Revision::Color::Change::isReadOnly()); nColor = aAppOptions.GetTrackMoveColor(); m_xMoveColorLB->SelectEntry(nColor); + m_xMoveColorLB->set_sensitive(!officecfg::Office::Calc::Revision::Color::Insertion::isReadOnly()); + m_xMoveColorImg->set_visible(officecfg::Office::Calc::Revision::Color::Insertion::isReadOnly()); nColor = aAppOptions.GetTrackInsertColor(); m_xInsertColorLB->SelectEntry(nColor); + m_xInsertColorLB->set_sensitive(!officecfg::Office::Calc::Revision::Color::MovedEntry::isReadOnly()); + m_xInsertColorImg->set_visible(officecfg::Office::Calc::Revision::Color::MovedEntry::isReadOnly()); nColor = aAppOptions.GetTrackDeleteColor(); m_xRemoveColorLB->SelectEntry(nColor); + m_xRemoveColorLB->set_sensitive(!officecfg::Office::Calc::Revision::Color::Deletion::isReadOnly()); + m_xRemoveColorImg->set_visible(officecfg::Office::Calc::Revision::Color::Deletion::isReadOnly()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/uiconfig/scalc/ui/optchangespage.ui b/sc/uiconfig/scalc/ui/optchangespage.ui index a8a9a85cc5de..8bd34036dbe8 100644 --- a/sc/uiconfig/scalc/ui/optchangespage.ui +++ b/sc/uiconfig/scalc/ui/optchangespage.ui @@ -16,7 +16,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="grid1"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -35,7 +35,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> @@ -49,7 +49,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> @@ -63,7 +63,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> @@ -77,7 +77,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> @@ -99,7 +99,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">0</property> </packing> </child> @@ -121,7 +121,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">1</property> </packing> </child> @@ -143,7 +143,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">3</property> </packing> </child> @@ -165,10 +165,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="lockchanges"> + <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="lockdeletions"> + <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="lockinsertions"> + <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="lockentries"> + <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">