1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <sal/macros.h>
21 #include <vcl/layout.hxx>
24 #include "masterpasscrtdlg.hxx"
26 // MasterPasswordCreateDialog---------------------------------------------------
30 IMPL_LINK_NOARG(MasterPasswordCreateDialog
, EditHdl_Impl
)
32 m_pOKBtn
->Enable( m_pEDMasterPasswordCrt
->GetText().getLength() >= nMinLen
);
36 IMPL_LINK_NOARG(MasterPasswordCreateDialog
, OKHdl_Impl
)
38 // compare both passwords and show message box if there are not equal!!
39 if( m_pEDMasterPasswordCrt
->GetText() == m_pEDMasterPasswordRepeat
->GetText() )
43 OUString
aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL
, *pResourceMgr
));
44 ScopedVclPtrInstance
< MessageDialog
> aErrorBox(this, aErrorMsg
);
46 m_pEDMasterPasswordCrt
->SetText( OUString() );
47 m_pEDMasterPasswordRepeat
->SetText( OUString() );
48 m_pEDMasterPasswordCrt
->GrabFocus();
53 MasterPasswordCreateDialog::MasterPasswordCreateDialog(vcl::Window
* pParent
, ResMgr
* pResMgr
)
54 : ModalDialog(pParent
, "SetMasterPasswordDialog", "uui/ui/setmasterpassworddlg.ui")
55 , pResourceMgr(pResMgr
)
58 get(m_pEDMasterPasswordCrt
, "password1");
59 get(m_pEDMasterPasswordRepeat
, "password2");
61 m_pOKBtn
->Enable( false );
62 m_pOKBtn
->SetClickHdl( LINK( this, MasterPasswordCreateDialog
, OKHdl_Impl
) );
63 m_pEDMasterPasswordCrt
->SetModifyHdl( LINK( this, MasterPasswordCreateDialog
, EditHdl_Impl
) );
66 MasterPasswordCreateDialog::~MasterPasswordCreateDialog()
71 void MasterPasswordCreateDialog::dispose()
73 m_pEDMasterPasswordCrt
.clear();
74 m_pEDMasterPasswordRepeat
.clear();
76 ModalDialog::dispose();
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */