summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-01 21:50:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-08-02 09:45:11 +0200
commit620fff54ca9cd04459cc5d963ef94d4438129fe4 (patch)
tree302a6dc387edf44c582fd659ec3b6603c82f6532 /dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
parent6aaf6c4c5ad096ed11fc524ebe0540ba0a41c053 (diff)
weld OAuthentificationPageSetup
Change-Id: Ib5de669f22abeaae3716918702066ce608910874 Reviewed-on: https://gerrit.libreoffice.org/76830 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx')
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx58
1 files changed, 22 insertions, 36 deletions
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index d3f3d88205f5..c8a57500875e 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -709,53 +709,39 @@ using namespace ::com::sun::star;
return bChangedSomething;
}
- VclPtr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
{
return VclPtr<OAuthentificationPageSetup>::Create( pParent, _rAttrSet);
}
-
- OAuthentificationPageSetup::OAuthentificationPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs )
- :OGenericAdministrationPage(pParent, "AuthentificationPage", "dbaccess/ui/authentificationpage.ui", _rCoreAttrs )
+ OAuthentificationPageSetup::OAuthentificationPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs)
+ : OGenericAdministrationPage(pParent, "dbaccess/ui/authentificationpage.ui", "AuthentificationPage", _rCoreAttrs)
+ , m_xFTHelpText(m_xBuilder->weld_label("helptext"))
+ , m_xFTUserName(m_xBuilder->weld_label("generalUserNameLabel"))
+ , m_xETUserName(m_xBuilder->weld_entry("generalUserNameEntry"))
+ , m_xCBPasswordRequired(m_xBuilder->weld_check_button("passRequiredCheckbutton"))
+ , m_xPBTestConnection(m_xBuilder->weld_button("testConnectionButton"))
{
- get(m_pFTHelpText, "helptext");
- get(m_pFTUserName, "generalUserNameLabel");
- get(m_pETUserName, "generalUserNameEntry");
- get(m_pCBPasswordRequired, "passRequiredCheckbutton");
- get(m_pPBTestConnection, "testConnectionButton");
- m_pETUserName->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl));
- m_pCBPasswordRequired->SetClickHdl(LINK(this,OGenericAdministrationPage,OnControlModifiedClick));
- m_pPBTestConnection->SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl));
-
- LayoutHelper::fitSizeRightAligned( *m_pPBTestConnection );
+ m_xETUserName->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl));
+ m_xCBPasswordRequired->connect_toggled(LINK(this,OGenericAdministrationPage,OnControlModifiedButtonClick));
+ m_xPBTestConnection->connect_clicked(LINK(this,OGenericAdministrationPage,OnTestConnectionButtonClickHdl));
}
OAuthentificationPageSetup::~OAuthentificationPageSetup()
{
- disposeOnce();
- }
-
- void OAuthentificationPageSetup::dispose()
- {
- m_pFTHelpText.clear();
- m_pFTUserName.clear();
- m_pETUserName.clear();
- m_pCBPasswordRequired.clear();
- m_pPBTestConnection.clear();
- OGenericAdministrationPage::dispose();
}
void OAuthentificationPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
{
- _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
- _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTUserName));
- _rControlList.emplace_back(new ODisableWrapper<PushButton>(m_pPBTestConnection));
+ _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHelpText.get()));
+ _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTUserName.get()));
+ _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Button>(m_xPBTestConnection.get()));
}
void OAuthentificationPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
{
- _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETUserName));
- _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pCBPasswordRequired));
+ _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETUserName.get()));
+ _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::ToggleButton>(m_xCBPasswordRequired.get()));
}
void OAuthentificationPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
@@ -766,23 +752,23 @@ using namespace ::com::sun::star;
const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER);
const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
- m_pETUserName->SetText(pUidItem->GetValue());
- m_pCBPasswordRequired->Check(pAllowEmptyPwd->GetValue());
+ m_xETUserName->set_text(pUidItem->GetValue());
+ m_xCBPasswordRequired->set_active(pAllowEmptyPwd->GetValue());
- m_pETUserName->ClearModifyFlag();
+ m_xETUserName->save_value();
}
bool OAuthentificationPageSetup::FillItemSet( SfxItemSet* _rSet )
{
bool bChangedSomething = false;
- if (m_pETUserName->IsValueChangedFromSaved())
+ if (m_xETUserName->get_value_changed_from_saved())
{
- _rSet->Put(SfxStringItem(DSID_USER, m_pETUserName->GetText()));
+ _rSet->Put(SfxStringItem(DSID_USER, m_xETUserName->get_text()));
_rSet->Put(SfxStringItem(DSID_PASSWORD, OUString()));
bChangedSomething = true;
}
- fillBool(*_rSet,m_pCBPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething);
+ fillBool(*_rSet, m_xCBPasswordRequired.get(), DSID_PASSWORDREQUIRED, false, bChangedSomething);
return bChangedSomething;
}