diff options
-rw-r--r-- | dbaccess/UI_dbaccess.mk | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.hrc | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.src | 167 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwiz.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 26 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 562 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 178 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_dlg.hrc | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbwizsetup.hxx | 9 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/generalpagedialog.ui | 90 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/generalpagewizard.ui | 199 |
13 files changed, 726 insertions, 544 deletions
diff --git a/dbaccess/UI_dbaccess.mk b/dbaccess/UI_dbaccess.mk index 71c6ddc12d98..3468a40f03fa 100644 --- a/dbaccess/UI_dbaccess.mk +++ b/dbaccess/UI_dbaccess.mk @@ -11,6 +11,8 @@ $(eval $(call gb_UI_UI,dbaccess)) $(eval $(call gb_UI_add_uifiles,dbaccess, \ dbaccess/uiconfig/ui/querypropertiesdialog \ + dbaccess/uiconfig/ui/generalpagedialog \ + dbaccess/uiconfig/ui/generalpagewizard \ )) # vim: set noet sw=4 ts=4: diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 27ce0561fd2d..558dd9919a9f 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -155,8 +155,7 @@ namespace dbaui if (!aEnumeration.isLoaded()) { // show an error message - LocalResourceAccess aLocRes( PAGE_GENERAL, RSC_TABPAGE ); - String sError(ModuleRes(STR_COULDNOTLOAD_ODBCLIB)); + String sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) ); sError.SearchAndReplaceAscii("#lib#", aEnumeration.getLibraryName()); ErrorBox aDialog(this, WB_OK, sError); aDialog.Execute(); diff --git a/dbaccess/source/ui/dlg/dbadmin.hrc b/dbaccess/source/ui/dlg/dbadmin.hrc index 3a6ea77b755c..88bf91987c23 100644 --- a/dbaccess/source/ui/dlg/dbadmin.hrc +++ b/dbaccess/source/ui/dlg/dbadmin.hrc @@ -23,8 +23,8 @@ //======================================================================== // control ids -#define FT_DATATYPE 1 -#define FT_DATASOURCETYPE_PRE 2 + // FREE + // FREE #define FT_USERNAME 3 #define FT_PASSWORD 4 #define FT_OPTIONS 5 @@ -36,16 +36,6 @@ #define FT_BASEDN 11 #define FT_PORTNUMBER 12 #define FT_LDAPROWCOUNT 13 -#define FT_DATASOURCETYPE_POST 14 -#define FT_GENERALHEADERTEXT 15 -#define FT_GENERALHELPTEXT 16 -#define FT_DATATYPEAPPENDIX 17 -#define FT_DATASOURCEHEADER 18 -#define FT_DOCLISTLABEL 19 - -#define LB_DATATYPE 1 - // FREE -#define LB_DOCUMENTLIST 3 #define ET_USERNAME 1 #define ET_PASSWORD 2 @@ -59,7 +49,6 @@ #define BTN_PASSWORD_CANCEL 3 #define BTN_PASSWORD_HELP 4 #define PB_TESTDRIVERCLASS 5 -#define PB_OPENDOCUMENT 6 #define CB_PASSWORD_REQUIRED 1 #define CB_SHOWDELETEDROWS 2 @@ -75,20 +64,12 @@ #define NF_PORTNUMBER 1 #define NF_LDAPROWCOUNT 2 -#define RB_CREATEDBDATABASE 1 -#define RB_GETEXISTINGDATABASE 2 -#define RB_OPENEXISTINGDOC 3 - //======================================================================== // string ids (usually relative to other resources, that's why not necessarily unique) #define STR_PAGETITLE_GENERAL 1 #define STR_PAGETITLE_CONNECTION 2 #define STR_PAGETITLE_ADVANCED 3 -#define STR_MYSQLENTRY 5 -#define STR_PARENTTITLE 6 -#define STR_COULDNOTLOAD_ODBCLIB 7 -#define STR_UNSUPPORTED_DATASOURCE_TYPE 8 #endif // _DBAUI_DBADMIN_HRC_ diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index 4d59ad9bea5e..5d695b6917da 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -128,158 +128,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE Text [ en-US ] = "Database properties" ; }; -//------------------------------------------------------------------------- - -TabPage PAGE_GENERAL -{ - SVLook = TRUE ; - Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; - Hide = TRUE; - HelpId = HID_DSADMIN_PAGE_GENERAL; - - - FixedText FT_GENERALHEADERTEXT - { - Pos = MAP_APPFONT ( START_X , 8 ) ; - Size = MAP_APPFONT ( (WIZARD_PAGE_X - START_X) - 12 , 2 * FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Welcome to the %PRODUCTNAME Database Wizard"; - WordBreak = TRUE; - }; - - FixedText FT_GENERALHELPTEXT - { - Pos = MAP_APPFONT (START_X , 27 ); - Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6, 5* FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Use the Database Wizard to create a new database, open an existing database file, or connect to a database stored on a server." ; - WordBreak = TRUE ; - }; - - FixedText FT_DATASOURCEHEADER - { - Pos = MAP_APPFONT ( START_X , 73 ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - 12 , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "What do you want to do?"; - }; - - RadioButton RB_CREATEDBDATABASE - { - HelpId = HID_PAGE_DBWIZARD_GENERAL_RB_CREATEDBDATABASE ; - Pos = MAP_APPFONT (START_X + 6 , 85 ) ; - Size = MAP_APPFONT ( 205 , 10 ) ; - Group = TRUE; - Text [ en-US ] = "Create a n~ew database" ; - }; - - RadioButton RB_OPENEXISTINGDOC - { - HelpID = "dbaccess:RadioButton:PAGE_GENERAL:RB_OPENEXISTINGDOC"; - Pos = MAP_APPFONT (START_X + 6 , 97 ); - Size = MAP_APPFONT ( 206 , 8 ) ; - Text [ en-US ] = "Open an existing database ~file" ; - }; - - FixedText FT_DOCLISTLABEL - { - Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 110 ); - Size = MAP_APPFONT( 120, 8 ); - Text [ en-US ] = "Recently used"; - }; - - ListBox LB_DOCUMENTLIST - { - HelpID = "dbaccess:ListBox:PAGE_GENERAL:LB_DOCUMENTLIST"; - Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 121 ); - Size = MAP_APPFONT( 120, 14 ); - DropDown = TRUE; - Border = TRUE; - }; - - PushButton PB_OPENDOCUMENT - { - HelpID = "dbaccess:PushButton:PAGE_GENERAL:PB_OPENDOCUMENT"; - Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 139 ); - Size = MAP_APPFONT( 50, 16 ); - OutputSize = TRUE; - TabStop = TRUE; - }; - - RadioButton RB_GETEXISTINGDATABASE - { - HelpId = HID_PAGE_DBWIZARD_GENERAL_RB_GETEXISTINGDATABASE; - Pos = MAP_APPFONT (START_X + 6 , 159 ) ; - Size = MAP_APPFONT ( 206 , 8 ) ; - Text [ en-US ] = "Connect to an e~xisting database" ; - }; - - FixedText FT_DATASOURCETYPE_PRE - { - Pos = MAP_APPFONT ( 6 , UNRELATED_CONTROLS ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - 12 , 3*FIXEDTEXT_HEIGHT ) ; - WordBreak = TRUE; - Text [ en-US ] = "Select the type of database to which you want to establish a connection."; - }; - - FixedText FT_DATATYPE - { - Pos = MAP_APPFONT ( 6 , 2*UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + RELATED_CONTROLS) ; - Size = MAP_APPFONT ( 80 , FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Database ~type "; - }; - - ListBox LB_DATATYPE - { - HelpId = HID_DSADMIN_DSTYPE; - Pos = MAP_APPFONT ( 90, 2*UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + RELATED_CONTROLS -2 ) ; - Size = MAP_APPFONT ( 120, 120 ) ; - Border = TRUE ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = FALSE; - }; - - FixedText FT_DATATYPEAPPENDIX - { - Pos = MAP_APPFONT ( 90, 2*UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + RELATED_CONTROLS -2 + 72) ; - Size = MAP_APPFONT ( 60, 8 ); - Text [ en-US ] = "Database"; - }; - - FixedText FT_DATASOURCETYPE_POST - { - Pos = MAP_APPFONT ( 6 , 4*UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + RELATED_CONTROLS ) ; - Size = MAP_APPFONT ( WIZARD_PAGE_X - 12 , 5*FIXEDTEXT_HEIGHT ) ; - WordBreak = TRUE; - Text [ en-US ] = "On the following pages, you can make detailed settings for the connection.\n\nThe new settings you make will overwrite your existing settings."; - }; - - FixedText FT_SPECIAL_MESSAGE - { - Pos = MAP_APPFONT ( 6, 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS ); - Size = MAP_APPFONT ( WIZARD_PAGE_X - 12, 3*FIXEDTEXT_HEIGHT ); - WordBreak = TRUE; - HelpId = HID_DSADMIN_SPECIAL_MESSAGE; - }; - - String STR_MYSQLENTRY - { - Text [ en-US ] = "MySQL" ; - }; - - String STR_PARENTTITLE - { - Text [ en-US ] = "Data Source Properties: #" ; - }; - String STR_COULDNOTLOAD_ODBCLIB - { - Text [ en-US ] = "Could not load the program library #lib# or it is corrupted. The ODBC data source selection is not available."; - }; - String STR_UNSUPPORTED_DATASOURCE_TYPE - { - Text [ en-US ] = "This kind of data source is not supported on this platform.\nYou are allowed to change the settings, but you probably will not be able to connect to the database."; - }; - Text [ en-US ] = "General" ; -}; - //......................................................................... TabPage PAGE_DBASE @@ -656,9 +504,24 @@ TabPage PAGE_USERDRIVER AUTO_CHARSET( 4*UNRELATED_CONTROLS+ 3*FIXEDTEXT_HEIGHT + RELATED_CONTROLS, PAGE_X) }; +String STR_PARENTTITLE_GENERAL +{ + Text [ en-US ] = "Data Source Properties: #" ; +}; + String STR_ERR_USE_CONNECT_TO { Text [ en-US ] = "Please choose 'Connect to an existing database' to connect to an existing database instead."; }; +String STR_COULD_NOT_LOAD_ODBC_LIB +{ + Text [ en-US ] = "Could not load the program library #lib# or it is corrupted. The ODBC data source selection is not available."; +}; + +String STR_UNSUPPORTED_DATASOURCE_TYPE +{ + Text [ en-US ] = "This kind of data source is not supported on this platform.\nYou are allowed to change the settings, but you probably will not be able to connect to the database."; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 232ebff1f549..b8e5273be615 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -250,10 +250,9 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) { case START_PAGE: // start state { - pPage = OGeneralPage::Create(this,*m_pOutSet); + pPage = new OGeneralPageDialog(this,*m_pOutSet); OGeneralPage* pGeneralPage = static_cast< OGeneralPage* >( pPage ); pGeneralPage->SetTypeSelectHandler( LINK( this, ODbTypeWizDialog, OnTypeSelected)); -// pGeneralPage->SetCreationModeHandler( LINK( this, ODbTypeWizDialog, TODO ) ); nStringId = STR_PAGETITLE_GENERAL; } break; diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index a273fbd301a6..a0e8983c68f1 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -335,7 +335,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() { switch ( m_pGeneralPage->GetDatabaseCreationMode() ) { - case OGeneralPage::eCreateNew: + case OGeneralPageWizard::eCreateNew: { sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); if ( nCreateNewDBIndex == -1 ) @@ -347,7 +347,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() enableButtons( WZB_FINISH, sal_True); } break; - case OGeneralPage::eConnectExternal: + case OGeneralPageWizard::eConnectExternal: { ::rtl::OUString sOld = m_sURL; m_sURL = m_pGeneralPage->GetSelectedType(); @@ -360,7 +360,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() updateTypeDependentStates(); } break; - case OGeneralPage::eOpenExisting: + case OGeneralPageWizard::eOpenExisting: { activatePath( static_cast<PathId>(m_pCollection->size() + 1), sal_True ); enableButtons( WZB_FINISH, m_pGeneralPage->GetSelectedDocument().sURL.Len() != 0 ); @@ -370,7 +370,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() OSL_FAIL( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" ); } - enableButtons( WZB_NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPage::eOpenExisting ); + enableButtons( WZB_NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPageWizard::eOpenExisting ); // TODO: this should go into the base class. Point is, we activate a path whose *last* // step is also the current one. The base class should automatically disable // the Next button in such a case. However, not for this patch ... @@ -504,9 +504,9 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState) switch(_nState) { case PAGE_DBSETUPWIZARD_INTRO: - pFirstPage = OGeneralPage::Create(this,*m_pOutSet, sal_True); + pFirstPage = new OGeneralPageWizard(this,*m_pOutSet); pPage = static_cast<OGenericAdministrationPage*> (pFirstPage); - m_pGeneralPage = static_cast<OGeneralPage*>(pFirstPage); + m_pGeneralPage = static_cast<OGeneralPageWizard*>(pFirstPage); m_pGeneralPage->SetTypeSelectHandler(LINK(this, ODbTypeWizDialogSetup, OnTypeSelected)); m_pGeneralPage->SetCreationModeHandler(LINK( this, ODbTypeWizDialogSetup, OnChangeCreationMode ) ); m_pGeneralPage->SetDocumentSelectionHandler(LINK( this, ODbTypeWizDialogSetup, OnRecentDocumentSelected ) ); @@ -636,21 +636,21 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, _pMySQLInt } // ----------------------------------------------------------------------------- -IMPL_LINK(ODbTypeWizDialogSetup, OnChangeCreationMode, OGeneralPage*, /*_pGeneralPage*/) +IMPL_LINK(ODbTypeWizDialogSetup, OnChangeCreationMode, OGeneralPageWizard*, /*_pGeneralPage*/) { activateDatabasePath(); return sal_True; } // ----------------------------------------------------------------------------- -IMPL_LINK(ODbTypeWizDialogSetup, OnRecentDocumentSelected, OGeneralPage*, /*_pGeneralPage*/) +IMPL_LINK(ODbTypeWizDialogSetup, OnRecentDocumentSelected, OGeneralPageWizard*, /*_pGeneralPage*/) { enableButtons( WZB_FINISH, m_pGeneralPage->GetSelectedDocument().sURL.Len() != 0 ); return 0L; } // ----------------------------------------------------------------------------- -IMPL_LINK(ODbTypeWizDialogSetup, OnSingleDocumentChosen, OGeneralPage*, /*_pGeneralPage*/) +IMPL_LINK(ODbTypeWizDialogSetup, OnSingleDocumentChosen, OGeneralPageWizard*, /*_pGeneralPage*/) { if ( prepareLeaveCurrentState( eFinish ) ) onFinish(); @@ -738,7 +738,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() Reference< XModel > xModel( getDataSourceOrModel( xDatasource ), UNO_QUERY_THROW ); Reference< XStorable > xStore( xModel, UNO_QUERY_THROW ); - if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eCreateNew ) + if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eCreateNew ) CreateDatabase(); ::comphelper::NamedValueCollection aArgs( xModel->getArgs() ); @@ -780,7 +780,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() // ------------------------------------------------------------------------ sal_Bool ODbTypeWizDialogSetup::IsDatabaseDocumentToBeOpened() const { - if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eOpenExisting ) + if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting ) return sal_True; if ( m_pFinalPage != NULL ) @@ -792,7 +792,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() // ------------------------------------------------------------------------ sal_Bool ODbTypeWizDialogSetup::IsTableWizardToBeStarted() const { - if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eOpenExisting ) + if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting ) return sal_False; if ( m_pFinalPage != NULL ) @@ -1065,7 +1065,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() // ----------------------------------------------------------------------------- sal_Bool ODbTypeWizDialogSetup::onFinish() { - if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eOpenExisting ) + if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting ) { // we're not going to re-use the XModel we have - since the document the user // wants us to load could be a non-database document. Instead, we asynchronously diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 38f807dcd6a2..5117f2ec50bd 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -58,93 +58,32 @@ namespace dbaui //= OGeneralPage //========================================================================= //------------------------------------------------------------------------- - OGeneralPage::OGeneralPage(Window* pParent, const SfxItemSet& _rItems, sal_Bool _bDBWizardMode) - :OGenericAdministrationPage(pParent, ModuleRes(PAGE_GENERAL), _rItems) - ,m_aFTHeaderText (this, ModuleRes(FT_GENERALHEADERTEXT)) - ,m_aFTHelpText (this, ModuleRes(FT_GENERALHELPTEXT)) - ,m_aFT_DatasourceTypeHeader (this, ModuleRes(FT_DATASOURCEHEADER)) - ,m_aRB_CreateDatabase (this, ModuleRes(RB_CREATEDBDATABASE)) - ,m_aRB_OpenDocument (this, ModuleRes(RB_OPENEXISTINGDOC)) - ,m_aRB_GetExistingDatabase (this, ModuleRes(RB_GETEXISTINGDATABASE)) - ,m_aFT_DocListLabel (this, ModuleRes(FT_DOCLISTLABEL)) - ,m_pLB_DocumentList ( new OpenDocumentListBox( this, "com.sun.star.sdb.OfficeDatabaseDocument", ModuleRes( LB_DOCUMENTLIST ) ) ) - ,m_aPB_OpenDocument (this, "com.sun.star.sdb.OfficeDatabaseDocument", ModuleRes(PB_OPENDOCUMENT)) - ,m_aTypePreLabel (this, ModuleRes(FT_DATASOURCETYPE_PRE)) - ,m_aDatasourceTypeLabel (this, ModuleRes(FT_DATATYPE)) - ,m_pDatasourceType ( new ListBox(this, ModuleRes(LB_DATATYPE))) - ,m_aFTDataSourceAppendix (this, ModuleRes(FT_DATATYPEAPPENDIX)) - ,m_aTypePostLabel (this, ModuleRes(FT_DATASOURCETYPE_POST)) - ,m_aSpecialMessage (this, ModuleRes(FT_SPECIAL_MESSAGE)) - ,m_DBWizardMode (_bDBWizardMode) - ,m_sMySQLEntry (ModuleRes(STR_MYSQLENTRY)) - ,m_eOriginalCreationMode (eCreateNew) - ,m_pCollection (NULL) - ,m_eNotSupportedKnownType ( ::dbaccess::DST_UNKNOWN) - ,m_eLastMessage (smNone) - ,m_bDisplayingInvalid (sal_False) - ,m_bInitTypeList (true) - { - // fill the listbox with the UI descriptions for the possible types - // and remember the respective DSN prefixes - FreeResource(); + OGeneralPage::OGeneralPage( Window* pParent, const rtl::OUString& _rUIXMLDescription, const SfxItemSet& _rItems ) + :OGenericAdministrationPage( pParent, "PageGeneral", _rUIXMLDescription, _rItems ) + ,m_pSpecialMessage ( NULL ) + ,m_eNotSupportedKnownType ( ::dbaccess::DST_UNKNOWN ) + ,m_eLastMessage ( smNone ) + ,m_bDisplayingInvalid ( sal_False ) + ,m_bInitTypeList ( true ) + ,m_pDatasourceType ( NULL ) + ,m_pCollection ( NULL ) + { + get( m_pDatasourceType, "datasourceType" ); + get( m_pSpecialMessage, "specialMessage" ); + // extract the datasource type collection from the item set DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rItems.GetItem(DSID_TYPECOLLECTION)); if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); OSL_ENSURE(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); - // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option - sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); - if ( nCreateNewDBIndex == -1 ) - nCreateNewDBIndex = m_pCollection->getIndexOf( OUString("sdbc:dbase:") ); - bool bHideCreateNew = ( nCreateNewDBIndex == -1 ); - - // also, if our application policies tell us to hide the option, do it - ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithComponentContext( - ::comphelper::getProcessComponentContext(), - OUString("/org.openoffice.Office.DataAccess/Policies/Features/Base") - ) ); - sal_Bool bAllowCreateLocalDatabase( sal_True ); - OSL_VERIFY( aConfig.getNodeValue( "CreateLocalDatabase" ) >>= bAllowCreateLocalDatabase ); - if ( !bAllowCreateLocalDatabase ) - bHideCreateNew = true; - - if ( bHideCreateNew ) - { - m_aRB_CreateDatabase.Hide(); - Window* pWindowsToMove[] = { - &m_aRB_OpenDocument, &m_aRB_GetExistingDatabase, &m_aFT_DocListLabel, m_pLB_DocumentList.get(), - &m_aPB_OpenDocument, &m_aDatasourceTypeLabel, m_pDatasourceType.get(), &m_aFTDataSourceAppendix, - &m_aTypePostLabel - }; - const long nOffset = m_aRB_OpenDocument.GetPosPixel().Y() - m_aRB_CreateDatabase.GetPosPixel().Y(); - for ( size_t i=0; i < sizeof( pWindowsToMove ) / sizeof( pWindowsToMove[0] ); ++i ) - { - Point aPos( pWindowsToMove[i]->GetPosPixel() ); - aPos.Y() -= nOffset; - pWindowsToMove[i]->SetPosPixel( aPos ); - } - } - - if ( bHideCreateNew ) - m_aRB_GetExistingDatabase.Check(); - else - m_aRB_CreateDatabase.Check(); - // do some knittings m_pDatasourceType->SetSelectHdl(LINK(this, OGeneralPage, OnDatasourceTypeSelected)); - m_aRB_CreateDatabase.SetClickHdl(LINK(this, OGeneralPage, OnSetupModeSelected)); - m_aRB_GetExistingDatabase.SetClickHdl(LINK(this, OGeneralPage, OnSetupModeSelected)); - m_aRB_OpenDocument.SetClickHdl(LINK(this, OGeneralPage, OnSetupModeSelected)); - m_pLB_DocumentList->SetSelectHdl( LINK( this, OGeneralPage, OnDocumentSelected ) ); - m_aPB_OpenDocument.SetClickHdl( LINK( this, OGeneralPage, OnOpenDocument ) ); } //------------------------------------------------------------------------- OGeneralPage::~OGeneralPage() { - m_pDatasourceType.reset( NULL ); - m_pLB_DocumentList.reset( NULL ); } //------------------------------------------------------------------------- @@ -191,7 +130,7 @@ namespace dbaui { OUString sDisplayName = aTypeLoop.getDisplayName(); if ( m_pDatasourceType->GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND - && approveDataSourceType( sURLPrefix, sDisplayName ) ) + && approveDatasourceType( sURLPrefix, sDisplayName ) ) { aDisplayedTypes.push_back( DisplayedTypes::value_type( sURLPrefix, sDisplayName ) ); } @@ -208,41 +147,9 @@ namespace dbaui } } - - - //------------------------------------------------------------------------- - void OGeneralPage::setParentTitle(const OUString& _sURLPrefix) - { - if (!m_DBWizardMode) - { - const OUString sName = m_pCollection->getTypeDisplayName(_sURLPrefix); - if ( m_pAdminDialog ) - { - LocalResourceAccess aStringResAccess( PAGE_GENERAL, RSC_TABPAGE ); - OUString sMessage = OUString(ModuleRes(STR_PARENTTITLE)); - m_pAdminDialog->setTitle(sMessage.replaceAll("#",sName)); - } - } - } - //------------------------------------------------------------------------- - OGeneralPage::CreationMode OGeneralPage::GetDatabaseCreationMode() const + void OGeneralPage::setParentTitle(const OUString&) { - if ( m_aRB_CreateDatabase.IsChecked() ) - return eCreateNew; - if ( m_aRB_GetExistingDatabase.IsChecked() ) - return eConnectExternal; - return eOpenExisting; - } - - //------------------------------------------------------------------------- - void OGeneralPage::GetFocus() - { - OGenericAdministrationPage::GetFocus(); - if ( m_pLB_DocumentList.get() && m_pLB_DocumentList->IsEnabled() ) - m_pLB_DocumentList->GrabFocus(); - else if (m_pDatasourceType.get() && m_pDatasourceType->IsEnabled()) - m_pDatasourceType->GrabFocus(); } //------------------------------------------------------------------------- @@ -262,12 +169,9 @@ namespace dbaui nResId = STR_UNSUPPORTED_DATASOURCE_TYPE; String sMessage; if ( nResId ) - { - LocalResourceAccess aStringResAccess( PAGE_GENERAL, RSC_TABPAGE ); - sMessage = String(ModuleRes(nResId)); - } - m_aSpecialMessage.SetText(sMessage); + sMessage = String( ModuleRes( nResId ) ); + m_pSpecialMessage->SetText( sMessage ); m_eLastMessage = eMessage; } } @@ -285,78 +189,48 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) + void OGeneralPage::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ) { initializeTypeList(); - // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) - sal_Bool bValid, bReadonly; - getFlags(_rSet, bValid, bReadonly); - if (m_DBWizardMode) - { - m_aTypePreLabel.Hide(); - m_aTypePostLabel.Hide(); - m_aSpecialMessage.Hide(); - SetControlFontWeight(&m_aFTHeaderText); - SetText(String()); + const OUString eOldSelection = m_eCurrentSelection; - LayoutHelper::positionBelow( m_aRB_GetExistingDatabase, *m_pDatasourceType, RelatedControls, INDENT_BELOW_RADIO ); + m_pDatasourceType->SelectEntry( getDatasourceName( _rSet ) ); - if ( !bValid || bReadonly ) - { - m_aDatasourceTypeLabel.Enable( false ); - m_pDatasourceType->Enable( false ); - m_aFTDataSourceAppendix.Enable( false ); - m_aPB_OpenDocument.Enable( false ); - m_aFT_DocListLabel.Enable( false ); - m_pLB_DocumentList->Enable( false ); - } - else - { - m_aControlDependencies.enableOnRadioCheck( m_aRB_GetExistingDatabase, m_aDatasourceTypeLabel, *m_pDatasourceType, m_aFTDataSourceAppendix ); - m_aControlDependencies.enableOnRadioCheck( m_aRB_OpenDocument, m_aPB_OpenDocument, m_aFT_DocListLabel, *m_pLB_DocumentList ); - } + // notify our listener that our type selection has changed (if so) + if ( eOldSelection != m_eCurrentSelection ) + { + setParentTitle( m_eCurrentSelection ); + onTypeSelected( m_eCurrentSelection ); + } - m_pLB_DocumentList->SetDropDownLineCount( 20 ); - if ( m_pLB_DocumentList->GetEntryCount() ) - m_pLB_DocumentList->SelectEntryPos( 0 ); + // a special message for the current page state + switchMessage( m_eCurrentSelection ); - m_aDatasourceTypeLabel.Hide(); - m_aFTDataSourceAppendix.Hide(); + OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue ); + } - m_eOriginalCreationMode = GetDatabaseCreationMode(); - } - else - { - m_aFT_DatasourceTypeHeader.Hide(); - m_aRB_CreateDatabase.Hide(); - m_aRB_GetExistingDatabase.Hide(); - m_aRB_OpenDocument.Hide(); - m_aPB_OpenDocument.Hide(); - m_aFT_DocListLabel.Hide(); - m_pLB_DocumentList->Hide(); - m_aFTHeaderText.Hide(); - m_aFTHelpText.Hide(); - m_aTypePreLabel.Enable(bValid); - m_aTypePostLabel.Enable(bValid); - m_aDatasourceTypeLabel.Enable(bValid); - m_pDatasourceType->Enable(bValid); - } - // if the selection is invalid, disable evrything + //------------------------------------------------------------------------- + OUString OGeneralPage::getDatasourceName( const SfxItemSet& _rSet ) + { + // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) + sal_Bool bValid, bReadonly; + getFlags( _rSet, bValid, bReadonly ); + + // if the selection is invalid, disable everything String sName,sConnectURL; m_bDisplayingInvalid = !bValid; if ( bValid ) { // collect some items and some values - SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); - SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); - OSL_ENSURE(pUrlItem, "OGeneralPage::implInitControls : missing the type attribute !"); - OSL_ENSURE(pNameItem, "OGeneralPage::implInitControls : missing the type attribute !"); + SFX_ITEMSET_GET( _rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True ); + SFX_ITEMSET_GET( _rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True ); + OSL_ENSURE( pUrlItem, "OGeneralPage::getDatasourceName: missing the type attribute !" ); + OSL_ENSURE( pNameItem, "OGeneralPage::getDatasourceName: missing the type attribute !" ); sName = pNameItem->GetValue(); sConnectURL = pUrlItem->GetValue(); } - OUString eOldSelection = m_eCurrentSelection; m_eNotSupportedKnownType = ::dbaccess::DST_UNKNOWN; implSetCurrentType( OUString() ); @@ -365,69 +239,39 @@ namespace dbaui if (m_pCollection && bValid) { - implSetCurrentType( m_pCollection->getPrefix(sConnectURL) ); - sDisplayName = m_pCollection->getTypeDisplayName(m_eCurrentSelection); + implSetCurrentType( m_pCollection->getPrefix( sConnectURL ) ); + sDisplayName = m_pCollection->getTypeDisplayName( m_eCurrentSelection ); } // select the correct datasource type - if ( approveDataSourceType( m_eCurrentSelection, sDisplayName ) + if ( approveDatasourceType( m_eCurrentSelection, sDisplayName ) && ( LISTBOX_ENTRY_NOTFOUND == m_pDatasourceType->GetEntryPos( sDisplayName ) ) ) { // this indicates it's really a type which is known in general, but not supported on the current platform // show a message saying so // eSpecialMessage = smUnsupportedType; - insertDatasourceTypeEntryData(m_eCurrentSelection, sDisplayName); + insertDatasourceTypeEntryData( m_eCurrentSelection, sDisplayName ); // remember this type so we can show the special message again if the user selects this // type again (without changing the data source) - m_eNotSupportedKnownType = m_pCollection->determineType(m_eCurrentSelection); + m_eNotSupportedKnownType = m_pCollection->determineType( m_eCurrentSelection ); } - if (m_aRB_CreateDatabase.IsChecked() && m_DBWizardMode) - sDisplayName = m_pCollection->getTypeDisplayName( OUString("jdbc:")); - m_pDatasourceType->SelectEntry(sDisplayName); - - // notify our listener that our type selection has changed (if so) - if ( eOldSelection != m_eCurrentSelection ) - { - setParentTitle(m_eCurrentSelection); - onTypeSelected(m_eCurrentSelection); - } - - // a special message for the current page state - switchMessage(m_eCurrentSelection); - - OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); + return sDisplayName; } - // For the databaseWizard we only have one entry for the MySQL Database, // because we have a seperate tabpage to retrieve the respective datasource type // ( ::dbaccess::DST_MYSQL_ODBC || ::dbaccess::DST_MYSQL_JDBC). Therefore we use ::dbaccess::DST_MYSQL_JDBC as a temporary // representative for all MySQl databases) // Also, embedded databases (embedded HSQL, at the moment), are not to appear in the list of // databases to connect to. - bool OGeneralPage::approveDataSourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ) + bool OGeneralPage::approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ) { - const ::dbaccess::DATASOURCE_TYPE eType = m_pCollection->determineType(_sURLPrefix); - - if ( m_DBWizardMode ) - { - switch ( eType ) - { - case ::dbaccess::DST_MYSQL_JDBC: - _inout_rDisplayName = m_sMySQLEntry; - break; - case ::dbaccess::DST_MYSQL_ODBC: - case ::dbaccess::DST_MYSQL_NATIVE: - // don't display those, the decision whether the user connects via JDBC/ODBC/C-OOo is made on another - // page - _inout_rDisplayName = String(); - break; - default: - break; - } - } + return approveDatasourceType( m_pCollection->determineType(_sURLPrefix), _inout_rDisplayName ); + } + bool OGeneralPage::approveDatasourceType( ::dbaccess::DATASOURCE_TYPE eType, OUString& _inout_rDisplayName ) + { if ( eType == ::dbaccess::DST_MYSQL_NATIVE_DIRECT ) { // do not display the Connector/OOo driver itself, it is always wrapped via the MySQL-Driver, if @@ -456,22 +300,13 @@ namespace dbaui // ----------------------------------------------------------------------- void OGeneralPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aTypePreLabel)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aDatasourceTypeLabel)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aTypePostLabel)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aSpecialMessage)); - _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDataSourceAppendix)); + _rControlList.push_back( new ODisableWrapper<FixedText>( m_pSpecialMessage ) ); } + // ----------------------------------------------------------------------- void OGeneralPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { - _rControlList.push_back(new OSaveValueWrapper<ListBox>(m_pDatasourceType.get())); - } - - //------------------------------------------------------------------------- - SfxTabPage* OGeneralPage::Create(Window* _pParent, const SfxItemSet& _rAttrSet, sal_Bool _bWizardMode) - { - return ( new OGeneralPage( _pParent, _rAttrSet, _bWizardMode ) ); + _rControlList.push_back( new OSaveValueWrapper<ListBox>( m_pDatasourceType ) ); } //------------------------------------------------------------------------- @@ -494,75 +329,252 @@ namespace dbaui } //------------------------------------------------------------------------- - sal_Bool OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) + IMPL_LINK( OGeneralPage, OnDatasourceTypeSelected, ListBox*, _pBox ) + { + // get the type from the entry data + sal_Int16 nSelected = _pBox->GetSelectEntryPos(); + const OUString sURLPrefix = m_aURLPrefixes[ nSelected ]; + + setParentTitle( sURLPrefix ); + // let the impl method do all the stuff + onTypeSelected( sURLPrefix ); + // tell the listener we were modified + callModifiedHdl(); + // outta here + return 0L; + } + + //========================================================================= + //= OGeneralPageDialog + //========================================================================= + //------------------------------------------------------------------------- + OGeneralPageDialog::OGeneralPageDialog( Window* pParent, const SfxItemSet& _rItems ) + :OGeneralPage( pParent, "dbaccess/ui/generalpagedialog.ui", _rItems ) + { + } + + //------------------------------------------------------------------------- + void OGeneralPageDialog::setParentTitle( const OUString& _sURLPrefix ) + { + const OUString sName = m_pCollection->getTypeDisplayName( _sURLPrefix ); + if ( m_pAdminDialog ) + { + OUString sMessage = OUString( ModuleRes( STR_PARENTTITLE_GENERAL ) ); + m_pAdminDialog->setTitle( sMessage.replaceAll( "#", sName ) ); + } + } + + //------------------------------------------------------------------------- + void OGeneralPageDialog::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ) + { + OGeneralPage::implInitControls( _rSet, _bSaveValue ); + + // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) + sal_Bool bValid, bReadonly; + getFlags(_rSet, bValid, bReadonly ); + + m_pDatasourceType->Enable( bValid ); + } + + //------------------------------------------------------------------------- + sal_Bool OGeneralPageDialog::FillItemSet( SfxItemSet& _rCoreAttrs ) + { + sal_Bool bChangedSomething = sal_False; + + sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); + OUString sURLPrefix = m_aURLPrefixes[ nEntry ]; + + if ( m_pDatasourceType->GetSavedValue() != nEntry ) + { + _rCoreAttrs.Put( SfxStringItem( DSID_CONNECTURL, sURLPrefix ) ); + bChangedSomething = sal_True; + } + + return bChangedSomething; + } + + //========================================================================= + //= OGeneralPageWizard + //========================================================================= + //------------------------------------------------------------------------- + OGeneralPageWizard::OGeneralPageWizard( Window* pParent, const SfxItemSet& _rItems ) + :OGeneralPage( pParent, "dbaccess/ui/generalpagewizard.ui", _rItems ) + ,m_pFT_HeaderText ( NULL ) + ,m_pFT_HelpText ( NULL ) + ,m_pRB_CreateDatabase ( NULL ) + ,m_pRB_OpenExistingDatabase ( NULL ) + ,m_pRB_ConnectDatabase ( NULL ) + ,m_pFT_DocListLabel ( NULL ) + ,m_pLB_DocumentList ( NULL ) + ,m_pPB_OpenDatabase ( NULL ) + ,m_eOriginalCreationMode ( eCreateNew ) + { + get( m_pFT_HeaderText, "headerText" ); + get( m_pFT_HelpText, "helpText" ); + get( m_pRB_CreateDatabase, "createDatabase" ); + get( m_pRB_OpenExistingDatabase, "openExistingDatabase" ); + get( m_pRB_ConnectDatabase, "connectDatabase" ); + get( m_pFT_DocListLabel, "docListLabel" ); + get( m_pLB_DocumentList, "documentList" ); + get( m_pPB_OpenDatabase, "openDatabase" ); + + // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option + sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); + if ( nCreateNewDBIndex == -1 ) + nCreateNewDBIndex = m_pCollection->getIndexOf( OUString( "sdbc:dbase:" ) ); + bool bHideCreateNew = ( nCreateNewDBIndex == -1 ); + + // also, if our application policies tell us to hide the option, do it + ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithComponentContext( + ::comphelper::getProcessComponentContext(), + OUString( "/org.openoffice.Office.DataAccess/Policies/Features/Base" ) + ) ); + sal_Bool bAllowCreateLocalDatabase( sal_True ); + OSL_VERIFY( aConfig.getNodeValue( "CreateLocalDatabase" ) >>= bAllowCreateLocalDatabase ); + if ( !bAllowCreateLocalDatabase ) + bHideCreateNew = true; + + if ( bHideCreateNew ) + { + m_pRB_CreateDatabase->Hide(); + m_pRB_ConnectDatabase->Check(); + } + else + m_pRB_CreateDatabase->Check(); + + // do some knittings + m_pRB_CreateDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) ); + m_pRB_ConnectDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) ); + m_pRB_OpenExistingDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) ); + m_pLB_DocumentList->SetSelectHdl( LINK( this, OGeneralPageWizard, OnDocumentSelected ) ); + m_pPB_OpenDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnOpenDocument ) ); + } + + //------------------------------------------------------------------------- + OGeneralPageWizard::CreationMode OGeneralPageWizard::GetDatabaseCreationMode() const + { + if ( m_pRB_CreateDatabase->IsChecked() ) + return eCreateNew; + if ( m_pRB_ConnectDatabase->IsChecked() ) + return eConnectExternal; + return eOpenExisting; + } + + //------------------------------------------------------------------------- + void OGeneralPageWizard::GetFocus() + { + OGeneralPage::GetFocus(); + if ( m_pLB_DocumentList && m_pLB_DocumentList->IsEnabled() ) + m_pLB_DocumentList->GrabFocus(); + else if ( m_pDatasourceType && m_pDatasourceType->IsEnabled() ) + m_pDatasourceType->GrabFocus(); + } + + //------------------------------------------------------------------------- + void OGeneralPageWizard::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ) + { + OGeneralPage::implInitControls( _rSet, _bSaveValue ); + + // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) + sal_Bool bValid, bReadonly; + getFlags( _rSet, bValid, bReadonly ); + + SetText( String() ); + + LayoutHelper::positionBelow( *m_pRB_ConnectDatabase, *m_pDatasourceType, RelatedControls, INDENT_BELOW_RADIO ); + + if ( !bValid || bReadonly ) + { + m_pDatasourceType->Enable( false ); + m_pPB_OpenDatabase->Enable( false ); + m_pFT_DocListLabel->Enable( false ); + m_pLB_DocumentList->Enable( false ); + } + else + { + m_aControlDependencies.enableOnRadioCheck( *m_pRB_ConnectDatabase, *m_pDatasourceType ); + m_aControlDependencies.enableOnRadioCheck( *m_pRB_OpenExistingDatabase, *m_pPB_OpenDatabase, *m_pFT_DocListLabel, *m_pLB_DocumentList ); + } + + m_pLB_DocumentList->SetDropDownLineCount( 20 ); + if ( m_pLB_DocumentList->GetEntryCount() ) + m_pLB_DocumentList->SelectEntryPos( 0 ); + + m_eOriginalCreationMode = GetDatabaseCreationMode(); + } + + //------------------------------------------------------------------------- + OUString OGeneralPageWizard::getDatasourceName(const SfxItemSet& _rSet) + { + if (m_pRB_CreateDatabase->IsChecked() ) + return m_pCollection->getTypeDisplayName( OUString( "jdbc:" ) ); + + return OGeneralPage::getDatasourceName( _rSet ); + } + + //------------------------------------------------------------------------- + bool OGeneralPageWizard::approveDatasourceType( ::dbaccess::DATASOURCE_TYPE eType, OUString& _inout_rDisplayName ) + { + switch ( eType ) + { + case ::dbaccess::DST_MYSQL_JDBC: + _inout_rDisplayName = "MySQL"; + break; + case ::dbaccess::DST_MYSQL_ODBC: + case ::dbaccess::DST_MYSQL_NATIVE: + // don't display those, the decision whether the user connects via JDBC/ODBC/C-OOo is made on another + // page + _inout_rDisplayName = String(); + break; + default: + break; + } + + return OGeneralPage::approveDatasourceType( eType, _inout_rDisplayName ); + } + + //------------------------------------------------------------------------- + sal_Bool OGeneralPageWizard::FillItemSet(SfxItemSet& _rCoreAttrs) { sal_Bool bChangedSomething = sal_False; bool bCommitTypeSelection = true; - if ( m_DBWizardMode ) + + if ( m_pRB_CreateDatabase->IsChecked() ) { - if ( m_aRB_CreateDatabase.IsChecked() ) - { - _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, OUString("sdbc:dbase:"))); + _rCoreAttrs.Put( SfxStringItem( DSID_CONNECTURL, OUString( "sdbc:dbase:" ) ) ); + bChangedSomething = sal_True; + bCommitTypeSelection = false; + } + else if ( m_pRB_OpenExistingDatabase->IsChecked() ) + { + if ( m_pRB_OpenExistingDatabase->GetSavedValue() != m_pRB_OpenExistingDatabase->IsChecked() ) bChangedSomething = sal_True; - bCommitTypeSelection = false; - } - else if ( m_aRB_OpenDocument.IsChecked() ) - { - if ( m_aRB_OpenDocument.GetSavedValue() != m_aRB_OpenDocument.IsChecked() ) - bChangedSomething = sal_True; - // TODO - bCommitTypeSelection = false; - } + // TODO + bCommitTypeSelection = false; } if ( bCommitTypeSelection ) { sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); OUString sURLPrefix = m_aURLPrefixes[nEntry]; - if (m_DBWizardMode) + + if ( ( m_pDatasourceType->GetSavedValue() != nEntry ) + || ( GetDatabaseCreationMode() != m_eOriginalCreationMode ) + ) { - if ( ( m_pDatasourceType->GetSavedValue() != nEntry ) - || ( GetDatabaseCreationMode() != m_eOriginalCreationMode ) - ) - { - _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL,sURLPrefix )); - bChangedSomething = sal_True; - } - else - implSetCurrentType(sURLPrefix); + _rCoreAttrs.Put( SfxStringItem( DSID_CONNECTURL,sURLPrefix ) ); + bChangedSomething = sal_True; } else - { - if ( m_pDatasourceType->GetSavedValue() != nEntry) - { - _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, sURLPrefix)); - bChangedSomething = sal_True; - } - } + implSetCurrentType( sURLPrefix ); } return bChangedSomething; } //------------------------------------------------------------------------- - IMPL_LINK(OGeneralPage, OnDatasourceTypeSelected, ListBox*, _pBox) - { - // get the type from the entry data - sal_Int16 nSelected = _pBox->GetSelectEntryPos(); - const OUString sURLPrefix = m_aURLPrefixes[nSelected]; - - setParentTitle(sURLPrefix); - // let the impl method do all the stuff - onTypeSelected(sURLPrefix); - // tell the listener we were modified - callModifiedHdl(); - // outta here - return 0L; - } - - //------------------------------------------------------------------------- - OGeneralPage::DocumentDescriptor OGeneralPage::GetSelectedDocument() const + OGeneralPageWizard::DocumentDescriptor OGeneralPageWizard::GetSelectedDocument() const { DocumentDescriptor aDocument; if ( m_aBrowsedDocument.sURL.Len() ) @@ -576,22 +588,22 @@ namespace dbaui } //------------------------------------------------------------------------- - IMPL_LINK(OGeneralPage, OnSetupModeSelected, RadioButton*, /*_pBox*/) + IMPL_LINK( OGeneralPageWizard, OnSetupModeSelected, RadioButton*, /*_pBox*/ ) { if ( m_aCreationModeHandler.IsSet() ) - m_aCreationModeHandler.Call(this); + m_aCreationModeHandler.Call( this ); return 1L; } //------------------------------------------------------------------------- - IMPL_LINK(OGeneralPage, OnDocumentSelected, ListBox*, /*_pBox*/) + IMPL_LINK( OGeneralPageWizard, OnDocumentSelected, ListBox*, /*_pBox*/ ) { m_aDocumentSelectionHandler.Call( this ); return 0L; } //------------------------------------------------------------------------- - IMPL_LINK(OGeneralPage, OnOpenDocument, PushButton*, /*_pBox*/) + IMPL_LINK( OGeneralPageWizard, OnOpenDocument, PushButton*, /*_pBox*/ ) { ::sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, @@ -609,8 +621,8 @@ namespace dbaui String sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); InfoBox aError(this, sMessage); aError.Execute(); - m_aRB_GetExistingDatabase.Check(); - OnSetupModeSelected(&m_aRB_GetExistingDatabase); + m_pRB_ConnectDatabase->Check(); + OnSetupModeSelected( m_pRB_ConnectDatabase ); return 0L; } m_aBrowsedDocument.sURL = sPath; diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 7213c0fb0171..a10e5ff10c38 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -37,56 +37,16 @@ namespace dbaui //========================================================================= class OGeneralPage : public OGenericAdministrationPage { - OGeneralPage(Window* pParent, const SfxItemSet& _rItems, sal_Bool _bDBWizardMode = sal_False); + protected: + OGeneralPage( Window* pParent, const rtl::OUString& _rUIXMLDescription, const SfxItemSet& _rItems ); ~OGeneralPage(); - public: - enum CreationMode - { - eCreateNew, - eConnectExternal, - eOpenExisting - }; - - struct DocumentDescriptor - { - String sURL; - String sFilter; - }; - private: - // dialog controls - FixedText m_aFTHeaderText; - FixedText m_aFTHelpText; - FixedText m_aFT_DatasourceTypeHeader; - RadioButton m_aRB_CreateDatabase; - RadioButton m_aRB_OpenDocument; - RadioButton m_aRB_GetExistingDatabase; - FixedText m_aFT_DocListLabel; - ::std::auto_ptr< OpenDocumentListBox > - m_pLB_DocumentList; - OpenDocumentButton m_aPB_OpenDocument; - FixedText m_aTypePreLabel; - FixedText m_aDatasourceTypeLabel; - ::std::auto_ptr< ListBox > - m_pDatasourceType; - FixedText m_aFTDataSourceAppendix; - FixedText m_aTypePostLabel; - FixedText m_aSpecialMessage; - sal_Bool m_DBWizardMode; - String m_sMySQLEntry; - CreationMode m_eOriginalCreationMode; - DocumentDescriptor m_aBrowsedDocument; + FixedText* m_pSpecialMessage; - ::svt::ControlDependencyManager - m_aControlDependencies; - ::std::vector< OUString> m_aURLPrefixes; - - - ::dbaccess::ODsnTypeCollection* - m_pCollection; /// the DSN type collection instance - OUString m_eCurrentSelection; /// currently selected type - ::dbaccess::DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... + OUString m_eCurrentSelection; /// currently selected type + ::dbaccess::DATASOURCE_TYPE + m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... enum SPECIAL_MESSAGE { @@ -96,45 +56,40 @@ namespace dbaui SPECIAL_MESSAGE m_eLastMessage; Link m_aTypeSelectHandler; /// to be called if a new type is selected - Link m_aCreationModeHandler; /// to be called if a new type is selected - Link m_aDocumentSelectionHandler; /// to be called when a document in the RecentDoc list is selected - Link m_aChooseDocumentHandler; /// to be called when a recent document has been definitely chosen sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted bool m_bInitTypeList : 1; - bool approveDataSourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); - void insertDatasourceTypeEntryData(const OUString& _sType, String sDisplayName); + bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); + void insertDatasourceTypeEntryData( const OUString& _sType, String sDisplayName ); - public: - static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet, sal_Bool _bDBWizardMode = sal_False); + protected: + ListBox* m_pDatasourceType; - /// set a handler which gets called every time the user selects a new type - void SetTypeSelectHandler(const Link& _rHandler) { m_aTypeSelectHandler = _rHandler; } - void SetCreationModeHandler(const Link& _rHandler) { m_aCreationModeHandler = _rHandler; } - void SetDocumentSelectionHandler( const Link& _rHandler) { m_aDocumentSelectionHandler = _rHandler; } - void SetChooseDocumentHandler( const Link& _rHandler) { m_aChooseDocumentHandler = _rHandler; } - CreationMode GetDatabaseCreationMode() const; + ::dbaccess::ODsnTypeCollection* + m_pCollection; /// the DSN type collection instance - DocumentDescriptor GetSelectedDocument() const; + ::std::vector< OUString> + m_aURLPrefixes; + + public: + /// set a handler which gets called every time the user selects a new type + void SetTypeSelectHandler( const Link& _rHandler ) { m_aTypeSelectHandler = _rHandler; } /// get the currently selected datasource type OUString GetSelectedType() const { return m_eCurrentSelection; } protected: // SfxTabPage overridables - virtual sal_Bool FillItemSet(SfxItemSet& _rCoreAttrs); - virtual void Reset(const SfxItemSet& _rCoreAttrs); + virtual void Reset( const SfxItemSet& _rCoreAttrs ); - virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); - - virtual void GetFocus(); + virtual void implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ); + virtual OUString getDatasourceName( const SfxItemSet& _rSet ); + virtual bool approveDatasourceType( ::dbaccess::DATASOURCE_TYPE eType, OUString& _inout_rDisplayName ); // <method>OGenericAdministrationPage::fillControls</method> virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); // <method>OGenericAdministrationPage::fillWindows</method> virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); - protected: - void onTypeSelected(const OUString& _sURLPrefix); void initializeTypeList(); @@ -143,12 +98,93 @@ namespace dbaui void switchMessage(const OUString& _sURLPrefix); /// sets the title of the parent dialog - void setParentTitle(const OUString& _sURLPrefix); + virtual void setParentTitle( const OUString& _sURLPrefix ); DECL_LINK(OnDatasourceTypeSelected, ListBox*); - DECL_LINK(OnSetupModeSelected, RadioButton*); - DECL_LINK(OnDocumentSelected, ListBox*); - DECL_LINK(OnOpenDocument, PushButton*); + }; + + //========================================================================= + //= OGeneralPageDialog + //========================================================================= + class OGeneralPageDialog : public OGeneralPage + { + public: + OGeneralPageDialog( Window* pParent, const SfxItemSet& _rItems ); + + protected: + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); + + virtual void implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ); + virtual void setParentTitle( const OUString& _sURLPrefix ); + }; + + //========================================================================= + //= OGeneralPageWizard + //========================================================================= + class OGeneralPageWizard : public OGeneralPage + { + public: + OGeneralPageWizard( Window* pParent, const SfxItemSet& _rItems ); + + public: + enum CreationMode + { + eCreateNew, + eConnectExternal, + eOpenExisting + }; + + struct DocumentDescriptor + { + String sURL; + String sFilter; + }; + + private: + // dialog controls + FixedText* m_pFT_HeaderText; + FixedText* m_pFT_HelpText; + + RadioButton* m_pRB_CreateDatabase; + RadioButton* m_pRB_OpenExistingDatabase; + RadioButton* m_pRB_ConnectDatabase; + + FixedText* m_pFT_DocListLabel; + OpenDocumentListBox* m_pLB_DocumentList; + OpenDocumentButton* m_pPB_OpenDatabase; + + // state + DocumentDescriptor m_aBrowsedDocument; + CreationMode m_eOriginalCreationMode; + + Link m_aCreationModeHandler; /// to be called if a new type is selected + Link m_aDocumentSelectionHandler; /// to be called when a document in the RecentDoc list is selected + Link m_aChooseDocumentHandler; /// to be called when a recent document has been definitely chosen + + ::svt::ControlDependencyManager + m_aControlDependencies; + + public: + void SetCreationModeHandler( const Link& _rHandler ) { m_aCreationModeHandler = _rHandler; } + CreationMode GetDatabaseCreationMode() const; + + void SetDocumentSelectionHandler( const Link& _rHandler) { m_aDocumentSelectionHandler = _rHandler; } + void SetChooseDocumentHandler( const Link& _rHandler) { m_aChooseDocumentHandler = _rHandler; } + DocumentDescriptor GetSelectedDocument() const; + + protected: + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); + + virtual void GetFocus(); + + virtual void implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue ); + virtual OUString getDatasourceName( const SfxItemSet& _rSet ); + virtual bool approveDatasourceType( ::dbaccess::DATASOURCE_TYPE eType, OUString& _inout_rDisplayName ); + + protected: + DECL_LINK( OnSetupModeSelected, RadioButton* ); + DECL_LINK( OnDocumentSelected, ListBox* ); + DECL_LINK( OnOpenDocument, PushButton* ); }; //......................................................................... diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc index 425be67a616b..afc45ab1a35a 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hrc +++ b/dbaccess/source/ui/inc/dbu_dlg.hrc @@ -44,7 +44,7 @@ #define INDENT_BELOW_RADIO 10 - // FREE +#define STR_PARENTTITLE_GENERAL RID_STR_DLG_START + 0 // FREE // FREE // FREE @@ -57,11 +57,11 @@ // FREE #define STR_ERR_USE_CONNECT_TO RID_STR_DLG_START + 11 #define STR_ALREADYEXISTOVERWRITE RID_STR_DLG_START + 12 - // FREE +#define STR_COULD_NOT_LOAD_ODBC_LIB RID_STR_DLG_START + 13 #define STR_INDEX_NAME_ALREADY_USED RID_STR_DLG_START + 14 #define STR_ASK_FOR_DIRECTORY_CREATION RID_STR_DLG_START + 15 #define STR_COULD_NOT_CREATE_DIRECTORY RID_STR_DLG_START + 16 - // FREE +#define STR_UNSUPPORTED_DATASOURCE_TYPE RID_STR_DLG_START + 17 // FREE // FREE // FREE diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 2c00faf1d60a..cf4aa1fcc3a7 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -107,7 +107,7 @@ //======================================================================== // tab pages -#define PAGE_GENERAL RID_PAGE_START + 0 + // FREE #define PAGE_DBASE RID_PAGE_START + 1 #define PAGE_ODBC RID_PAGE_START + 3 #define PAGE_TEXT RID_PAGE_START + 4 diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 5d9dd4658d1b..4437c923600c 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -53,6 +53,7 @@ class OGenericAdministrationPage; //= ODbTypeWizDialogSetup //========================================================================= class OGeneralPage; +class OGeneralPageWizard; class ODbDataSourceAdministrationHelper; /** tab dialog for administrating the office wide registered data sources */ @@ -88,7 +89,7 @@ private: String m_sRM_FinalText; INetURLObject m_aDocURL; String m_sWorkPath; - OGeneralPage* m_pGeneralPage; + OGeneralPageWizard* m_pGeneralPage; OMySQLIntroPageSetup* m_pMySQLIntroPage; OFinalDBPageSetup* m_pFinalPage; @@ -182,9 +183,9 @@ private: sal_Bool callSaveAsDialog(); sal_Bool IsConnectionUrlRequired(); DECL_LINK(OnTypeSelected, OGeneralPage*); - DECL_LINK(OnChangeCreationMode, OGeneralPage*); - DECL_LINK(OnRecentDocumentSelected, OGeneralPage*); - DECL_LINK(OnSingleDocumentChosen, OGeneralPage*); + DECL_LINK(OnChangeCreationMode, OGeneralPageWizard*); + DECL_LINK(OnRecentDocumentSelected, OGeneralPageWizard*); + DECL_LINK(OnSingleDocumentChosen, OGeneralPageWizard*); DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup*); DECL_LINK(ImplModifiedHdl, OGenericAdministrationPage*); }; diff --git a/dbaccess/uiconfig/ui/generalpagedialog.ui b/dbaccess/uiconfig/ui/generalpagedialog.ui new file mode 100644 index 000000000000..3832cb6ed72d --- /dev/null +++ b/dbaccess/uiconfig/ui/generalpagedialog.ui @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkGrid" id="PageGeneral"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">16</property> + <property name="row_spacing">8</property> + <property name="column_spacing">8</property> + <child> + <object class="GtkLabel" id="datasourceTypePre"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_bottom">24</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes">Select the type of database to which you want to establish a connection.</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="datasourceTypeLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">48</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Database _type:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">datasourceType</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="datasourceType"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="hexpand">True</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="datasourceTypeHelp"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">24</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes">On the following pages, you can make detailed settings for the connection. + +The new settings you make will overwrite your existing settings.</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="specialMessage"> + <property name="can_focus">False</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + </object> +</interface> diff --git a/dbaccess/uiconfig/ui/generalpagewizard.ui b/dbaccess/uiconfig/ui/generalpagewizard.ui new file mode 100644 index 000000000000..b55272f22e6f --- /dev/null +++ b/dbaccess/uiconfig/ui/generalpagewizard.ui @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkBox" id="PageGeneral"> + <property name="width_request">400</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">8</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="headerText"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Welcome to the %PRODUCTNAME Database Wizard</property> + <property name="wrap">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="helpText"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Use the Database Wizard to create a new database, open an existing database file, or connect to a database stored on a server.</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sourceTypeHeader"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_bottom">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">What do you want to do?</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="createDatabase"> + <property name="label" translatable="yes">Create a n_ew database</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="margin_left">12</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="openExistingDatabase"> + <property name="label" translatable="yes">Open an existing database _file</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="margin_left">12</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">createDatabase</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="docListBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">48</property> + <property name="spacing">8</property> + <child> + <object class="GtkLabel" id="docListLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Recently used:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="dbaui-OpenDocumentListBox" id="documentList"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</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">5</property> + </packing> + </child> + <child> + <object class="dbaui-OpenDocumentButton" id="openDatabase"> + <property name="label">Open</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="halign">start</property> + <property name="margin_left">48</property> + <property name="always_show_image">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="connectDatabase"> + <property name="label" translatable="yes">Connect to an e_xisting database</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="margin_left">12</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">createDatabase</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="datasourceType"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">48</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">8</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="specialMessage"> + <property name="can_focus">False</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">9</property> + </packing> + </child> + </object> +</interface> |