summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorPalenik Mihály <palenik.mihaly@gmail.com>2014-08-06 12:50:18 +0200
committerDavid Tardon <dtardon@redhat.com>2014-08-06 12:58:55 +0000
commitf71d65f39eac01374bb96d63054444a7b21bd4fc (patch)
tree0545ba4e9c804a1f85569de1cec4c662a6b30dba /dbaccess
parent942f1ed93c4e26e883b7d1d3ee6b729ef72cec67 (diff)
Convert PAGE_ODBC to .ui
Change-Id: I23dfbeb7a1a5ed0c8c51d925a1c0d11daca75f3f Reviewed-on: https://gerrit.libreoffice.org/10787 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.src34
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx30
-rw-r--r--dbaccess/source/ui/dlg/detailpages.hxx5
-rw-r--r--dbaccess/uiconfig/ui/odbcpage.ui178
5 files changed, 185 insertions, 63 deletions
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index 3373b84610a3..2ab2a6656740 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/migratepage \
dbaccess/uiconfig/ui/mysqlnativepage \
dbaccess/uiconfig/ui/mysqlnativesettings \
+ dbaccess/uiconfig/ui/odbcpage \
dbaccess/uiconfig/ui/parametersdialog \
dbaccess/uiconfig/ui/password \
dbaccess/uiconfig/ui/preparepage \
diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src
index 7d38b0ac4d66..f81b75a20462 100644
--- a/dbaccess/source/ui/dlg/dbadmin.src
+++ b/dbaccess/source/ui/dlg/dbadmin.src
@@ -87,40 +87,6 @@ TabPage PAGE_ADO
AUTO_CHARSET(UNRELATED_CONTROLS,PAGE_X)
};
-TabPage PAGE_ODBC
-{
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ;
- Hide = TRUE;
- HelpId = HID_DSADMIN_PAGE_ODBC;
-
- AUTO_CHARSET(UNRELATED_CONTROLS,PAGE_X)
- FixedLine FL_SEPARATOR1
- {
- Pos = MAP_APPFONT ( 4 , 2*UNRELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT + RELATED_CONTROLS ) ;
- Size = MAP_APPFONT ( PAGE_X - 8 , FIXEDTEXT_HEIGHT ) ;
- Text[ en-US ] = "Optional Settings";
- };
-
- FixedText FT_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 2*UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS) ;
- Size = MAP_APPFONT ( EDIT_X - 7 , FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "ODBC ~options" ;
- };
- Edit ET_OPTIONS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( EDIT_X , 2*UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS -1 ) ;
- Size = MAP_APPFONT ( 130 , EDIT_HEIGHT ) ;
- TabStop = TRUE ;
- HelpId = HID_DSADMIN_ODBC_OPTIONS;
- };
-
- AUTO_USECATALOG( 3*UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS )
-};
-
TabPage PAGE_MYSQL_ODBC
{
HelpID = "dbaccess:TabPage:PAGE_MYSQL_ODBC";
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 3bcedeb83a17..0664f1e90653 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -336,20 +336,10 @@ namespace dbaui
// OOdbcDetailsPage
OOdbcDetailsPage::OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
- :OCommonBehaviourTabPage(pParent, PAGE_ODBC, _rCoreAttrs, CBTP_USE_CHARSET | CBTP_USE_OPTIONS,false)
- ,m_aFL_1 (this, ModuleRes(FL_SEPARATOR1))
- ,m_aUseCatalog (this, ModuleRes(CB_USECATALOG))
+ :OCommonBehaviourTabPage(pParent, "ODBC", "dbaccess/ui/odbcpage.ui", _rCoreAttrs, CBTP_USE_CHARSET | CBTP_USE_OPTIONS)
{
- m_aUseCatalog.SetToggleHdl(getControlModifiedLink());
- FreeResource();
-
- Window* pWindows[] = { m_pCharsetLabel, m_pCharset
- ,m_pOptionsLabel,m_pOptions,&m_aUseCatalog
- };
-
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
- for (sal_Int32 i=1; i < nCount; ++i)
- pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
+ get(m_pUseCatalog, "useCatalogCheckbutton");
+ m_pUseCatalog->SetToggleHdl(getControlModifiedLink());
}
SfxTabPage* ODriversSettings::CreateODBC( Window* pParent, const SfxItemSet* _rAttrSet )
@@ -360,19 +350,9 @@ namespace dbaui
bool OOdbcDetailsPage::FillItemSet( SfxItemSet* _rSet )
{
bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet);
- fillBool(*_rSet,&m_aUseCatalog,DSID_USECATALOG,bChangedSomething);
+ fillBool(*_rSet,m_pUseCatalog,DSID_USECATALOG,bChangedSomething);
return bChangedSomething;
}
- void OOdbcDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
- {
- OCommonBehaviourTabPage::fillControls(_rControlList);
- _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aUseCatalog));
- }
- void OOdbcDetailsPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
- {
- OCommonBehaviourTabPage::fillWindows(_rControlList);
- _rControlList.push_back(new ODisableWrapper<FixedLine>(&m_aFL_1));
- }
void OOdbcDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
{
// check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
@@ -382,7 +362,7 @@ namespace dbaui
SFX_ITEMSET_GET(_rSet, pUseCatalogItem, SfxBoolItem, DSID_USECATALOG, true);
if ( bValid )
- m_aUseCatalog.Check(pUseCatalogItem->GetValue());
+ m_pUseCatalog->Check(pUseCatalogItem->GetValue());
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
}
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index f91388cbfe18..282ca26387af 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -133,11 +133,8 @@ namespace dbaui
OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
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:
- FixedLine m_aFL_1;
- CheckBox m_aUseCatalog;
+ CheckBox* m_pUseCatalog;
};
// OUserDriverDetailsPage
diff --git a/dbaccess/uiconfig/ui/odbcpage.ui b/dbaccess/uiconfig/ui/odbcpage.ui
new file mode 100644
index 000000000000..8fb8fb80a822
--- /dev/null
+++ b/dbaccess/uiconfig/ui/odbcpage.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkBox" id="ODBC">
+ <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="GtkBox" id="box3">
+ <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="optionslabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">ODBC _options</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">options</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="options">
+ <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>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="useCatalogCheckbutton">
+ <property name="label" translatable="yes">Use catalog for file-based databases</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">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>
+ </object>
+</interface>