1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "dbustrings.hrc"
21 #include <toolkit/awt/vclxwindow.hxx>
22 #include "dbu_reghelper.hxx"
23 #include "unoadmin.hxx"
24 #include "dbadmin.hxx"
25 #include <comphelper/extract.hxx>
26 #include <comphelper/processfactory.hxx>
27 #include <cppuhelper/typeprovider.hxx>
28 #include <comphelper/property.hxx>
29 #include <osl/diagnose.h>
30 #include <vcl/msgbox.hxx>
32 // --- needed because of the solar mutex
33 #include <osl/mutex.hxx>
34 #include <vcl/svapp.hxx>
40 using namespace ::com::sun::star::uno
;
41 using namespace ::com::sun::star::lang
;
42 using namespace ::com::sun::star::beans
;
44 ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference
< XComponentContext
>& _rxORB
)
45 :ODatabaseAdministrationDialogBase(_rxORB
)
46 ,m_pDatasourceItems(NULL
)
48 ,m_pItemPoolDefaults(NULL
)
52 m_pCollection
= new ::dbaccess::ODsnTypeCollection(_rxORB
);
53 ODbAdminDialog::createItemSet(m_pDatasourceItems
, m_pItemPool
, m_pItemPoolDefaults
, m_pCollection
);
56 ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog()
58 // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor,
59 // so this virtual-method-call the base class does does not work, we're already dead then ...
62 ::osl::MutexGuard
aGuard(m_aMutex
);
72 void ODatabaseAdministrationDialog::destroyDialog()
74 ODatabaseAdministrationDialogBase::destroyDialog();
75 ODbAdminDialog::destroyItemSet(m_pDatasourceItems
, m_pItemPool
, m_pItemPoolDefaults
);
78 void ODatabaseAdministrationDialog::implInitialize(const Any
& _rValue
)
80 PropertyValue aProperty
;
81 if (_rValue
>>= aProperty
)
83 if (aProperty
.Name
== "InitialSelection")
85 m_aInitialSelection
= aProperty
.Value
;
87 else if (aProperty
.Name
== "ActiveConnection")
89 m_xActiveConnection
.set(aProperty
.Value
,UNO_QUERY
);
92 ODatabaseAdministrationDialogBase::implInitialize(_rValue
);
95 ODatabaseAdministrationDialogBase::implInitialize(_rValue
);
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */