diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-24 10:51:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-24 11:05:46 +0000 |
commit | 800857bcbb57bca59818660e2c8cfad12ad2243a (patch) | |
tree | e5623d76477213e35eabaf0996ccd8402ca6c4e3 /dbaccess/source/ui | |
parent | e4653eee7680831e6d0995d51d80fb63309c03ab (diff) |
convert dbwizard final page to .ui
Change-Id: Ib31810170574e46b84a9847b25585fee791d630d
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 87 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadminsetup.hrc | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadminsetup.src | 75 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 1 |
5 files changed, 37 insertions, 146 deletions
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index a911493aafff..82c019478c96 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -752,51 +752,22 @@ using namespace ::com::sun::star; } - OFinalDBPageSetup::OFinalDBPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_FINAL), _rCoreAttrs ) - , m_aFTFinalHeader (this, ModuleRes(FT_FINALHEADER)) - , m_aFTFinalHelpText (this, ModuleRes(FT_FINALHELPTEXT)) - , m_aRBRegisterDataSource (this, ModuleRes(RB_REGISTERDATASOURCE)) - , m_aRBDontregisterDataSource (this, ModuleRes(RB_DONTREGISTERDATASOURCE)) - , m_aFTAdditionalSettings (this, ModuleRes(FT_ADDITIONALSETTINGS)) - , m_aCBOpenAfterwards (this, ModuleRes(CB_OPENAFTERWARDS)) - , m_aCBStartTableWizard (this, ModuleRes(CB_STARTTABLEWIZARD)) - , m_aFTFinalText (this, ModuleRes(FT_FINALTEXT)) - { - - SetControlFontWeight(&m_aFTFinalHeader); - m_aCBOpenAfterwards.SetClickHdl(LINK(this, OFinalDBPageSetup, OnOpenSelected)); - m_aCBStartTableWizard.SetClickHdl(getControlModifiedLink()); - m_aRBRegisterDataSource.SetState(sal_True); - FreeResource(); + OFinalDBPageSetup::OFinalDBPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs) + : OGenericAdministrationPage(pParent, "PageFinal", + "dbaccess/ui/finalpagewizard.ui", _rCoreAttrs) + { + get(m_pFTFinalHeader, "headerText"); + get(m_pFTFinalHelpText, "helpText"); + get(m_pRBRegisterDataSource, "yesregister"); + get(m_pRBDontregisterDataSource, "noregister"); + get(m_pFTAdditionalSettings, "additionalText"); + get(m_pCBOpenAfterwards, "openediting"); + get(m_pCBStartTableWizard, "usewizard"); + get(m_pFTFinalText, "finishText"); - sal_Int32 nUnrelatedHeight = LogicToPixel( Size( 0, UNRELATED_CONTROLS ), MAP_APPFONT ).Height(); - sal_Int32 nRelatedHeight = LogicToPixel( Size( 0, RELATED_CONTROLS ), MAP_APPFONT ).Height(); - - ::std::pair<Window*,sal_Int32> pWindows[] = { - ::std::pair<Window*,sal_Int32>(&m_aFTFinalHelpText,nRelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aRBRegisterDataSource,nRelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aRBDontregisterDataSource,nUnrelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aFTAdditionalSettings,nRelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aCBOpenAfterwards,nRelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aCBStartTableWizard,nUnrelatedHeight) - ,::std::pair<Window*,sal_Int32>(&m_aFTFinalText,nUnrelatedHeight) - }; - - Point aPos(m_aFTFinalHeader.GetPosPixel()); - Size aStart(m_aFTFinalHeader.GetSizePixel()); - aPos.Y() += aStart.Height() + nUnrelatedHeight; - sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); - for (sal_Int32 i=0; i < nCount; ++i) - { - aPos.X() = pWindows[i].first->GetPosPixel().X(); - Size aSize = pWindows[i].first->GetSizePixel(); - FixedText* pText = dynamic_cast<FixedText*>(pWindows[i].first); - if ( pText ) - aSize = pText->CalcMinimumSize(aSize.Width()); - pWindows[i].first->SetPosSizePixel(aPos,aSize); - aPos.Y() += aSize.Height() + pWindows[i].second; - } + m_pCBOpenAfterwards->SetClickHdl(LINK(this, OFinalDBPageSetup, OnOpenSelected)); + m_pCBStartTableWizard->SetClickHdl(getControlModifiedLink()); + m_pRBRegisterDataSource->SetState(sal_True); } OFinalDBPageSetup::~OFinalDBPageSetup() @@ -806,43 +777,43 @@ using namespace ::com::sun::star; sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered() { - return m_aRBRegisterDataSource.IsChecked() && m_aRBRegisterDataSource.IsEnabled(); + return m_pRBRegisterDataSource->IsChecked() && m_pRBRegisterDataSource->IsEnabled(); } sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeOpened() { - return m_aCBOpenAfterwards.IsChecked() && m_aCBOpenAfterwards.IsEnabled(); + return m_pCBOpenAfterwards->IsChecked() && m_pCBOpenAfterwards->IsEnabled(); } sal_Bool OFinalDBPageSetup::IsTableWizardToBeStarted() { - return m_aCBStartTableWizard.IsChecked() && m_aCBStartTableWizard.IsEnabled(); + return m_pCBStartTableWizard->IsChecked() && m_pCBStartTableWizard->IsEnabled(); } void OFinalDBPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalHeader)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalHelpText)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTAdditionalSettings)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTFinalText)); + _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHeader)); + _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHelpText)); + _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTAdditionalSettings)); + _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalText)); } void OFinalDBPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { - _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBOpenAfterwards)); - _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBStartTableWizard)); - _rControlList.push_back(new OSaveValueWrapper<RadioButton>(&m_aRBRegisterDataSource)); - _rControlList.push_back(new OSaveValueWrapper<RadioButton>(&m_aRBDontregisterDataSource)); + _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBOpenAfterwards)); + _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBStartTableWizard)); + _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBRegisterDataSource)); + _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBDontregisterDataSource)); } void OFinalDBPageSetup::implInitControls(const SfxItemSet& /*_rSet*/, sal_Bool /*_bSaveValue*/) { - m_aCBOpenAfterwards.Check(); + m_pCBOpenAfterwards->Check(); } void OFinalDBPageSetup::enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation) { - m_aCBStartTableWizard.Enable(_bSupportsTableCreation); + m_pCBStartTableWizard->Enable(_bSupportsTableCreation); } sal_Bool OFinalDBPageSetup::FillItemSet( SfxItemSet& /*_rSet*/ ) @@ -851,7 +822,7 @@ using namespace ::com::sun::star; } IMPL_LINK(OFinalDBPageSetup, OnOpenSelected, CheckBox*, _pBox) { - m_aCBStartTableWizard.Enable( _pBox->IsEnabled() && _pBox->IsChecked() ); + m_pCBStartTableWizard->Enable( _pBox->IsEnabled() && _pBox->IsChecked() ); callModifiedHdl(); // outta here return 0L; diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index aa6f58f50024..f2e850284abb 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -262,14 +262,14 @@ namespace dbaui virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet); - FixedText m_aFTFinalHeader; - FixedText m_aFTFinalHelpText; - RadioButton m_aRBRegisterDataSource; - RadioButton m_aRBDontregisterDataSource; - FixedText m_aFTAdditionalSettings; - CheckBox m_aCBOpenAfterwards; - CheckBox m_aCBStartTableWizard; - FixedText m_aFTFinalText; + FixedText* m_pFTFinalHeader; + FixedText* m_pFTFinalHelpText; + RadioButton* m_pRBRegisterDataSource; + RadioButton* m_pRBDontregisterDataSource; + FixedText* m_pFTAdditionalSettings; + CheckBox* m_pCBOpenAfterwards; + CheckBox* m_pCBStartTableWizard; + FixedText* m_pFTFinalText; OFinalDBPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs); sal_Bool IsDatabaseDocumentToBeRegistered(); diff --git a/dbaccess/source/ui/dlg/dbadminsetup.hrc b/dbaccess/source/ui/dlg/dbadminsetup.hrc index 7d5af5eb6f07..04154606c296 100644 --- a/dbaccess/source/ui/dlg/dbadminsetup.hrc +++ b/dbaccess/source/ui/dlg/dbadminsetup.hrc @@ -83,10 +83,6 @@ #define FT_AUTHENTIFICATIONHEADERTEXT 8 #define FT_LDAP_HEADERTEXT 9 #define FT_GENERALUSERNAME 10 -#define FT_FINALHEADER 11 -#define FT_FINALTEXT 12 -#define FT_FINALHELPTEXT 13 -#define FT_ADDITIONALSETTINGS 14 #define FT_SETUP_WIZARD_HEADER 15 #define FT_SETUP_WIZARD_HELP 16 diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src index 9680a0899dbb..b5de1bbff45b 100644 --- a/dbaccess/source/ui/dlg/dbadminsetup.src +++ b/dbaccess/source/ui/dlg/dbadminsetup.src @@ -241,81 +241,6 @@ TabPage PAGE_DBWIZARD_AUTHENTIFICATION }; }; - -TabPage PAGE_DBWIZARD_FINAL -{ - HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_FINAL"; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; - Hide = TRUE ; - - FixedText FT_FINALHEADER - { - Pos = MAP_APPFONT ( START_X , 8 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6 , 2* FIXEDTEXT_HEIGHT ) ; - Text[ en-US ] = "Decide how to proceed after saving the database"; - WordBreak = TRUE; - }; - - FixedText FT_FINALHELPTEXT - { - Pos = MAP_APPFONT (START_X , 27 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6, 2*FIXEDTEXT_HEIGHT ) ; - Text[ en-US ] = "Do you want the wizard to register the database in %PRODUCTNAME?" ; - WordBreak = TRUE ; - }; - - RadioButton RB_REGISTERDATASOURCE - { - HelpId = HID_PAGE_DBWIZARD_FINAL_RB_REGISTERDATASOURCE; - Pos = MAP_APPFONT (START_X + 6 , 45 ) ; - Size = MAP_APPFONT ( 205 , 9 ) ; - Group = TRUE; - Text[ en-US ] = "~Yes, register the database for me" ; - }; - - RadioButton RB_DONTREGISTERDATASOURCE - { - HelpId = HID_PAGE_DBWIZARD_FINAL_RB_DONTREGISTERDATASOURCE ; - Pos = MAP_APPFONT (START_X + 6, 57 ) ; - Size = MAP_APPFONT ( 208 , 8 ) ; - Text[ en-US ] = "N~o, do not register the database" ; - }; - - FixedText FT_ADDITIONALSETTINGS - { - Pos = MAP_APPFONT (START_X , 100 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6 , 8 ) ; - Text[ en-US ] = "After the database file has been saved, what do you want to do?" ; - }; - - CheckBox CB_OPENAFTERWARDS - { - HelpId = HID_PAGE_DBWIZARD_FINAL_CB_OPENAFTERWARDS ; - Pos = MAP_APPFONT (START_X + 6, 118 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X , 8 ) ; - Text[ en-US ] = "Open the database for editing" ; - }; - - CheckBox CB_STARTTABLEWIZARD - { - HelpId = HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD ; - Pos = MAP_APPFONT (START_X + 6, 130 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 12 , 8 ) ; - Text[ en-US ] = "Create tables using the table wizard" ; - }; - - - FixedText FT_FINALTEXT - { - Pos = MAP_APPFONT ( START_X , 173 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6 , 2* FIXEDTEXT_HEIGHT ) ; - Text[ en-US ] = "Click 'Finish' to save the database."; - WordBreak = TRUE; - }; -}; - TabPage PAGE_DBWIZARD_MYSQL_JDBC { HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_JDBC"; diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index bbe093ec6b46..f7ac4f26f83f 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -138,7 +138,6 @@ #define PAGE_DBWIZARD_SPREADSHEET RID_PAGE_START + 52 #define PAGE_DBWIZARD_AUTHENTIFICATION RID_PAGE_START + 53 #define PAGE_DBWIZARD_MYSQL_JDBC RID_PAGE_START + 54 -#define PAGE_DBWIZARD_FINAL RID_PAGE_START + 55 #define PAGE_DBWIZARD_USERDEFINED RID_PAGE_START + 56 #define PAGE_DBWIZARD_MYSQL_NATIVE RID_PAGE_START + 57 |