summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2022-07-04 19:52:49 +0300
committerAndras Timar <andras.timar@collabora.com>2023-01-28 10:55:04 +0100
commit53d0c957d3bc178248c6bead508622098fb03050 (patch)
treed6de8d97fd3025fae2ffb8544f11f52904f2346f /cui
parent88a4096ab1fafa3cb0fdb1638b946b4fb4a76ecc (diff)
Added option to disable ssl verification for languagetool
This will allow to use self-signed certificates with local run languagetool APIs Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I2bda575fa6174dfc0f6c24da45267ee732643db6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136811 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145604 Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optlanguagetool.cxx4
-rw-r--r--cui/source/options/optlanguagetool.hxx1
-rw-r--r--cui/uiconfig/ui/langtoolconfigpage.ui239
3 files changed, 131 insertions, 113 deletions
diff --git a/cui/source/options/optlanguagetool.cxx b/cui/source/options/optlanguagetool.cxx
index 309ff2a09b52..f0006d1dd0e0 100644
--- a/cui/source/options/optlanguagetool.cxx
+++ b/cui/source/options/optlanguagetool.cxx
@@ -31,6 +31,7 @@ OptLanguageToolTabPage::OptLanguageToolTabPage(weld::Container* pPage,
, m_xUsernameED(m_xBuilder->weld_entry("username"))
, m_xApiKeyED(m_xBuilder->weld_entry("apikey"))
, m_xActivateBox(m_xBuilder->weld_check_button("activate"))
+ , m_xSSLDisableVerificationBox(m_xBuilder->weld_check_button("verifyssl"))
, m_xApiSettingsFrame(m_xBuilder->weld_frame("apisettings"))
{
m_xActivateBox->connect_toggled(LINK(this, OptLanguageToolTabPage, CheckHdl));
@@ -51,6 +52,7 @@ void OptLanguageToolTabPage::EnableControls(bool bEnable)
rLanguageOpts.setEnabled(bEnable);
m_xApiSettingsFrame->set_visible(bEnable);
m_xActivateBox->set_active(bEnable);
+ m_xSSLDisableVerificationBox->set_active(rLanguageOpts.getSSLVerification() != true);
}
IMPL_LINK_NOARG(OptLanguageToolTabPage, CheckHdl, weld::Toggleable&, void)
@@ -71,6 +73,7 @@ void OptLanguageToolTabPage::Reset(const SfxItemSet*)
m_xUsernameED->set_text(rLanguageOpts.getUsername());
m_xApiKeyED->set_text(rLanguageOpts.getApiKey());
+ m_xSSLDisableVerificationBox->set_active(rLanguageOpts.getSSLVerification() != true);
}
bool OptLanguageToolTabPage::FillItemSet(SfxItemSet*)
@@ -86,6 +89,7 @@ bool OptLanguageToolTabPage::FillItemSet(SfxItemSet*)
rLanguageOpts.setUsername(m_xUsernameED->get_text());
rLanguageOpts.setApiKey(m_xApiKeyED->get_text());
+ rLanguageOpts.setSSLVerification(m_xSSLDisableVerificationBox->get_active() != true);
return false;
}
diff --git a/cui/source/options/optlanguagetool.hxx b/cui/source/options/optlanguagetool.hxx
index 8ee83ed4e367..666512804c62 100644
--- a/cui/source/options/optlanguagetool.hxx
+++ b/cui/source/options/optlanguagetool.hxx
@@ -39,6 +39,7 @@ private:
std::unique_ptr<weld::Entry> m_xUsernameED;
std::unique_ptr<weld::Entry> m_xApiKeyED;
std::unique_ptr<weld::CheckButton> m_xActivateBox;
+ std::unique_ptr<weld::CheckButton> m_xSSLDisableVerificationBox;
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 38aa184c2469..237040fa76b7 100644
--- a/cui/uiconfig/ui/langtoolconfigpage.ui
+++ b/cui/uiconfig/ui/langtoolconfigpage.ui
@@ -76,16 +76,130 @@
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_spacing">5</property>
- <property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="base">
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|base">Base URL:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">baseurl</property>
+ <property name="row_spacing">5</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="base">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|base">Base URL:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">baseurl</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="baseurl">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="usernamelbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|usernamelbl">User name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">username</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="apikeylbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|apikeylbl">API key:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">apikey</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="username">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="apikey">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="urldesc">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|urldesc">Please use the base URL e.g. without "/check" at the end.</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="usernamedesc">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|usernamedesc">Your LanguageTool account's username for premium usage.</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="apikeydesc">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" context="langtoolconfigpage|apikeydesc">Your LanguageTool account's api key for premium usage.</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -93,121 +207,20 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="baseurl">
+ <object class="GtkCheckButton" id="verifyssl">
+ <property name="label" translatable="yes" context="langtoolconfigpage|verifyssl">Disable SSL Certificate Verification</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="truncate-multiline">True</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="usernamelbl">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|usernamelbl">Username:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">username</property>
+ <property name="margin_top">5</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="apikeylbl">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|apikeylbl">API key:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">apikey</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="username">
- <property name="visible">True</property>
- <property name="truncate-multiline">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="apikey">
- <property name="visible">True</property>
- <property name="truncate-multiline">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="urldesc">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|urldesc">Please use the base URL, i.e., without “/check”, at the end.</property>
- <attributes>
- <attribute name="scale" value="0.9"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="usernamedesc">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|usernamedesc">Your LanguageTool account’s username for premium usage.</property>
- <attributes>
- <attribute name="scale" value="0.9"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="apikeydesc">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="langtoolconfigpage|apikeydesc">Your LanguageTool account’s API key for premium usage.</property>
- <attributes>
- <attribute name="scale" value="0.9"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
<child type="label">