Tag: cws_src680_oj14 User: oj Date: 2007-06-04 18:13:16+0000 Log: RESYNC: (1.11-1.13); FILE MERGED
File Changes: Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: ConnectionHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/ConnectionHelper.cxx?r1=1.8.4.5&r2=1.8.4.6 Delta lines: +29 -30 --------------------- --- ConnectionHelper.cxx 2006-11-07 09:18:54+0000 1.8.4.5 +++ ConnectionHelper.cxx 2007-06-04 18:13:13+0000 1.8.4.6 @@ -197,9 +197,9 @@ OConnectionHelper::OConnectionHelper( Window* pParent, const ResId& _rId, const SfxItemSet& _rCoreAttrs) :OGenericAdministrationPage(pParent, _rId, _rCoreAttrs) - ,m_aFT_Connection(this, ResId(FT_AUTOBROWSEURL)) - ,m_aET_Connection(this, ResId(ET_AUTOBROWSEURL)) - ,m_aPB_Connection(this, ResId(PB_AUTOBROWSEURL)) + ,m_aFT_Connection(this, ResId(FT_AUTOBROWSEURL,*_rId.GetResMgr())) + ,m_aET_Connection(this, ResId(ET_AUTOBROWSEURL,*_rId.GetResMgr())) + ,m_aPB_Connection(this, ResId(PB_AUTOBROWSEURL,*_rId.GetResMgr())) { DBG_CTOR(OConnectionHelper,NULL); @@ -247,11 +247,26 @@ checkTestConnection(); m_aET_Connection.ClearModifyFlag(); } + OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); } + // ----------------------------------------------------------------------- + void OConnectionHelper::implUpdateURLDependentStates() const + { + OSL_PRECOND( m_pAdminDialog, "OConnectionHelper::implUpdateURLDependentStates: no admin dialog!" ); + if ( !m_pAdminDialog ) + return; - + switch ( m_eType ) + { + case DST_CALC: + m_pAdminDialog->enableConfirmSettings( getURLNoPrefix().Len() > 0 ); + break; + default: + break; + } + } // ----------------------------------------------------------------------- IMPL_LINK(OConnectionHelper, OnBrowseConnections, PushButton*, /*_pButton*/) @@ -405,7 +420,7 @@ else { LocalResourceAccess aLocRes( PAGE_CONNECTION, RSC_TABPAGE ); - String sError = String(ResId(STR_NO_ADABASE_DATASOURCES)); + String sError = String(ModuleRes(STR_NO_ADABASE_DATASOURCES)); ErrorBox aBox(this, WB_OK, sError); aBox.Execute(); } @@ -509,7 +524,7 @@ void OConnectionHelper::implSetURL( const String& _rURL, sal_Bool _bPrefix ) { String sURL( _rURL ); - DBG_ASSERT( m_pCollection, "OConnectionHelper::setURL: have no interpreter for the URLs!" ); + DBG_ASSERT( m_pCollection, "OConnectionHelper::implSetURL: have no interpreter for the URLs!" ); if ( m_pCollection && sURL.Len() ) { @@ -545,6 +560,8 @@ m_aET_Connection.SetText( sURL ); else m_aET_Connection.SetTextNoPrefix( sURL ); + + implUpdateURLDependentStates(); } //------------------------------------------------------------------------- @@ -571,26 +588,20 @@ sFileURLDecoded = sURL; } - // encode the URL - INetURLObject aFileURL( sFileURLDecoded, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8 ); - sFileURLDecoded = aFileURL.GetMainURL( INetURLObject::NO_DECODE ); sURL = sTypePrefix; if ( sFileURLDecoded.Len() ) { - OFileNotation aFileNotation(sFileURLDecoded,OFileNotation::N_SYSTEM); - - // set this decoded URL as text - sURL += String(aFileNotation.get(OFileNotation::N_URL)); + OFileNotation aFileNotation( sFileURLDecoded, OFileNotation::N_SYSTEM ); + sURL += String( aFileNotation.get( OFileNotation::N_URL ) ); } + + // encode the URL + INetURLObject aFileURL( sFileURLDecoded, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8 ); + sFileURLDecoded = aFileURL.GetMainURL( INetURLObject::NO_DECODE ); } } return sURL; } - //------------------------------------------------------------------------- - String OConnectionHelper::getURL( ) const - { - return implGetURL( sal_True ); - } //------------------------------------------------------------------------- void OConnectionHelper::setURL( const String& _rURL ) @@ -611,18 +622,6 @@ } //------------------------------------------------------------------------- - String OConnectionHelper::getConnectionURL( ) const - { - return getURL( ); - } - - //------------------------------------------------------------------------- - void OConnectionHelper::changeConnectionURL( const String& _rNewDSN ) - { - setURL( _rNewDSN ); - } - - //------------------------------------------------------------------------- sal_Int32 OConnectionHelper::checkPathExistence(const String& _rURL) { IS_PATH_EXIST e_exists = pathExists(_rURL, sal_False); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
