21#include <officecfg/Office/Linguistic.hxx>
26using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool;
32 :
SfxTabPage(pPage, pController,
"cui/ui/langtoolconfigpage.ui",
"OptLangToolPage", &
rSet)
33 , m_xBaseURLED(m_xBuilder->weld_entry(
"baseurl"))
34 , m_xUsernameED(m_xBuilder->weld_entry(
"username"))
35 , m_xApiKeyED(m_xBuilder->weld_entry(
"apikey"))
36 , m_xRestProtocol(m_xBuilder->weld_entry(
"restprotocol"))
37 , m_xActivateBox(m_xBuilder->weld_check_button(
"activate"))
38 , m_xSSLDisableVerificationBox(m_xBuilder->weld_check_button(
"verifyssl"))
39 , m_xApiSettingsFrame(m_xBuilder->weld_frame(
"apisettings"))
55 if (bEnable != LanguageToolCfg::IsEnabled::get())
58 LanguageToolCfg::IsEnabled::set(bEnable, batch);
68 EnableControls(m_xActivateBox->get_active());
74 OUString aBaseURL = LanguageToolCfg::BaseURL::get().value_or(
"");
75 if (aBaseURL.isEmpty())
80 m_xUsernameED->set_text(LanguageToolCfg::Username::get().value_or(
""));
81 m_xApiKeyED->set_text(LanguageToolCfg::ApiKey::get().value_or(
""));
82 m_xRestProtocol->set_text(LanguageToolCfg::RestProtocol::get().value_or(
""));
92 if (aBaseURL.isEmpty())
95 LanguageToolCfg::BaseURL::set(aBaseURL, batch);
97 LanguageToolCfg::Username::set(
m_xUsernameED->get_text(), batch);
98 LanguageToolCfg::ApiKey::set(
m_xApiKeyED->get_text(), batch);
109 return std::make_unique<OptLanguageToolTabPage>(pPage, pController, *rAttrSet);
std::unique_ptr< weld::CheckButton > m_xActivateBox
std::unique_ptr< weld::Entry > m_xRestProtocol
virtual ~OptLanguageToolTabPage() override
std::unique_ptr< weld::CheckButton > m_xSSLDisableVerificationBox
std::unique_ptr< weld::Frame > m_xApiSettingsFrame
OptLanguageToolTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::Entry > m_xBaseURLED
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xUsernameED
void EnableControls(bool bEnable)
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xApiKeyED
static std::shared_ptr< ConfigurationChanges > create()
OUString CuiResId(TranslateId aKey)
#define LINK(Instance, Class, Member)