summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-11-04 12:05:15 +0100
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-11-06 10:17:28 +0100
commit16737129e072a766ba58afddae4a992ad61cec6f (patch)
tree75f39f4f863af7a33dd94c6928a4096f2765abe4 /cui
parent019917b1451bc3f39ea9259df48e68cb098a0402 (diff)
tdf#158002 - UI: Part 19 - Unify lockdown behavior of Options dialog
for LanguageTool Page. Change-Id: Ib1255dd7a67eae7e9c1f2cf6da984ba614f3453a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158931 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optlanguagetool.cxx24
-rw-r--r--cui/source/options/optlanguagetool.hxx6
-rw-r--r--cui/uiconfig/ui/langtoolconfigpage.ui130
3 files changed, 143 insertions, 17 deletions
diff --git a/cui/source/options/optlanguagetool.cxx b/cui/source/options/optlanguagetool.cxx
index fab94987a32d..8c56a40e728f 100644
--- a/cui/source/options/optlanguagetool.cxx
+++ b/cui/source/options/optlanguagetool.cxx
@@ -31,11 +31,17 @@ OptLanguageToolTabPage::OptLanguageToolTabPage(weld::Container* pPage,
const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "cui/ui/langtoolconfigpage.ui", "OptLangToolPage", &rSet)
, m_xBaseURLED(m_xBuilder->weld_entry("baseurl"))
+ , m_xBaseURLImg(m_xBuilder->weld_widget("lockbaseurl"))
, m_xUsernameED(m_xBuilder->weld_entry("username"))
+ , m_xUsernameImg(m_xBuilder->weld_widget("lockusername"))
, m_xApiKeyED(m_xBuilder->weld_entry("apikey"))
+ , m_xApiKeyImg(m_xBuilder->weld_widget("lockapikey"))
, m_xRestProtocol(m_xBuilder->weld_entry("restprotocol"))
+ , m_xRestProtocolImg(m_xBuilder->weld_widget("lockrestprotocol"))
, m_xActivateBox(m_xBuilder->weld_check_button("activate"))
+ , m_xActivateBoxImg(m_xBuilder->weld_widget("lockactivate"))
, m_xSSLDisableVerificationBox(m_xBuilder->weld_check_button("verifyssl"))
+ , m_xSSLDisableVerificationBoxImg(m_xBuilder->weld_widget("lockverifyssl"))
, m_xApiSettingsFrame(m_xBuilder->weld_frame("apisettings"))
{
m_xActivateBox->connect_toggled(LINK(this, OptLanguageToolTabPage, CheckHdl));
@@ -60,7 +66,11 @@ void OptLanguageToolTabPage::EnableControls(bool bEnable)
}
m_xApiSettingsFrame->set_visible(bEnable);
m_xActivateBox->set_active(bEnable);
+ m_xActivateBox->set_sensitive(!LanguageToolCfg::IsEnabled::isReadOnly());
+ m_xActivateBoxImg->set_visible(LanguageToolCfg::IsEnabled::isReadOnly());
m_xSSLDisableVerificationBox->set_active(!LanguageToolCfg::SSLCertVerify::get());
+ m_xSSLDisableVerificationBox->set_sensitive(!LanguageToolCfg::SSLCertVerify::isReadOnly());
+ m_xSSLDisableVerificationBoxImg->set_visible(LanguageToolCfg::SSLCertVerify::isReadOnly());
}
IMPL_LINK_NOARG(OptLanguageToolTabPage, CheckHdl, weld::Toggleable&, void)
@@ -77,10 +87,24 @@ void OptLanguageToolTabPage::Reset(const SfxItemSet*)
else
m_xBaseURLED->set_text(aBaseURL);
+ m_xBaseURLED->set_sensitive(!LanguageToolCfg::BaseURL::isReadOnly());
+ m_xBaseURLImg->set_visible(LanguageToolCfg::BaseURL::isReadOnly());
+
m_xUsernameED->set_text(LanguageToolCfg::Username::get().value_or(""));
+ m_xUsernameED->set_sensitive(!LanguageToolCfg::Username::isReadOnly());
+ m_xUsernameImg->set_visible(LanguageToolCfg::Username::isReadOnly());
+
m_xApiKeyED->set_text(LanguageToolCfg::ApiKey::get().value_or(""));
+ m_xApiKeyED->set_sensitive(!LanguageToolCfg::ApiKey::isReadOnly());
+ m_xApiKeyImg->set_visible(LanguageToolCfg::ApiKey::isReadOnly());
+
m_xRestProtocol->set_text(LanguageToolCfg::RestProtocol::get().value_or(""));
+ m_xRestProtocol->set_sensitive(!LanguageToolCfg::RestProtocol::isReadOnly());
+ m_xRestProtocolImg->set_visible(LanguageToolCfg::RestProtocol::isReadOnly());
+
m_xSSLDisableVerificationBox->set_active(!LanguageToolCfg::SSLCertVerify::get());
+ m_xSSLDisableVerificationBox->set_sensitive(!LanguageToolCfg::SSLCertVerify::isReadOnly());
+ m_xSSLDisableVerificationBoxImg->set_visible(LanguageToolCfg::SSLCertVerify::isReadOnly());
}
OUString OptLanguageToolTabPage::GetAllStrings()
diff --git a/cui/source/options/optlanguagetool.hxx b/cui/source/options/optlanguagetool.hxx
index 25781c612913..3e3c3e8da0c7 100644
--- a/cui/source/options/optlanguagetool.hxx
+++ b/cui/source/options/optlanguagetool.hxx
@@ -36,11 +36,17 @@ public:
private:
std::unique_ptr<weld::Entry> m_xBaseURLED;
+ std::unique_ptr<weld::Widget> m_xBaseURLImg;
std::unique_ptr<weld::Entry> m_xUsernameED;
+ std::unique_ptr<weld::Widget> m_xUsernameImg;
std::unique_ptr<weld::Entry> m_xApiKeyED;
+ std::unique_ptr<weld::Widget> m_xApiKeyImg;
std::unique_ptr<weld::Entry> m_xRestProtocol;
+ std::unique_ptr<weld::Widget> m_xRestProtocolImg;
std::unique_ptr<weld::CheckButton> m_xActivateBox;
+ std::unique_ptr<weld::Widget> m_xActivateBoxImg;
std::unique_ptr<weld::CheckButton> m_xSSLDisableVerificationBox;
+ std::unique_ptr<weld::Widget> m_xSSLDisableVerificationBoxImg;
std::unique_ptr<weld::Frame> m_xApiSettingsFrame;
void EnableControls(bool bEnable);
diff --git a/cui/uiconfig/ui/langtoolconfigpage.ui b/cui/uiconfig/ui/langtoolconfigpage.ui
index 03da9968b0e1..98da2f9c88e6 100644
--- a/cui/uiconfig/ui/langtoolconfigpage.ui
+++ b/cui/uiconfig/ui/langtoolconfigpage.ui
@@ -17,7 +17,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="grid0">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -39,7 +39,7 @@
</child>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
@@ -54,7 +54,7 @@
<property name="uri">https://languagetool.org/legal/privacy</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
@@ -68,10 +68,29 @@
<property name="draw-indicator">True</property>
</object>
<packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="lockactivate">
+ <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>
</object>
</child>
<child type="label">
@@ -98,7 +117,7 @@
<property name="label-xalign">0</property>
<property name="shadow-type">none</property>
<child>
- <!-- n-columns=2 n-rows=9 -->
+ <!-- n-columns=3 n-rows=9 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -117,7 +136,7 @@
<property name="mnemonic-widget">baseurl</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
@@ -129,7 +148,7 @@
<property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
@@ -143,7 +162,7 @@
<property name="mnemonic-widget">username</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
@@ -157,7 +176,7 @@
<property name="mnemonic-widget">apikey</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
@@ -168,7 +187,7 @@
<property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">2</property>
</packing>
</child>
@@ -179,7 +198,7 @@
<property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">4</property>
</packing>
</child>
@@ -199,7 +218,7 @@
</child>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">1</property>
</packing>
</child>
@@ -219,7 +238,7 @@
</child>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">3</property>
</packing>
</child>
@@ -239,7 +258,7 @@
</child>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">5</property>
</packing>
</child>
@@ -253,7 +272,7 @@
<property name="mnemonic-widget">restprotocol</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
@@ -264,7 +283,7 @@
<property name="truncate-multiline">True</property>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">6</property>
</packing>
</child>
@@ -284,7 +303,7 @@
</child>
</object>
<packing>
- <property name="left-attach">1</property>
+ <property name="left-attach">2</property>
<property name="top-attach">7</property>
</packing>
</child>
@@ -298,12 +317,89 @@
<property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left-attach">0</property>
+ <property name="left-attach">1</property>
<property name="top-attach">8</property>
<property name="width">2</property>
</packing>
</child>
<child>
+ <object class="GtkImage" id="lockbaseurl">
+ <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="lockusername">
+ <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="lockapikey">
+ <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="lockrestprotocol">
+ <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>
+ <child>
+ <object class="GtkImage" id="lockverifyssl">
+ <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">8</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<placeholder/>
</child>
<child>