LibreOffice Module extensions (master) 1
admininvokationpage.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21#include "abspilot.hxx"
23
24namespace abp
25{
27 : AddressBookSourcePage(pPage, pController, "modules/sabpilot/ui/invokeadminpage.ui", "InvokeAdminPage")
28 , m_xInvokeAdminDialog(m_xBuilder->weld_button("settings"))
29 , m_xErrorMessage(m_xBuilder->weld_label("warning"))
30 {
31 m_xInvokeAdminDialog->connect_clicked(LINK(this, AdminDialogInvokationPage, OnInvokeAdminDialog));
32 }
33
35 {
36 }
37
39 {
41 m_xInvokeAdminDialog->grab_focus();
42 }
43
45 {
46 const bool bIsConnected = getDialog()->getDataSource().isConnected();
47 m_xErrorMessage->set_visible( !bIsConnected );
48 }
49
51 {
53 m_xErrorMessage->hide();
54 // if we're entering this page, we assume we had no connection trial with this data source
55 }
56
58 {
60
61 // show our error message if and only if we could not connect
63
64 // the status of the next button may have changed
66
67 // automatically go to the next page (if successfully connected)
68 if ( canAdvance() )
70 }
71
73 {
75 }
76
77 // davido: Do we need it?
79 {
80 OAdminDialogInvokation aInvokation(getORB(), getDialog()->getDataSource().getDataSource(), getDialog()->getDialog());
81 if ( aInvokation.invokeAdministration() )
82 {
83 // try to connect to this data source
84 implTryConnect();
85 }
86 }
87
88} // namespace abp
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
the base class for all tab pages in the address book source wizard
Definition: abspage.hxx:36
virtual void Activate() override
Definition: abspage.cxx:34
OAddressBookSourcePilot * getDialog()
Definition: abspage.cxx:46
AdminDialogInvokationPage(weld::Container *pPage, OAddressBookSourcePilot *pDialog)
virtual bool canAdvance() const override
virtual void Activate() override
virtual void initializePage() override
std::unique_ptr< weld::Label > m_xErrorMessage
std::unique_ptr< weld::Button > m_xInvokeAdminDialog
virtual ~AdminDialogInvokationPage() override
const ODataSource & getDataSource() const
Definition: abspilot.hxx:55
bool connectToDataSource(bool _bForceReConnect)
Definition: abspilot.cxx:351
outsourced from AdminDialogInvokationPage, 'cause this class here, in opposite to the page,...
bool isConnected() const
returns <TRUE> if the object has a valid connection, obtained from its data source
virtual bool canAdvance() const override
void updateDialogTravelUI()
virtual void initializePage() override
IMPL_LINK_NOARG(FinalPage, OnEntryNameModified, weld::Entry &, void)
css::uno::Reference< css::uno::XInterface > getDataSource(const css::uno::Reference< css::uno::XInterface > &_rxDependentObject)