diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-16 21:19:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-17 09:04:57 +0100 |
commit | 3c8b38521aa584704cfa153c51fb15ca601daf9f (patch) | |
tree | c9c042ff6d899bbfbd2b72aa8cf7420a2a03e743 /uui/source/masterpasscrtdlg.cxx | |
parent | 98143564ddffd6deb19a11f84e07efd97ae68048 (diff) |
weld MasterPasswordCreateDialog and MasterPasswordDialog
Change-Id: I4c235546590046b06a1fea9b62d91cf2da664227
Diffstat (limited to 'uui/source/masterpasscrtdlg.cxx')
-rw-r--r-- | uui/source/masterpasscrtdlg.cxx | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx index 42d4a053bd95..8505e2cf7bfd 100644 --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -27,52 +27,43 @@ // MasterPasswordCreateDialog--------------------------------------------------- -IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, Edit&, void) +IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, weld::Entry&, void) { - m_pOKBtn->Enable( m_pEDMasterPasswordCrt->GetText().getLength() >= 1 ); + m_xOKBtn->set_sensitive(m_xEDMasterPasswordCrt->get_text().getLength() >= 1); } -IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, Button*, void) +IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void) { // compare both passwords and show message box if there are not equal!! - if( m_pEDMasterPasswordCrt->GetText() == m_pEDMasterPasswordRepeat->GetText() ) - EndDialog( RET_OK ); + if (m_xEDMasterPasswordCrt->get_text() == m_xEDMasterPasswordRepeat->get_text()) + m_xDialog->response(RET_OK); else { OUString aErrorMsg(Translate::get(STR_ERROR_PASSWORDS_NOT_IDENTICAL, rResLocale)); - std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, aErrorMsg)); xErrorBox->run(); - m_pEDMasterPasswordCrt->SetText( OUString() ); - m_pEDMasterPasswordRepeat->SetText( OUString() ); - m_pEDMasterPasswordCrt->GrabFocus(); + m_xEDMasterPasswordCrt->set_text( OUString() ); + m_xEDMasterPasswordRepeat->set_text( OUString() ); + m_xEDMasterPasswordCrt->grab_focus(); } } -MasterPasswordCreateDialog::MasterPasswordCreateDialog(vcl::Window* pParent, const std::locale& rLocale) - : ModalDialog(pParent, "SetMasterPasswordDialog", "uui/ui/setmasterpassworddlg.ui") +MasterPasswordCreateDialog::MasterPasswordCreateDialog(weld::Window* pParent, const std::locale& rLocale) + : GenericDialogController(pParent, "uui/ui/setmasterpassworddlg.ui", "SetMasterPasswordDialog") , rResLocale(rLocale) + , m_xEDMasterPasswordCrt(m_xBuilder->weld_entry("password1")) + , m_xEDMasterPasswordRepeat(m_xBuilder->weld_entry("password2")) + , m_xOKBtn(m_xBuilder->weld_button("ok")) { - get(m_pEDMasterPasswordCrt, "password1"); - get(m_pEDMasterPasswordRepeat, "password2"); - get(m_pOKBtn, "ok"); - m_pOKBtn->Enable( false ); - m_pOKBtn->SetClickHdl( LINK( this, MasterPasswordCreateDialog, OKHdl_Impl ) ); - m_pEDMasterPasswordCrt->SetModifyHdl( LINK( this, MasterPasswordCreateDialog, EditHdl_Impl ) ); + m_xOKBtn->set_sensitive(false); + m_xOKBtn->connect_clicked( LINK( this, MasterPasswordCreateDialog, OKHdl_Impl ) ); + m_xEDMasterPasswordCrt->connect_changed( LINK( this, MasterPasswordCreateDialog, EditHdl_Impl ) ); } MasterPasswordCreateDialog::~MasterPasswordCreateDialog() { - disposeOnce(); -} - -void MasterPasswordCreateDialog::dispose() -{ - m_pEDMasterPasswordCrt.clear(); - m_pEDMasterPasswordRepeat.clear(); - m_pOKBtn.clear(); - ModalDialog::dispose(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |