User: hr Date: 2007-11-01 15:03:16+0000 Modified: dba/dbaccess/source/ui/app/AppController.cxx
Log: INTEGRATION: CWS dba24b (1.44.6); FILE MERGED 2007/09/28 11:51:50 oj 1.44.6.4: RESYNC: (1.44-1.47); FILE MERGED 2007/08/29 12:07:02 fs 1.44.6.3: #i10000# 2007/08/29 12:03:18 fs 1.44.6.2: during #i80930#: DST_EMBEDDED -> DST_EMBEDDED_HSQLDB. The approach to read the concrete type of the embedded DB from the configuration does not work, there are enough places where we silently assume 'embedded == embedded HSQLDB' 2007/08/27 10:55:04 fs 1.44.6.1: prepare #i80930#: advanced settings enabled according to DataSourceMetaData, not with hard-coded list of supporting types File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.47&r2=1.48 Delta lines: +39 -52 --------------------- --- AppController.cxx 2007-09-26 14:46:26+0000 1.47 +++ AppController.cxx 2007-11-01 15:03:13+0000 1.48 @@ -36,12 +36,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBAUI_APPCONTROLLER_HXX #include "AppController.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif +#include "advancedsettingsdlg.hxx" + /** === begin UNO includes === **/ #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ #include <com/sun/star/container/XNameContainer.hpp> @@ -791,9 +789,8 @@ break; case SID_DB_APP_DSUSERADMIN: { - ODsnTypeCollection aTypeCollection; - DATASOURCE_TYPE eType = aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED != eType; + DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); + aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType; } break; case SID_DB_APP_DSRELDESIGN: @@ -810,7 +807,7 @@ if ( aReturn.bEnabled ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED != eType && DST_MOZILLA != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_MACAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; + aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType && DST_MOZILLA != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_MACAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; } break; case SID_DB_APP_DSCONNECTION_TYPE: @@ -818,15 +815,15 @@ if ( aReturn.bEnabled ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED != eType; + aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType; } break; case SID_DB_APP_DSADVANCED_SETTINGS: aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED != eType && DST_LDAP != eType && DST_CALC != eType && DST_MOZILLA != eType && DST_THUNDERBIRD != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_MACAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; + DATASOURCE_TYPE eType = m_aTypeCollection.getType( ::comphelper::getString( m_xDataSource->getPropertyValue( PROPERTY_URL ) ) ); + aReturn.bEnabled = AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( eType ); } break; case SID_DB_APP_CONVERTTOVIEW: @@ -886,22 +883,18 @@ aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - ::rtl::OUString sTemp; - m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sTemp; - DATASOURCE_TYPE eType = m_aTypeCollection.getType(sTemp); + ::rtl::OUString sURL; + m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sURL; + DATASOURCE_TYPE eType = m_aTypeCollection.getType( sURL ); + String sDatabaseName; - if ( eType != DST_EMBEDDED ) - { - String sUser,sHostName,ssTemp; - ssTemp = sTemp; - sal_Int32 nPortNumber = -1; + String sHostName; + sal_Int32 nPortNumber( -1 ); + + m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber ); - m_aTypeCollection.extractHostNamePort(ssTemp - ,sDatabaseName - ,sHostName - ,nPortNumber); if ( !sDatabaseName.Len() ) - sDatabaseName = m_aTypeCollection.cutPrefix(sTemp); + sDatabaseName = m_aTypeCollection.cutPrefix( sURL ); if ( m_aTypeCollection.isFileSystemBased(eType) ) { @@ -913,9 +906,10 @@ sDatabaseName = aFileNotation.get(::svt::OFileNotation::N_SYSTEM); } } - } - else - sDatabaseName = m_aTypeCollection.getEmbeddedDatabaseUIName(getORB()); + + if ( sDatabaseName.Len() == 0 ) + sDatabaseName = m_aTypeCollection.getTypeDisplayName( eType ); + aReturn.sTitle = sDatabaseName; } break; @@ -928,21 +922,14 @@ aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - ::rtl::OUString sTemp; - m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sTemp; - DATASOURCE_TYPE eType = m_aTypeCollection.getType(sTemp); - if ( eType != DST_EMBEDDED ) - { - String sUser,sHostName,sDatabaseName,ssTemp; - ssTemp = sTemp; + ::rtl::OUString sURL; + m_xDataSource->getPropertyValue( PROPERTY_URL ) >>= sURL; + + String sHostName, sDatabaseName; sal_Int32 nPortNumber = -1; - m_aTypeCollection.extractHostNamePort(ssTemp - ,sDatabaseName - ,sHostName - ,nPortNumber); + m_aTypeCollection.extractHostNamePort( sURL, sDatabaseName, sHostName, nPortNumber ); aReturn.sTitle = sHostName; } - } break; default: aReturn = OApplicationController_CBASE::GetState(_nId); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
