User: vg Date: 2008-08-19 09:55:38+0000 Modified: dba/dbaccess/source/ui/dlg/generalpage.cxx
Log: INTEGRATION: CWS dba31a (1.56.42); FILE MERGED 2008/07/04 13:17:11 oj 1.56.42.2: #i86043# new info string when selecting wrong file type 2008/06/09 06:58:17 oj 1.56.42.1: #i90490# select db filter as default File Changes: Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: generalpage.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/generalpage.cxx?r1=1.56&r2=1.57 Delta lines: +17 -3 -------------------- --- generalpage.cxx 2008-04-10 14:54:38+0000 1.56 +++ generalpage.cxx 2008-08-19 09:55:36+0000 1.57 @@ -52,9 +52,8 @@ #ifndef _DBAUI_DBADMIN_HXX_ #include "dbadmin.hxx" #endif -#ifndef _FILEDLGHELPER_HXX #include <sfx2/filedlghelper.hxx> -#endif +#include <sfx2/docfilt.hxx> #ifndef _VCL_STDTEXT_HXX #include <vcl/stdtext.hxx> #endif @@ -85,7 +84,7 @@ #ifndef DBAUI_DRIVERSETTINGS_HXX #include "DriverSettings.hxx" #endif - +#include "UITools.hxx" //......................................................................... namespace dbaui { @@ -599,8 +598,23 @@ IMPL_LINK(OGeneralPage, OnOpenDocument, PushButton*, /*_pBox*/) { ::sfx2::FileDialogHelper aFileDlg( WB_OPEN, ::String::CreateFromAscii("sdatabase") ); + const SfxFilter* pFilter = getStandardDatabaseFilter(); + if ( pFilter ) + { +// aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension()); + aFileDlg.SetCurrentFilter(pFilter->GetUIName()); + } if ( aFileDlg.Execute() == ERRCODE_NONE ) { + if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() ) + { + String sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); + InfoBox aError(this, sMessage); + aError.Execute(); + m_aRB_GetExistingDatabase.Check(); + OnSetupModeSelected(&m_aRB_GetExistingDatabase); + return 0L; + } m_aBrowsedDocument.sURL = aFileDlg.GetPath(); m_aBrowsedDocument.sFilter = String(); m_aChooseDocumentHandler.Call( this ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
