bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / abpilot / fieldmappingpage.cxx
blobd0962e8f85c0d46f361a10f2107ac4c923b60a92
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 "fieldmappingpage.hxx"
21 #include "fieldmappingimpl.hxx"
22 #include "addresssettings.hxx"
23 #include "abspilot.hxx"
26 namespace abp
28 FieldMappingPage::FieldMappingPage( OAddressBookSourcePilot* _pParent )
29 : AddressBookSourcePage(_pParent, "FieldAssignPage",
30 "modules/sabpilot/ui/fieldassignpage.ui")
32 get(m_pInvokeDialog, "assign");
33 get(m_pHint, "hint");
35 m_pInvokeDialog->SetClickHdl( LINK( this, FieldMappingPage, OnInvokeDialog ) );
38 FieldMappingPage::~FieldMappingPage()
40 disposeOnce();
43 void FieldMappingPage::dispose()
45 m_pInvokeDialog.clear();
46 m_pHint.clear();
47 AddressBookSourcePage::dispose();
50 void FieldMappingPage::ActivatePage()
52 AddressBookSourcePage::ActivatePage();
53 m_pInvokeDialog->GrabFocus();
57 void FieldMappingPage::initializePage()
59 AddressBookSourcePage::initializePage();
60 implUpdateHint();
64 void FieldMappingPage::implUpdateHint()
66 const AddressSettings& rSettings = getSettings();
67 OUString sHint;
68 if ( rSettings.aFieldMapping.empty() )
69 sHint = compmodule::ModuleRes(RID_STR_NOFIELDSASSIGNED);
70 m_pHint->SetText( sHint );
74 IMPL_LINK_NOARG( FieldMappingPage, OnInvokeDialog, Button*, void )
76 AddressSettings& rSettings = getSettings();
78 // invoke the dialog doing the mapping
79 if ( fieldmapping::invokeDialog( getORB(), this, getDialog()->getDataSource().getDataSource(), rSettings ) )
81 if ( !rSettings.aFieldMapping.empty() )
82 getDialog()->travelNext();
83 else
84 implUpdateHint();
89 } // namespace abp
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */