[Libreoffice-commits] core.git: dbaccess/source dbaccess/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 24 15:11:31 UTC 2018


 dbaccess/source/ui/dlg/detailpages.cxx  |   69 +++++++++++++-------------------
 dbaccess/source/ui/dlg/detailpages.hxx  |   15 +++---
 dbaccess/uiconfig/ui/userdetailspage.ui |   22 ++++++----
 3 files changed, 51 insertions(+), 55 deletions(-)

New commits:
commit fbc37c3bed19e629a55df43f7fc2f985766dab5f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 24 09:04:30 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 24 17:11:03 2018 +0200

    weld OUserDriverDetailsPage
    
    Change-Id: I05db75b90dbb4302f968f129437630adb47a35a8
    Reviewed-on: https://gerrit.libreoffice.org/62288
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 88d07213d6a2..f733a5a1e902 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -414,17 +414,16 @@ namespace dbaui
         DBOCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
     }
     // OOdbcDetailsPage
-    OUserDriverDetailsPage::OUserDriverDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs )
-        : OCommonBehaviourTabPage(pParent, "UserDetailsPage", "dbaccess/ui/userdetailspage.ui", _rCoreAttrs,
-            OCommonBehaviourTabPageFlags::UseCharset | OCommonBehaviourTabPageFlags::UseOptions)
-    {
-        get(m_pFTHostname, "hostnameft");
-        get(m_pEDHostname, "hostname");
-        get(m_pPortNumber, "portnumberft");
-        get(m_pNFPortNumber, "portnumber");
-        m_pNFPortNumber->SetUseThousandSep(false);
-        get(m_pUseCatalog, "usecatalog");
-        m_pUseCatalog->SetToggleHdl( LINK(this, OGenericAdministrationPage, ControlModifiedCheckBoxHdl) );
+    OUserDriverDetailsPage::OUserDriverDetailsPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs)
+        : DBOCommonBehaviourTabPage(pParent, "dbaccess/ui/userdetailspage.ui", "UserDetailsPage",
+                                    rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset | OCommonBehaviourTabPageFlags::UseOptions)
+        , m_xFTHostname(m_xBuilder->weld_label("hostnameft"))
+        , m_xEDHostname(m_xBuilder->weld_entry("hostname"))
+        , m_xPortNumber(m_xBuilder->weld_label("portnumberft"))
+        , m_xNFPortNumber(m_xBuilder->weld_spin_button("portnumber"))
+        , m_xUseCatalog(m_xBuilder->weld_check_button("usecatalog"))
+    {
+        m_xUseCatalog->connect_toggled(LINK(this, OGenericAdministrationPage, OnControlModifiedButtonClick));
     }
 
     OUserDriverDetailsPage::~OUserDriverDetailsPage()
@@ -432,43 +431,33 @@ namespace dbaui
         disposeOnce();
     }
 
-    void OUserDriverDetailsPage::dispose()
-    {
-        m_pFTHostname.clear();
-        m_pEDHostname.clear();
-        m_pPortNumber.clear();
-        m_pNFPortNumber.clear();
-        m_pUseCatalog.clear();
-        OCommonBehaviourTabPage::dispose();
-    }
-
-    VclPtr<SfxTabPage> ODriversSettings::CreateUser( TabPageParent pParent, const SfxItemSet* _rAttrSet )
+    VclPtr<SfxTabPage> ODriversSettings::CreateUser(TabPageParent pParent, const SfxItemSet* pAttrSet)
     {
-        return VclPtr<OUserDriverDetailsPage>::Create( pParent.pParent, *_rAttrSet );
+        return VclPtr<OUserDriverDetailsPage>::Create(pParent, *pAttrSet);
     }
 
     bool OUserDriverDetailsPage::FillItemSet( SfxItemSet* _rSet )
     {
-        bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet);
+        bool bChangedSomething = DBOCommonBehaviourTabPage::FillItemSet(_rSet);
 
-        fillInt32(*_rSet,m_pNFPortNumber,DSID_CONN_PORTNUMBER,bChangedSomething);
-        fillString(*_rSet,m_pEDHostname,DSID_CONN_HOSTNAME,bChangedSomething);
-        fillBool(*_rSet,m_pUseCatalog,DSID_USECATALOG,bChangedSomething);
+        fillInt32(*_rSet,m_xNFPortNumber.get(),DSID_CONN_PORTNUMBER,bChangedSomething);
+        fillString(*_rSet,m_xEDHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
+        fillBool(*_rSet,m_xUseCatalog.get(),DSID_USECATALOG,false,bChangedSomething);
 
         return bChangedSomething;
     }
     void OUserDriverDetailsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        OCommonBehaviourTabPage::fillControls(_rControlList);
