diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 08:55:36 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 08:55:36 +0000 |
commit | 0e56c29bd02244e41d4bb753972c45a6fb44df85 (patch) | |
tree | 7c01e0d24c6eb8a1fe402d9305c20a21579c77bb /dbaccess | |
parent | 478792ea6db236bf17a72488ef9ac8cff7ba5da5 (diff) |
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
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index b062a677c447..79e1f50854e2 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: generalpage.cxx,v $ - * $Revision: 1.56 $ + * $Revision: 1.57 $ * * This file is part of OpenOffice.org. * @@ -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 @@ namespace dbaui 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 ); |