1*859212d1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*859212d1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*859212d1SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*859212d1SAndrew Rist * distributed with this work for additional information
6*859212d1SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*859212d1SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*859212d1SAndrew Rist * "License"); you may not use this file except in compliance
9*859212d1SAndrew Rist * with the License. You may obtain a copy of the License at
10*859212d1SAndrew Rist *
11*859212d1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*859212d1SAndrew Rist *
13*859212d1SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*859212d1SAndrew Rist * software distributed under the License is distributed on an
15*859212d1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*859212d1SAndrew Rist * KIND, either express or implied. See the License for the
17*859212d1SAndrew Rist * specific language governing permissions and limitations
18*859212d1SAndrew Rist * under the License.
19*859212d1SAndrew Rist *
20*859212d1SAndrew Rist *************************************************************/
21*859212d1SAndrew Rist
22*859212d1SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #include <svtools/filedlg.hxx>
25cdf0e10cSrcweir #include <vcl/msgbox.hxx>
26cdf0e10cSrcweir
27cdf0e10cSrcweir #ifndef UUI_IDS_HRC
28cdf0e10cSrcweir #include <ids.hrc>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef UUI_MASTERPASSWORDDLG_HRC
31cdf0e10cSrcweir #include <masterpassworddlg.hrc>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <masterpassworddlg.hxx>
34cdf0e10cSrcweir
35cdf0e10cSrcweir // MasterPasswordDialog---------------------------------------------------
36cdf0e10cSrcweir
37cdf0e10cSrcweir // -----------------------------------------------------------------------
38cdf0e10cSrcweir
IMPL_LINK(MasterPasswordDialog,OKHdl_Impl,OKButton *,EMPTYARG)39cdf0e10cSrcweir IMPL_LINK( MasterPasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG )
40cdf0e10cSrcweir {
41cdf0e10cSrcweir EndDialog( RET_OK );
42cdf0e10cSrcweir return 1;
43cdf0e10cSrcweir }
44cdf0e10cSrcweir
45cdf0e10cSrcweir // -----------------------------------------------------------------------
46cdf0e10cSrcweir
MasterPasswordDialog(Window * pParent,::com::sun::star::task::PasswordRequestMode aDialogMode,ResMgr * pResMgr)47cdf0e10cSrcweir MasterPasswordDialog::MasterPasswordDialog
48cdf0e10cSrcweir (
49cdf0e10cSrcweir Window* pParent,
50cdf0e10cSrcweir ::com::sun::star::task::PasswordRequestMode aDialogMode,
51cdf0e10cSrcweir ResMgr* pResMgr
52cdf0e10cSrcweir ) :
53cdf0e10cSrcweir
54cdf0e10cSrcweir ModalDialog( pParent, ResId( DLG_UUI_MASTERPASSWORD, *pResMgr ) ),
55cdf0e10cSrcweir
56cdf0e10cSrcweir aFTMasterPassword ( this, ResId( FT_MASTERPASSWORD, *pResMgr ) ),
57cdf0e10cSrcweir aEDMasterPassword ( this, ResId( ED_MASTERPASSWORD, *pResMgr ) ),
58cdf0e10cSrcweir aFL ( this, ResId( FL_FIXED_LINE, *pResMgr ) ),
59cdf0e10cSrcweir aOKBtn ( this, ResId( BTN_MASTERPASSWORD_OK, *pResMgr ) ),
60cdf0e10cSrcweir aCancelBtn ( this, ResId( BTN_MASTERPASSWORD_CANCEL, *pResMgr ) ),
61cdf0e10cSrcweir aHelpBtn ( this, ResId( BTN_MASTERPASSWORD_HELP, *pResMgr ) ),
62cdf0e10cSrcweir nDialogMode ( aDialogMode ),
63cdf0e10cSrcweir pResourceMgr ( pResMgr )
64cdf0e10cSrcweir {
65cdf0e10cSrcweir if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir String aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
68cdf0e10cSrcweir ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
69cdf0e10cSrcweir aErrorBox.Execute();
70cdf0e10cSrcweir }
71cdf0e10cSrcweir
72cdf0e10cSrcweir FreeResource();
73cdf0e10cSrcweir
74cdf0e10cSrcweir aOKBtn.SetClickHdl( LINK( this, MasterPasswordDialog, OKHdl_Impl ) );
75cdf0e10cSrcweir };
76cdf0e10cSrcweir
77