Branch data Line data Source code
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 : :
20 : : #include <vcl/msgbox.hxx>
21 : :
22 : : #include <ids.hrc>
23 : : #include <masterpassworddlg.hrc>
24 : : #include <masterpassworddlg.hxx>
25 : :
26 : : // MasterPasswordDialog---------------------------------------------------
27 : :
28 : : // -----------------------------------------------------------------------
29 : :
30 : 0 : IMPL_LINK_NOARG(MasterPasswordDialog, OKHdl_Impl)
31 : : {
32 : 0 : EndDialog( RET_OK );
33 : 0 : return 1;
34 : : }
35 : :
36 : : // -----------------------------------------------------------------------
37 : :
38 : 0 : MasterPasswordDialog::MasterPasswordDialog
39 : : (
40 : : Window* pParent,
41 : : ::com::sun::star::task::PasswordRequestMode aDialogMode,
42 : : ResMgr* pResMgr
43 : : ) :
44 : :
45 : : ModalDialog( pParent, ResId( DLG_UUI_MASTERPASSWORD, *pResMgr ) ),
46 : :
47 : : aFTMasterPassword ( this, ResId( FT_MASTERPASSWORD, *pResMgr ) ),
48 : : aEDMasterPassword ( this, ResId( ED_MASTERPASSWORD, *pResMgr ) ),
49 : : aFL ( this, ResId( FL_FIXED_LINE, *pResMgr ) ),
50 : : aOKBtn ( this, ResId( BTN_MASTERPASSWORD_OK, *pResMgr ) ),
51 : : aCancelBtn ( this, ResId( BTN_MASTERPASSWORD_CANCEL, *pResMgr ) ),
52 : : aHelpBtn ( this, ResId( BTN_MASTERPASSWORD_HELP, *pResMgr ) ),
53 : : nDialogMode ( aDialogMode ),
54 [ # # ][ # # ]: 0 : pResourceMgr ( pResMgr )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
55 : : {
56 [ # # ]: 0 : if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
57 : : {
58 [ # # ]: 0 : String aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
59 [ # # ]: 0 : ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
60 [ # # ][ # # ]: 0 : aErrorBox.Execute();
[ # # ]
61 : : }
62 : :
63 [ # # ]: 0 : FreeResource();
64 : :
65 [ # # ]: 0 : aOKBtn.SetClickHdl( LINK( this, MasterPasswordDialog, OKHdl_Impl ) );
66 : 0 : };
67 : :
68 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|