2010-10-12 15:59:03 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-10-25 11:56:32 +00:00
|
|
|
|
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>
|
2013-01-04 09:12:44 +02:00
|
|
|
#include <comphelper/processfactory.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
|
2010-10-16 03:13:32 -05:00
|
|
|
#include <osl/mutex.hxx>
|
2000-10-25 11:56:32 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
// ---
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2005-09-23 11:47:50 +00:00
|
|
|
DBG_NAME(ODatabaseAdministrationDialog)
|
2013-03-19 13:08:47 +02:00
|
|
|
ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _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);
|
|
|
|
|
2013-03-19 13:08:47 +02: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
|
|
|
}
|
2013-08-17 23:43:14 +02:00
|
|
|
|
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);
|
|
|
|
}
|
2013-08-17 23:43:14 +02:00
|
|
|
|
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
|
|
|
|
|
2010-10-12 15:59:03 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|