-        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pEDHostname));
-        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pUseCatalog));
-        _rControlList.emplace_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
+        DBOCommonBehaviourTabPage::fillControls(_rControlList);
+        _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xEDHostname.get()));
+        _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::CheckButton>(m_xUseCatalog.get()));
+        _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
     }
     void OUserDriverDetailsPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        OCommonBehaviourTabPage::fillWindows(_rControlList);
-        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHostname));
-        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pPortNumber));
+        DBOCommonBehaviourTabPage::fillWindows(_rControlList);
+        _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHostname.get()));
+        _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xPortNumber.get()));
     }
     void OUserDriverDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
     {
@@ -482,16 +471,16 @@ namespace dbaui
 
         if ( bValid )
         {
-            m_pEDHostname->SetText(pHostName->GetValue());
-            m_pEDHostname->ClearModifyFlag();
+            m_xEDHostname->set_text(pHostName->GetValue());
+            m_xEDHostname->save_value();
 
-            m_pNFPortNumber->SetValue(pPortNumber->GetValue());
-            m_pNFPortNumber->ClearModifyFlag();
+            m_xNFPortNumber->set_value(pPortNumber->GetValue());
+            m_xNFPortNumber->save_value();
 
-            m_pUseCatalog->Check(pUseCatalogItem->GetValue());
+            m_xUseCatalog->set_active(pUseCatalogItem->GetValue());
         }
 
-        OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
+        DBOCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
     }
     // OMySQLODBCDetailsPage
     OMySQLODBCDetailsPage::OMySQLODBCDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs )
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index e309310c93c2..8b9c86dbb39e 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -175,24 +175,23 @@ namespace dbaui
     };
 
     // OUserDriverDetailsPage
-    class OUserDriverDetailsPage : public OCommonBehaviourTabPage
+    class OUserDriverDetailsPage : public DBOCommonBehaviourTabPage
     {
     public:
         virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
 
-        OUserDriverDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
+        OUserDriverDetailsPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
         virtual ~OUserDriverDetailsPage() override;
-        virtual void dispose() override;
     protected:
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
         virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     private:
-        VclPtr<FixedText>          m_pFTHostname;
-        VclPtr<Edit>               m_pEDHostname;
-        VclPtr<FixedText>          m_pPortNumber;
-        VclPtr<NumericField>       m_pNFPortNumber;
-        VclPtr<CheckBox>           m_pUseCatalog;
+        std::unique_ptr<weld::Label> m_xFTHostname;
+        std::unique_ptr<weld::Entry> m_xEDHostname;
+        std::unique_ptr<weld::Label> m_xPortNumber;
+        std::unique_ptr<weld::SpinButton> m_xNFPortNumber;
+        std::unique_ptr<weld::CheckButton> m_xUseCatalog;
     };
 
     // OMySQLODBCDetailsPage
diff --git a/dbaccess/uiconfig/ui/userdetailspage.ui b/dbaccess/uiconfig/ui/userdetailspage.ui
index 3d892300e5a7..a40dae743cd6 100644
--- a/dbaccess/uiconfig/ui/userdetailspage.ui
+++ b/dbaccess/uiconfig/ui/userdetailspage.ui
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="dba">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
+  <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="GtkBox" id="UserDetailsPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -36,11 +40,11 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="halign">start</property>
-                    <property name="xalign">1</property>
                     <property name="label" translatable="yes" context="userdetailspage|hostnameft">_Host name:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">hostname</property>
                     <property name="ellipsize">end</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -52,10 +56,10 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="halign">start</property>
-                    <property name="xalign">1</property>
                     <property name="label" translatable="yes" context="userdetailspage|portnumberft">_Port number:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">portnumber</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -67,6 +71,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hexpand">True</property>
+                    <property name="activates_default">True</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -78,6 +83,8 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hexpand">True</property>
+                    <property name="activates_default">True</property>
+                    <property name="adjustment">adjustment1</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -105,10 +112,10 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="halign">start</property>
-                    <property name="xalign">1</property>
                     <property name="label" translatable="yes" context="userdetailspage|optionslabel">_Driver settings:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">options</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -120,6 +127,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hexpand">True</property>
+                    <property name="activates_default">True</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -171,10 +179,10 @@
                   <object class="GtkLabel" id="charsetlabel">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">1</property>
                     <property name="label" translatable="yes" context="userdetailspage|charsetlabel">_Character set:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">charset</property>
+                    <property name="xalign">1</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -183,7 +191,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="dbulo-CharSetListBox" id="charset">
+                  <object class="GtkComboBoxText" id="charset">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="hexpand">True</property>


More information about the Libreoffice-commits mailing list