1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: admininvokationpage.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_extensions.hxx"
33 #include "admininvokationpage.hxx"
34 #include "abspilot.hxx"
35 #include "admininvokationimpl.hxx"
37 //.........................................................................
40 //.........................................................................
42 //=====================================================================
43 //= AdminDialogInvokationPage
44 //=====================================================================
45 AdminDialogInvokationPage::AdminDialogInvokationPage( OAddessBookSourcePilot
* _pParent
)
46 :AddressBookSourcePage(_pParent
, ModuleRes(RID_PAGE_ADMININVOKATION
))
47 ,m_aExplanation (this, ModuleRes(FT_ADMINEXPLANATION
))
48 ,m_aInvokeAdminDialog (this, ModuleRes(PB_INVOKE_ADMIN_DIALOG
))
49 ,m_aErrorMessage (this, ModuleRes(FT_ERROR
))
50 ,m_bSuccessfullyExecutedDialog(sal_False
)
54 m_aInvokeAdminDialog
.SetClickHdl( LINK(this, AdminDialogInvokationPage
, OnInvokeAdminDialog
) );
57 //---------------------------------------------------------------------
58 void AdminDialogInvokationPage::ActivatePage()
60 AddressBookSourcePage::ActivatePage();
61 m_aInvokeAdminDialog
.GrabFocus();
64 //---------------------------------------------------------------------
65 void AdminDialogInvokationPage::implUpdateErrorMessage()
67 const sal_Bool bIsConnected
= getDialog()->getDataSource().isConnected();
68 m_aErrorMessage
.Show( !bIsConnected
);
71 //---------------------------------------------------------------------
72 void AdminDialogInvokationPage::initializePage()
74 AddressBookSourcePage::initializePage();
75 m_aErrorMessage
.Hide();
76 // if we're entering this page, we assume we had no connection trial with this data source
79 //---------------------------------------------------------------------
80 void AdminDialogInvokationPage::implTryConnect()
82 getDialog()->connectToDataSource( sal_True
);
84 // show our error message if and only if we could not connect
85 implUpdateErrorMessage();
87 // the status of the next button may have changed
88 updateDialogTravelUI();
90 // automatically go to the next page (if successfully connected)
92 getDialog()->travelNext();
95 //---------------------------------------------------------------------
96 bool AdminDialogInvokationPage::canAdvance() const
98 return AddressBookSourcePage::canAdvance() && getDialog()->getDataSource().isConnected();
101 //---------------------------------------------------------------------
102 IMPL_LINK( AdminDialogInvokationPage
, OnInvokeAdminDialog
, void*, /*NOTINTERESTEDIN*/ )
104 OAdminDialogInvokation
aInvokation( getORB(), getDialog()->getDataSource().getDataSource(), getDialog() );
105 if ( aInvokation
.invokeAdministration( AST_LDAP
== getSettings().eType
) )
107 // try to connect to this data source
114 //.........................................................................
116 //.........................................................................