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

Palenik Mihály palenik.mihaly at gmail.com
Wed Aug 6 05:05:50 PDT 2014


 dbaccess/UIConfig_dbaccess.mk          |    1 
 dbaccess/source/ui/dlg/dbadmin.hrc     |    3 
 dbaccess/source/ui/dlg/dbadmin.src     |   45 --------
 dbaccess/source/ui/dlg/detailpages.cxx |   41 ++-----
 dbaccess/source/ui/dlg/detailpages.hxx |   10 -
 dbaccess/uiconfig/ui/dbasepage.ui      |  172 +++++++++++++++++++++++++++++++++
 6 files changed, 188 insertions(+), 84 deletions(-)

New commits:
commit 1ff594ce98e9620578975decad1c6df382de82a4
Author: Palenik Mihály <palenik.mihaly at gmail.com>
Date:   Wed Aug 6 00:00:02 2014 +0200

    Convert PAGE_DBASE to .ui
    
    Change-Id: Ie2f1592b030465a2ca5e2f25408ae38e9a833831
    Reviewed-on: https://gerrit.libreoffice.org/10777
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 0ac73bf..1fdbaa9 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
     dbaccess/uiconfig/ui/connectionpage \
     dbaccess/uiconfig/ui/copytablepage \
     dbaccess/uiconfig/ui/dbaseindexdialog \
+    dbaccess/uiconfig/ui/dbasepage \
     dbaccess/uiconfig/ui/dbwizconnectionpage \
     dbaccess/uiconfig/ui/dbwizmysqlintropage \
     dbaccess/uiconfig/ui/dbwizmysqlnativepage \
diff --git a/dbaccess/source/ui/dlg/dbadmin.hrc b/dbaccess/source/ui/dlg/dbadmin.hrc
index 75d39b6..d097204 100644
--- a/dbaccess/source/ui/dlg/dbadmin.hrc
+++ b/dbaccess/source/ui/dlg/dbadmin.hrc
@@ -24,7 +24,6 @@
 
 #define FT_OPTIONS              5
 #define FT_JDBCDRIVERCLASS      7
-#define FT_SPECIAL_MESSAGE      8
 #define FT_HOSTNAME             10
 #define FT_BASEDN               11
 #define FT_PORTNUMBER           12
@@ -35,10 +34,8 @@
 #define ET_HOSTNAME             5
 #define ET_BASEDN               6
 
-#define PB_INDICIES             1
 #define PB_TESTDRIVERCLASS      5
 
-#define CB_SHOWDELETEDROWS      2
 #define CB_USESSL               3
 #define CB_USECATALOG           4
 
diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src
index 4e89db9..b3301a3 100644
--- a/dbaccess/source/ui/dlg/dbadmin.src
+++ b/dbaccess/source/ui/dlg/dbadmin.src
@@ -77,51 +77,6 @@ String STR_DATABASE_TYPE_CHANGE
     Text [ en-US ] = "Database properties" ;
 };
 
-TabPage PAGE_DBASE
-{
-    SVLook = TRUE ;
-    Hide = TRUE;
-    Pos = MAP_APPFONT ( 0 , 0 ) ;
-    Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ;
-    HelpId = HID_DSADMIN_PAGE_DBASE;
-
-    AUTO_CHARSET(UNRELATED_CONTROLS,PAGE_X)
-
-    FixedLine FL_SEPARATOR1
-    {
-        Pos = MAP_APPFONT ( 4 , 2*UNRELATED_CONTROLS + RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT) ;
-        Size = MAP_APPFONT ( PAGE_X - 8 , FIXEDTEXT_HEIGHT ) ;
-        Text[ en-US ] = "Optional settings";
-    };
-
-    CheckBox CB_SHOWDELETEDROWS
-    {
-        Pos = MAP_APPFONT ( 6 , 2*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT) ;
-        Size = MAP_APPFONT ( 200 , CHECKBOX_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpId = HID_DSADMIN_SHOWDELETED;
-        Text [ en-US ] = "Display deleted records as well" ;
-    };
-
-    FixedText FT_SPECIAL_MESSAGE
-    {
-        Hide = TRUE;
-        WordBreak = TRUE;
-        Pos = MAP_APPFONT ( 6 , 3*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + CHECKBOX_HEIGHT) ;
-        Size = MAP_APPFONT ( PAGE_X - 12 , 2*FIXEDTEXT_HEIGHT ) ;
-        Text [ en-US ] = "Note: When deleted, and thus inactive, records are displayed, you will not be able to delete records from the data source." ;
-    };
-
-    PushButton PB_INDICIES
-    {
-        Pos = MAP_APPFONT ( PAGE_X  - BUTTON_WIDTH - UNRELATED_CONTROLS, PAGE_Y - BUTTON_HEIGHT - UNRELATED_CONTROLS) ;
-        Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpId = HID_DSADMIN_DBASE_INDICIES;
-        Text [ en-US ] = "Indexes...";
-    };
-};
-
 TabPage PAGE_ADO
 {
     SVLook = TRUE ;
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 6d63fce..7b5c78a 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -247,20 +247,15 @@ namespace dbaui
 
     // ODbaseDetailsPage
     ODbaseDetailsPage::ODbaseDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
-        :OCommonBehaviourTabPage(pParent, PAGE_DBASE, _rCoreAttrs, CBTP_USE_CHARSET ,false)
-        ,m_aShowDeleted     (this, ModuleRes(CB_SHOWDELETEDROWS))
-        ,m_aFL_1            (this, ModuleRes( FL_SEPARATOR1) )
-        ,m_aFT_Message      (this, ModuleRes( FT_SPECIAL_MESSAGE) )
-        ,m_aIndexes         (this, ModuleRes(PB_INDICIES))
+        :OCommonBehaviourTabPage(pParent, "DbasePage", "dbaccess/ui/dbasepage.ui", _rCoreAttrs, CBTP_USE_CHARSET)
     {
+        get(m_pShowDeleted, "showDelRowsCheckbutton");
+        get(m_pFT_Message, "specMessageLabel");
+        get(m_pIndexes, "indiciesButton");
+        set_height_request(300);
 
-        m_aIndexes.SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked));
-        m_aShowDeleted.SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked));
-
-        // correct the z-order which is mixed-up because the base class constructed some controls before we did
-        m_pCharset->SetZOrder(&m_aShowDeleted, WINDOW_ZORDER_BEFOR);
-
-        FreeResource();
+        m_pIndexes->SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked));
+        m_pShowDeleted->SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked));
     }
 
     ODbaseDetailsPage::~ODbaseDetailsPage()
@@ -273,18 +268,6 @@ namespace dbaui
         return ( new ODbaseDetailsPage( pParent, *_rAttrSet ) );
     }
 
-    void ODbaseDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
-    {
-        OCommonBehaviourTabPage::fillControls(_rControlList);
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aShowDeleted));
-    }
-    void ODbaseDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
-    {
-        OCommonBehaviourTabPage::fillWindows(_rControlList);
-        _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFT_Message));
-        _rControlList.push_back(new ODisableWrapper<PushButton>(&m_aIndexes));
-    }
     void ODbaseDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
     {
         // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
@@ -303,8 +286,8 @@ namespace dbaui
 
         if ( bValid )
         {
-            m_aShowDeleted.Check( pDeletedItem->GetValue() );
-            m_aFT_Message.Show(m_aShowDeleted.IsChecked());
+            m_pShowDeleted->Check( pDeletedItem->GetValue() );
+            m_pFT_Message->Show(m_pShowDeleted->IsChecked());
         }
 
         OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
@@ -314,20 +297,20 @@ namespace dbaui
     {
         bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet);
 
-        fillBool(*_rSet,&m_aShowDeleted,DSID_SHOWDELETEDROWS,bChangedSomething);
+        fillBool(*_rSet,m_pShowDeleted,DSID_SHOWDELETEDROWS,bChangedSomething);
         return bChangedSomething;
     }
 
     IMPL_LINK( ODbaseDetailsPage, OnButtonClicked, Button*, pButton )
     {
-        if (&m_aIndexes == pButton)
+        if (m_pIndexes == pButton)
         {
             ODbaseIndexDialog aIndexDialog(this, m_sDsn);
             aIndexDialog.Execute();
         }
         else
         {
-            m_aFT_Message.Show(m_aShowDeleted.IsChecked());
+            m_pFT_Message->Show(m_pShowDeleted->IsChecked());
             // it was one of the checkboxes -> we count as modified from now on
             callModifiedHdl();
         }
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index 1db9ee8..323710e 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -97,11 +97,9 @@ namespace dbaui
 
         ODbaseDetailsPage(Window* pParent, const SfxItemSet& _rCoreAttrs);
     private:
-        // please add new controls also to <method>fillControls</method> or <method>fillWindows</method>
-        CheckBox            m_aShowDeleted;
-        FixedLine           m_aFL_1;
-        FixedText           m_aFT_Message;
-        PushButton          m_aIndexes;
+        CheckBox*           m_pShowDeleted;
+        FixedText*          m_pFT_Message;
+        PushButton*         m_pIndexes;
 
         OUString            m_sDsn;
 
@@ -111,8 +109,6 @@ namespace dbaui
 
     protected:
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
-        virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
-        virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
 
     private:
         DECL_LINK( OnButtonClicked, Button * );
diff --git a/dbaccess/uiconfig/ui/dbasepage.ui b/dbaccess/uiconfig/ui/dbasepage.ui
new file mode 100644
index 0000000..6c7826c
--- /dev/null
+++ b/dbaccess/uiconfig/ui/dbasepage.ui
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkBox" id="DbasePage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkBox" id="box1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="charsetlabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">_Character set</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">charset</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="dbulo-CharSetListBox" id="charset">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="charsetheader">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Data conversion</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkBox" id="box2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">2</property>
+                <child>
+                  <object class="GtkCheckButton" id="showDelRowsCheckbutton">
+                    <property name="label" translatable="yes">Display deleted records as well</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="specMessageLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Note: When deleted, and thus inactive, records are displayed, you will not be able to delete records from the data source.</property>
+                    <property name="wrap">True</property>
+                    <property name="max_width_chars">60</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Optional settings</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkButton" id="indiciesButton">
+        <property name="label" translatable="yes">Indexes...</property>
+        <property name="use_action_appearance">False</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="halign">end</property>
+        <property name="valign">end</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list