summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>