2000-10-25 11:56:32 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
2008-04-10 15:57:50 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-10-25 11:56:32 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 06:34:34 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_dbaccess.hxx"
|
|
|
|
|
2000-10-27 07:08:47 +00:00
|
|
|
#include "dbustrings.hrc"
|
2000-10-25 11:56:32 +00:00
|
|
|
#include <toolkit/awt/vclxwindow.hxx>
|
2000-12-15 14:54:12 +00:00
|
|
|
#include "dbu_reghelper.hxx"
|
2000-10-25 11:56:32 +00:00
|
|
|
#ifndef _DBAUI_UNOADMIN_
|
|
|
|
#include "unoadmin.hxx"
|
|
|
|
#endif
|
|
|
|
#include "dbadmin.hxx"
|
2001-03-15 07:29:16 +00:00
|
|
|
#include <comphelper/extract.hxx>
|
2000-10-25 11:56:32 +00:00
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
|
|
|
#include <comphelper/property.hxx>
|
|
|
|
#include <osl/diagnose.h>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
|
|
|
|
// --- needed because of the solar mutex
|
|
|
|
#include <vos/mutex.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
// ---
|
|
|
|
|
2000-10-31 07:08:48 +00:00
|
|
|
#define THISREF() static_cast< XServiceInfo* >(this)
|
2000-10-25 11:56:32 +00:00
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
|
2000-10-31 07:08:48 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
|
2000-10-25 11:56:32 +00:00
|
|
|
//=========================================================================
|
2005-09-23 11:47:50 +00:00
|
|
|
DBG_NAME(ODatabaseAdministrationDialog)
|
2000-10-25 11:56:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
2000-10-31 07:08:48 +00:00
|
|
|
ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XMultiServiceFactory >& _rxORB)
|
2001-06-18 11:35:37 +00:00
|
|
|
:ODatabaseAdministrationDialogBase(_rxORB)
|
2000-10-25 11:56:32 +00:00
|
|
|
,m_pDatasourceItems(NULL)
|
|
|
|
,m_pItemPool(NULL)
|
|
|
|
,m_pItemPoolDefaults(NULL)
|
2001-05-17 08:16:26 +00:00
|
|
|
,m_pCollection(NULL)
|
2000-10-25 11:56:32 +00:00
|
|
|
{
|
2005-09-23 11:47:50 +00:00
|
|
|
DBG_CTOR(ODatabaseAdministrationDialog,NULL);
|
|
|
|
|
2009-07-03 12:24:35 +00:00
|
|
|
m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB);
|
2004-08-02 15:24:38 +00:00
|
|
|
ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection);
|
2000-10-25 11:56:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
|
|
|
|
{
|
|
|
|
// we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor,
|
|
|
|
// so this virtual-method-call the base class does does not work, we're already dead then ...
|
|
|
|
if (m_pDialog)
|
|
|
|
{
|
|
|
|
::osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
if (m_pDialog)
|
|
|
|
destroyDialog();
|
|
|
|
}
|
2001-05-17 08:16:26 +00:00
|
|
|
|
|
|
|
delete m_pCollection;
|
|
|
|
m_pCollection = NULL;
|
2005-09-23 11:47:50 +00:00
|
|
|
|
|
|
|
DBG_DTOR(ODatabaseAdministrationDialog,NULL);
|
2000-10-25 11:56:32 +00:00
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
void ODatabaseAdministrationDialog::destroyDialog()
|
|
|
|
{
|
2001-06-18 11:35:37 +00:00
|
|
|
ODatabaseAdministrationDialogBase::destroyDialog();
|
2000-10-25 11:56:32 +00:00
|
|
|
ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults);
|
|
|
|
}
|
2000-10-31 07:08:48 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue)
|
|
|
|
{
|
2000-11-01 15:34:16 +00:00
|
|
|
PropertyValue aProperty;
|
2000-10-31 07:08:48 +00:00
|
|
|
if (_rValue >>= aProperty)
|
|
|
|
{
|
2001-07-30 10:32:08 +00:00
|
|
|
if (0 == aProperty.Name.compareToAscii("InitialSelection"))
|
2000-10-31 07:08:48 +00:00
|
|
|
{
|
2004-08-02 15:24:38 +00:00
|
|
|
m_aInitialSelection = aProperty.Value;
|
2001-07-30 10:32:08 +00:00
|
|
|
}
|
2005-03-18 09:12:33 +00:00
|
|
|
else if (0 == aProperty.Name.compareToAscii("ActiveConnection"))
|
|
|
|
{
|
|
|
|
m_xActiveConnection.set(aProperty.Value,UNO_QUERY);
|
|
|
|
}
|
2005-03-10 15:56:00 +00:00
|
|
|
else
|
|
|
|
ODatabaseAdministrationDialogBase::implInitialize(_rValue);
|
2000-10-31 07:08:48 +00:00
|
|
|
}
|
2004-08-02 15:24:38 +00:00
|
|
|
else
|
|
|
|
ODatabaseAdministrationDialogBase::implInitialize(_rValue);
|
2000-10-25 11:56:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|
|
|
|
|