Kaydet (Commit) 33b76785 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld OLDAPDetailsPage

Change-Id: I9477a52419db08812ccef95107c410685449fa6c
Reviewed-on: https://gerrit.libreoffice.org/62285
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst fad334d7
...@@ -757,24 +757,21 @@ namespace dbaui ...@@ -757,24 +757,21 @@ namespace dbaui
} }
// OLDAPDetailsPage // OLDAPDetailsPage
OLDAPDetailsPage::OLDAPDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) OLDAPDetailsPage::OLDAPDetailsPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs)
:OCommonBehaviourTabPage(pParent, "LDAP", "dbaccess/ui/ldappage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::NONE) : DBOCommonBehaviourTabPage(pParent, "dbaccess/ui/ldappage.ui", "LDAP",
{ rCoreAttrs, OCommonBehaviourTabPageFlags::NONE)
get(m_pETBaseDN, "baseDNEntry"); , m_xETBaseDN(m_xBuilder->weld_entry("baseDNEntry"))
get(m_pCBUseSSL, "useSSLCheckbutton"); , m_xCBUseSSL(m_xBuilder->weld_check_button("useSSLCheckbutton"))
get(m_pNFPortNumber, "portNumberSpinbutton"); , m_xNFPortNumber(m_xBuilder->weld_spin_button("portNumberSpinbutton"))
m_pNFPortNumber->SetUseThousandSep(false); , m_xNFRowCount(m_xBuilder->weld_spin_button("LDAPRowCountspinbutton"))
get(m_pNFRowCount, "LDAPRowCountspinbutton"); {
m_xETBaseDN->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl));
m_xNFPortNumber->connect_value_changed(LINK(this,OGenericAdministrationPage,OnControlSpinButtonModifyHdl));
m_xNFRowCount->connect_value_changed(LINK(this,OGenericAdministrationPage,OnControlSpinButtonModifyHdl));
m_pETBaseDN->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl));
m_pCBUseSSL->SetToggleHdl( LINK(this, OGenericAdministrationPage, ControlModifiedCheckBoxHdl) );
m_pNFPortNumber->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl));
m_pNFRowCount->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl));
m_pNFRowCount->SetUseThousandSep(false);
m_iNormalPort = 389; m_iNormalPort = 389;
m_iSSLPort = 636; m_iSSLPort = 636;
m_pCBUseSSL->SetClickHdl(LINK(this, OLDAPDetailsPage,OnCheckBoxClick)); m_xCBUseSSL->connect_toggled(LINK(this, OLDAPDetailsPage, OnCheckBoxClick));
} }
OLDAPDetailsPage::~OLDAPDetailsPage() OLDAPDetailsPage::~OLDAPDetailsPage()
...@@ -782,45 +779,35 @@ namespace dbaui ...@@ -782,45 +779,35 @@ namespace dbaui
disposeOnce(); disposeOnce();
} }
void OLDAPDetailsPage::dispose() VclPtr<SfxTabPage> ODriversSettings::CreateLDAP(TabPageParent pParent, const SfxItemSet* _rAttrSet)
{
m_pETBaseDN.clear();
m_pCBUseSSL.clear();
m_pNFPortNumber.clear();
m_pNFRowCount.clear();
OCommonBehaviourTabPage::dispose();
}
VclPtr<SfxTabPage> ODriversSettings::CreateLDAP( TabPageParent pParent, const SfxItemSet* _rAttrSet )
{ {
return VclPtr<OLDAPDetailsPage>::Create( pParent.pParent, *_rAttrSet ); return VclPtr<OLDAPDetailsPage>::Create(pParent, *_rAttrSet);
} }
bool OLDAPDetailsPage::FillItemSet( SfxItemSet* _rSet ) bool OLDAPDetailsPage::FillItemSet( SfxItemSet* _rSet )
{ {
bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); bool bChangedSomething = DBOCommonBehaviourTabPage::FillItemSet(_rSet);
fillString(*_rSet,m_pETBaseDN,DSID_CONN_LDAP_BASEDN,bChangedSomething); fillString(*_rSet,m_xETBaseDN.get(),DSID_CONN_LDAP_BASEDN,bChangedSomething);
fillInt32(*_rSet,m_pNFPortNumber,DSID_CONN_LDAP_PORTNUMBER,bChangedSomething); fillInt32(*_rSet,m_xNFPortNumber.get(),DSID_CONN_LDAP_PORTNUMBER,bChangedSomething);
fillInt32(*_rSet,m_pNFRowCount,DSID_CONN_LDAP_ROWCOUNT,bChangedSomething); fillInt32(*_rSet,m_xNFRowCount.get(),DSID_CONN_LDAP_ROWCOUNT,bChangedSomething);
fillBool(*_rSet,m_pCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething); fillBool(*_rSet,m_xCBUseSSL.get(),DSID_CONN_LDAP_USESSL,false,bChangedSomething);
return bChangedSomething; return bChangedSomething;
} }
IMPL_LINK( OLDAPDetailsPage, OnCheckBoxClick, Button*, pCheckBox, void )
IMPL_LINK(OLDAPDetailsPage, OnCheckBoxClick, weld::ToggleButton&, rCheckBox, void)
{ {
OnControlModifiedButtonClick(rCheckBox);
callModifiedHdl(); callModifiedHdl();
if ( pCheckBox == m_pCBUseSSL) if (m_xCBUseSSL->get_active())
{ {
if ( m_pCBUseSSL->IsChecked() ) m_iNormalPort = m_xNFPortNumber->get_value();
{ m_xNFPortNumber->set_value(m_iSSLPort);
m_iNormalPort = static_cast<sal_Int32>(m_pNFPortNumber->GetValue()); }
m_pNFPortNumber->SetValue(m_iSSLPort); else
} {
else m_iSSLPort = m_xNFPortNumber->get_value();
{ m_xNFPortNumber->set_value(m_iNormalPort);
m_iSSLPort = static_cast<sal_Int32>(m_pNFPortNumber->GetValue());
m_pNFPortNumber->SetValue(m_iNormalPort);
}
} }
} }
...@@ -837,13 +824,13 @@ namespace dbaui ...@@ -837,13 +824,13 @@ namespace dbaui
if ( bValid ) if ( bValid )
{ {
m_pETBaseDN->SetText(pBaseDN->GetValue()); m_xETBaseDN->set_text(pBaseDN->GetValue());
m_pNFPortNumber->SetValue(pPortNumber->GetValue()); m_xNFPortNumber->set_value(pPortNumber->GetValue());
m_pNFRowCount->SetValue(pRowCount->GetValue()); m_xNFRowCount->set_value(pRowCount->GetValue());
m_pCBUseSSL->Check(pUseSSL->GetValue()); m_xCBUseSSL->set_active(pUseSSL->GetValue());
} }
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); DBOCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
} }
// OTextDetailsPage // OTextDetailsPage
......
...@@ -263,25 +263,25 @@ namespace dbaui ...@@ -263,25 +263,25 @@ namespace dbaui
}; };
// OOdbcDetailsPage // OOdbcDetailsPage
class OLDAPDetailsPage : public OCommonBehaviourTabPage class OLDAPDetailsPage : public DBOCommonBehaviourTabPage
{ {
public: public:
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override; virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
OLDAPDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); OLDAPDetailsPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
virtual ~OLDAPDetailsPage() override; virtual ~OLDAPDetailsPage() override;
virtual void dispose() override;
protected: protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
private: private:
VclPtr<Edit> m_pETBaseDN; sal_Int32 m_iSSLPort;
VclPtr<CheckBox> m_pCBUseSSL; sal_Int32 m_iNormalPort;
VclPtr<NumericField> m_pNFPortNumber;
VclPtr<NumericField> m_pNFRowCount; std::unique_ptr<weld::Entry> m_xETBaseDN;
std::unique_ptr<weld::CheckButton> m_xCBUseSSL;
std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
std::unique_ptr<weld::SpinButton> m_xNFRowCount;
sal_Int32 m_iSSLPort; DECL_LINK(OnCheckBoxClick, weld::ToggleButton&, void);
sal_Int32 m_iNormalPort;
DECL_LINK( OnCheckBoxClick, Button*, void );
}; };
// OTextDetailsPage // OTextDetailsPage
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.22.1 -->
<interface domain="dba"> <interface domain="dba">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkBox" id="LDAP"> <object class="GtkBox" id="LDAP">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -35,10 +45,10 @@ ...@@ -35,10 +45,10 @@
<object class="GtkLabel" id="label1"> <object class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="ldappage|label1">_Base DN:</property> <property name="label" translatable="yes" context="ldappage|label1">_Base DN:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">baseDNEntry</property> <property name="mnemonic_widget">baseDNEntry</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -50,6 +60,7 @@ ...@@ -50,6 +60,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
...@@ -76,10 +87,10 @@ ...@@ -76,10 +87,10 @@
<object class="GtkLabel" id="label2"> <object class="GtkLabel" id="label2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="ldappage|label2">_Port number:</property> <property name="label" translatable="yes" context="ldappage|label2">_Port number:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">portNumberSpinbutton</property> <property name="mnemonic_widget">portNumberSpinbutton</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -91,6 +102,8 @@ ...@@ -91,6 +102,8 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
...@@ -101,10 +114,10 @@ ...@@ -101,10 +114,10 @@
<object class="GtkLabel" id="label3"> <object class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" context="ldappage|label3">Maximum number of _records:</property> <property name="label" translatable="yes" context="ldappage|label3">Maximum number of _records:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">LDAPRowCountspinbutton</property> <property name="mnemonic_widget">LDAPRowCountspinbutton</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -116,6 +129,8 @@ ...@@ -116,6 +129,8 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment