merge the formfield patch from ooo-build
[ooovba.git] / uui / source / masterpassworddlg.cxx
blob9a5e667e43d843d4dca3dae92de074aef54514a9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: masterpassworddlg.cxx,v $
10 * $Revision: 1.5 $
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 #include <svtools/filedlg.hxx>
32 #include <vcl/msgbox.hxx>
34 #ifndef UUI_IDS_HRC
35 #include <ids.hrc>
36 #endif
37 #ifndef UUI_MASTERPASSWORDDLG_HRC
38 #include <masterpassworddlg.hrc>
39 #endif
40 #include <masterpassworddlg.hxx>
42 // MasterPasswordDialog---------------------------------------------------
44 // -----------------------------------------------------------------------
46 IMPL_LINK( MasterPasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG )
48 EndDialog( RET_OK );
49 return 1;
52 // -----------------------------------------------------------------------
54 MasterPasswordDialog::MasterPasswordDialog
56 Window* pParent,
57 ::com::sun::star::task::PasswordRequestMode aDialogMode,
58 ResMgr* pResMgr
59 ) :
61 ModalDialog( pParent, ResId( DLG_UUI_MASTERPASSWORD, *pResMgr ) ),
63 aFTMasterPassword ( this, ResId( FT_MASTERPASSWORD, *pResMgr ) ),
64 aEDMasterPassword ( this, ResId( ED_MASTERPASSWORD, *pResMgr ) ),
65 aFL ( this, ResId( FL_FIXED_LINE, *pResMgr ) ),
66 aOKBtn ( this, ResId( BTN_MASTERPASSWORD_OK, *pResMgr ) ),
67 aCancelBtn ( this, ResId( BTN_MASTERPASSWORD_CANCEL, *pResMgr ) ),
68 aHelpBtn ( this, ResId( BTN_MASTERPASSWORD_HELP, *pResMgr ) ),
69 nDialogMode ( aDialogMode ),
70 pResourceMgr ( pResMgr )
72 if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
74 String aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
75 ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
76 aErrorBox.Execute();
79 FreeResource();
81 aOKBtn.SetClickHdl( LINK( this, MasterPasswordDialog, OKHdl_Impl ) );