weld PasswordToOpenModifyDialog
Change-Id: I42ebbd1c94a54fb1d4c755fbcc6758c93614bc33 Reviewed-on: https://gerrit.libreoffice.org/51729 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -17,163 +17,111 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <vcl/svapp.hxx>
|
||||||
#include <passwdomdlg.hxx>
|
#include <passwdomdlg.hxx>
|
||||||
|
|
||||||
#include <strings.hrc>
|
#include <strings.hrc>
|
||||||
#include <dialmgr.hxx>
|
#include <dialmgr.hxx>
|
||||||
|
|
||||||
#include <sfx2/tabdlg.hxx>
|
IMPL_LINK_NOARG(PasswordToOpenModifyDialog, OkBtnClickHdl, weld::Button&, void)
|
||||||
#include <vcl/fixed.hxx>
|
|
||||||
#include <vcl/edit.hxx>
|
|
||||||
#include <vcl/button.hxx>
|
|
||||||
#include <vcl/weld.hxx>
|
|
||||||
#include <vcl/settings.hxx>
|
|
||||||
|
|
||||||
struct PasswordToOpenModifyDialog_Impl
|
|
||||||
{
|
{
|
||||||
VclPtr<PasswordToOpenModifyDialog> m_pParent;
|
bool bInvalidState = !m_xOpenReadonlyCB->get_active() &&
|
||||||
|
m_xPasswdToOpenED->get_text().isEmpty() &&
|
||||||
VclPtr<Edit> m_pPasswdToOpenED;
|
m_xPasswdToModifyED->get_text().isEmpty();
|
||||||
VclPtr<Edit> m_pReenterPasswdToOpenED;
|
|
||||||
VclPtr<VclExpander> m_pOptionsExpander;
|
|
||||||
VclPtr<OKButton> m_pOk;
|
|
||||||
VclPtr<CheckBox> m_pOpenReadonlyCB;
|
|
||||||
VclPtr<Edit> m_pPasswdToModifyED;
|
|
||||||
VclPtr<Edit> m_pReenterPasswdToModifyED;
|
|
||||||
|
|
||||||
OUString m_aOneMismatch;
|
|
||||||
OUString m_aTwoMismatch;
|
|
||||||
OUString m_aInvalidStateForOkButton;
|
|
||||||
OUString m_aInvalidStateForOkButton_v2;
|
|
||||||
|
|
||||||
bool m_bIsPasswordToModify;
|
|
||||||
|
|
||||||
|
|
||||||
DECL_LINK( OkBtnClickHdl, Button*, void );
|
|
||||||
|
|
||||||
PasswordToOpenModifyDialog_Impl( PasswordToOpenModifyDialog * pParent,
|
|
||||||
sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify );
|
|
||||||
};
|
|
||||||
|
|
||||||
PasswordToOpenModifyDialog_Impl::PasswordToOpenModifyDialog_Impl(
|
|
||||||
PasswordToOpenModifyDialog * pParent,
|
|
||||||
sal_uInt16 nMaxPasswdLen,
|
|
||||||
bool bIsPasswordToModify )
|
|
||||||
: m_pParent( pParent )
|
|
||||||
, m_aOneMismatch( CuiResId( RID_SVXSTR_ONE_PASSWORD_MISMATCH ) )
|
|
||||||
, m_aTwoMismatch( CuiResId( RID_SVXSTR_TWO_PASSWORDS_MISMATCH ) )
|
|
||||||
, m_aInvalidStateForOkButton( CuiResId( RID_SVXSTR_INVALID_STATE_FOR_OK_BUTTON ) )
|
|
||||||
, m_aInvalidStateForOkButton_v2( CuiResId( RID_SVXSTR_INVALID_STATE_FOR_OK_BUTTON_V2 ) )
|
|
||||||
, m_bIsPasswordToModify( bIsPasswordToModify )
|
|
||||||
{
|
|
||||||
pParent->get(m_pPasswdToOpenED, "newpassEntry");
|
|
||||||
pParent->get(m_pReenterPasswdToOpenED, "confirmpassEntry");
|
|
||||||
pParent->get(m_pOk, "ok");
|
|
||||||
pParent->get(m_pOpenReadonlyCB, "readonly");
|
|
||||||
pParent->get(m_pPasswdToModifyED, "newpassroEntry");
|
|
||||||
pParent->get(m_pReenterPasswdToModifyED, "confirmropassEntry");
|
|
||||||
pParent->get(m_pOptionsExpander, "expander");
|
|
||||||
|
|
||||||
m_pOk->SetClickHdl( LINK( this, PasswordToOpenModifyDialog_Impl, OkBtnClickHdl ) );
|
|
||||||
|
|
||||||
if (nMaxPasswdLen)
|
|
||||||
{
|
|
||||||
m_pPasswdToOpenED->SetMaxTextLen( nMaxPasswdLen );
|
|
||||||
m_pReenterPasswdToOpenED->SetMaxTextLen( nMaxPasswdLen );
|
|
||||||
m_pPasswdToModifyED->SetMaxTextLen( nMaxPasswdLen );
|
|
||||||
m_pReenterPasswdToModifyED->SetMaxTextLen( nMaxPasswdLen );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pPasswdToOpenED->GrabFocus();
|
|
||||||
|
|
||||||
m_pOptionsExpander->Enable(bIsPasswordToModify);
|
|
||||||
if (!bIsPasswordToModify)
|
|
||||||
m_pOptionsExpander->Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
IMPL_LINK(PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, Button *, pButton, void)
|
|
||||||
{
|
|
||||||
bool bInvalidState = !m_pOpenReadonlyCB->IsChecked() &&
|
|
||||||
m_pPasswdToOpenED->GetText().isEmpty() &&
|
|
||||||
m_pPasswdToModifyED->GetText().isEmpty();
|
|
||||||
if (bInvalidState)
|
if (bInvalidState)
|
||||||
{
|
{
|
||||||
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
|
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(m_xDialog.get(),
|
||||||
VclMessageType::Warning, VclButtonsType::Ok,
|
VclMessageType::Warning, VclButtonsType::Ok,
|
||||||
m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2));
|
m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2));
|
||||||
xErrorBox->run();
|
xErrorBox->run();
|
||||||
}
|
}
|
||||||
else // check for mismatched passwords...
|
else // check for mismatched passwords...
|
||||||
{
|
{
|
||||||
const bool bToOpenMatch = m_pPasswdToOpenED->GetText() == m_pReenterPasswdToOpenED->GetText();
|
const bool bToOpenMatch = m_xPasswdToOpenED->get_text() == m_xReenterPasswdToOpenED->get_text();
|
||||||
const bool bToModifyMatch = m_pPasswdToModifyED->GetText() == m_pReenterPasswdToModifyED->GetText();
|
const bool bToModifyMatch = m_xPasswdToModifyED->get_text() == m_xReenterPasswdToModifyED->get_text();
|
||||||
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
|
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
|
||||||
if (nMismatch > 0)
|
if (nMismatch > 0)
|
||||||
{
|
{
|
||||||
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
|
std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(m_xDialog.get(),
|
||||||
VclMessageType::Warning, VclButtonsType::Ok,
|
VclMessageType::Warning, VclButtonsType::Ok,
|
||||||
nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
|
nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
|
||||||
xErrorBox->run();
|
xErrorBox->run();
|
||||||
|
|
||||||
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED.get() : m_pPasswdToModifyED.get();
|
weld::Entry* pEdit = !bToOpenMatch ? m_xPasswdToOpenED.get() : m_xPasswdToModifyED.get();
|
||||||
Edit* pRepeatEdit = !bToOpenMatch? m_pReenterPasswdToOpenED.get() : m_pReenterPasswdToModifyED.get();
|
weld::Entry* pRepeatEdit = !bToOpenMatch? m_xReenterPasswdToOpenED.get() : m_xReenterPasswdToModifyED.get();
|
||||||
if (nMismatch == 1)
|
if (nMismatch == 1)
|
||||||
{
|
{
|
||||||
pEdit->SetText( "" );
|
pEdit->set_text( "" );
|
||||||
pRepeatEdit->SetText( "" );
|
pRepeatEdit->set_text( "" );
|
||||||
}
|
}
|
||||||
else if (nMismatch == 2)
|
else if (nMismatch == 2)
|
||||||
{
|
{
|
||||||
m_pPasswdToOpenED->SetText( "" );
|
m_xPasswdToOpenED->set_text( "" );
|
||||||
m_pReenterPasswdToOpenED->SetText( "" );
|
m_xReenterPasswdToOpenED->set_text( "" );
|
||||||
m_pPasswdToModifyED->SetText( "" );
|
m_xPasswdToModifyED->set_text( "" );
|
||||||
m_pReenterPasswdToModifyED->SetText( "" );
|
m_xReenterPasswdToModifyED->set_text( "" );
|
||||||
}
|
}
|
||||||
pEdit->GrabFocus();
|
pEdit->grab_focus();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pParent->EndDialog( RET_OK );
|
m_xDialog->response(RET_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(
|
PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify)
|
||||||
vcl::Window * pParent,
|
: GenericDialogController(pParent, "cui/ui/password.ui", "PasswordDialog")
|
||||||
sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify)
|
, m_xPasswdToOpenED(m_xBuilder->weld_entry("newpassEntry"))
|
||||||
: SfxModalDialog( pParent, "PasswordDialog", "cui/ui/password.ui" )
|
, m_xReenterPasswdToOpenED(m_xBuilder->weld_entry("confirmpassEntry"))
|
||||||
|
, m_xOptionsExpander(m_xBuilder->weld_expander("expander"))
|
||||||
|
, m_xOk(m_xBuilder->weld_button("ok"))
|
||||||
|
, m_xOpenReadonlyCB(m_xBuilder->weld_check_button("readonly"))
|
||||||
|
, m_xPasswdToModifyED(m_xBuilder->weld_entry("newpassroEntry"))
|
||||||
|
, m_xReenterPasswdToModifyED(m_xBuilder->weld_entry("confirmropassEntry"))
|
||||||
|
, m_aOneMismatch( CuiResId( RID_SVXSTR_ONE_PASSWORD_MISMATCH ) )
|
||||||
|
, m_aTwoMismatch( CuiResId( RID_SVXSTR_TWO_PASSWORDS_MISMATCH ) )
|
||||||
|
, m_aInvalidStateForOkButton( CuiResId( RID_SVXSTR_INVALID_STATE_FOR_OK_BUTTON ) )
|
||||||
|
, m_aInvalidStateForOkButton_v2( CuiResId( RID_SVXSTR_INVALID_STATE_FOR_OK_BUTTON_V2 ) )
|
||||||
|
, m_bIsPasswordToModify( bIsPasswordToModify )
|
||||||
{
|
{
|
||||||
m_pImpl.reset(new PasswordToOpenModifyDialog_Impl(this,
|
m_xOk->connect_clicked(LINK(this, PasswordToOpenModifyDialog, OkBtnClickHdl));
|
||||||
nMaxPasswdLen, bIsPasswordToModify ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (nMaxPasswdLen)
|
||||||
|
{
|
||||||
|
m_xPasswdToOpenED->set_max_length( nMaxPasswdLen );
|
||||||
|
m_xReenterPasswdToOpenED->set_max_length( nMaxPasswdLen );
|
||||||
|
m_xPasswdToModifyED->set_max_length( nMaxPasswdLen );
|
||||||
|
m_xReenterPasswdToModifyED->set_max_length( nMaxPasswdLen );
|
||||||
|
}
|
||||||
|
|
||||||
PasswordToOpenModifyDialog::~PasswordToOpenModifyDialog()
|
m_xPasswdToOpenED->grab_focus();
|
||||||
{
|
|
||||||
disposeOnce();
|
m_xOptionsExpander->set_sensitive(bIsPasswordToModify);
|
||||||
|
if (!bIsPasswordToModify)
|
||||||
|
m_xOptionsExpander->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString PasswordToOpenModifyDialog::GetPasswordToOpen() const
|
OUString PasswordToOpenModifyDialog::GetPasswordToOpen() const
|
||||||
{
|
{
|
||||||
const bool bPasswdOk =
|
const bool bPasswdOk =
|
||||||
!m_pImpl->m_pPasswdToOpenED->GetText().isEmpty() &&
|
!m_xPasswdToOpenED->get_text().isEmpty() &&
|
||||||
m_pImpl->m_pPasswdToOpenED->GetText() == m_pImpl->m_pReenterPasswdToOpenED->GetText();
|
m_xPasswdToOpenED->get_text() == m_xReenterPasswdToOpenED->get_text();
|
||||||
return bPasswdOk ? m_pImpl->m_pPasswdToOpenED->GetText() : OUString();
|
return bPasswdOk ? m_xPasswdToOpenED->get_text() : OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OUString PasswordToOpenModifyDialog::GetPasswordToModify() const
|
OUString PasswordToOpenModifyDialog::GetPasswordToModify() const
|
||||||
{
|
{
|
||||||
const bool bPasswdOk =
|
const bool bPasswdOk =
|
||||||
!m_pImpl->m_pPasswdToModifyED->GetText().isEmpty() &&
|
!m_xPasswdToModifyED->get_text().isEmpty() &&
|
||||||
m_pImpl->m_pPasswdToModifyED->GetText() == m_pImpl->m_pReenterPasswdToModifyED->GetText();
|
m_xPasswdToModifyED->get_text() == m_xReenterPasswdToModifyED->get_text();
|
||||||
return bPasswdOk ? m_pImpl->m_pPasswdToModifyED->GetText() : OUString();
|
return bPasswdOk ? m_xPasswdToModifyED->get_text() : OUString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PasswordToOpenModifyDialog::IsRecommendToOpenReadonly() const
|
bool PasswordToOpenModifyDialog::IsRecommendToOpenReadonly() const
|
||||||
{
|
{
|
||||||
return m_pImpl->m_pOpenReadonlyCB->IsChecked();
|
return m_xOpenReadonlyCB->get_active();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -143,7 +143,12 @@ IMPL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl);
|
|||||||
IMPL_ABSTDLG_BASE(AbstractLinksDialog_Impl);
|
IMPL_ABSTDLG_BASE(AbstractLinksDialog_Impl);
|
||||||
IMPL_ABSTDLG_BASE(AbstractSpellDialog_Impl);
|
IMPL_ABSTDLG_BASE(AbstractSpellDialog_Impl);
|
||||||
IMPL_ABSTDLG_BASE(AbstractSvxPostItDialog_Impl);
|
IMPL_ABSTDLG_BASE(AbstractSvxPostItDialog_Impl);
|
||||||
IMPL_ABSTDLG_BASE(AbstractPasswordToOpenModifyDialog_Impl);
|
|
||||||
|
short AbstractPasswordToOpenModifyDialog_Impl::Execute()
|
||||||
|
{
|
||||||
|
return m_xDlg->run();
|
||||||
|
}
|
||||||
|
|
||||||
IMPL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl);
|
IMPL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl);
|
||||||
|
|
||||||
|
|
||||||
@@ -785,15 +790,17 @@ vcl::Window * AbstractSvxPostItDialog_Impl::GetWindow()
|
|||||||
|
|
||||||
OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToOpen() const
|
OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToOpen() const
|
||||||
{
|
{
|
||||||
return pDlg->GetPasswordToOpen();
|
return m_xDlg->GetPasswordToOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToModify() const
|
OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToModify() const
|
||||||
{
|
{
|
||||||
return pDlg->GetPasswordToModify();
|
return m_xDlg->GetPasswordToModify();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AbstractPasswordToOpenModifyDialog_Impl::IsRecommendToOpenReadonly() const
|
bool AbstractPasswordToOpenModifyDialog_Impl::IsRecommendToOpenReadonly() const
|
||||||
{
|
{
|
||||||
return pDlg->IsRecommendToOpenReadonly();
|
return m_xDlg->IsRecommendToOpenReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create dialogs with simplest interface
|
// Create dialogs with simplest interface
|
||||||
@@ -1515,11 +1522,9 @@ VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDl
|
|||||||
}
|
}
|
||||||
|
|
||||||
VclPtr<AbstractPasswordToOpenModifyDialog> AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog(
|
VclPtr<AbstractPasswordToOpenModifyDialog> AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog(
|
||||||
vcl::Window * pParent,
|
weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify)
|
||||||
sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify )
|
|
||||||
{
|
{
|
||||||
VclPtrInstance<PasswordToOpenModifyDialog> pDlg( pParent, nMaxPasswdLen, bIsPasswordToModify );
|
return VclPtr<AbstractPasswordToOpenModifyDialog_Impl>::Create(new PasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify));
|
||||||
return VclPtr<AbstractPasswordToOpenModifyDialog_Impl>::Create( pDlg );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VclPtr<AbstractScreenshotAnnotationDlg> AbstractDialogFactory_Impl::CreateScreenshotAnnotationDlg(
|
VclPtr<AbstractScreenshotAnnotationDlg> AbstractDialogFactory_Impl::CreateScreenshotAnnotationDlg(
|
||||||
|
@@ -458,8 +458,14 @@ private:
|
|||||||
class PasswordToOpenModifyDialog;
|
class PasswordToOpenModifyDialog;
|
||||||
class AbstractPasswordToOpenModifyDialog_Impl : public AbstractPasswordToOpenModifyDialog
|
class AbstractPasswordToOpenModifyDialog_Impl : public AbstractPasswordToOpenModifyDialog
|
||||||
{
|
{
|
||||||
DECL_ABSTDLG_BASE( AbstractPasswordToOpenModifyDialog_Impl, PasswordToOpenModifyDialog )
|
protected:
|
||||||
|
std::unique_ptr<PasswordToOpenModifyDialog> m_xDlg;
|
||||||
|
public:
|
||||||
|
explicit AbstractPasswordToOpenModifyDialog_Impl(PasswordToOpenModifyDialog* p)
|
||||||
|
: m_xDlg(p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual short Execute() override;
|
||||||
virtual OUString GetPasswordToOpen() const override;
|
virtual OUString GetPasswordToOpen() const override;
|
||||||
virtual OUString GetPasswordToModify() const override;
|
virtual OUString GetPasswordToModify() const override;
|
||||||
virtual bool IsRecommendToOpenReadonly() const override;
|
virtual bool IsRecommendToOpenReadonly() const override;
|
||||||
@@ -648,7 +654,7 @@ public:
|
|||||||
|
|
||||||
virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) override;
|
virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) override;
|
||||||
|
|
||||||
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override;
|
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override;
|
||||||
|
|
||||||
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override;
|
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override;
|
||||||
};
|
};
|
||||||
|
@@ -19,26 +19,37 @@
|
|||||||
#ifndef INCLUDED_CUI_SOURCE_INC_PASSWDOMDLG_HXX
|
#ifndef INCLUDED_CUI_SOURCE_INC_PASSWDOMDLG_HXX
|
||||||
#define INCLUDED_CUI_SOURCE_INC_PASSWDOMDLG_HXX
|
#define INCLUDED_CUI_SOURCE_INC_PASSWDOMDLG_HXX
|
||||||
|
|
||||||
|
#include <vcl/weld.hxx>
|
||||||
#include <sfx2/basedlgs.hxx>
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
struct PasswordToOpenModifyDialog_Impl;
|
class PasswordToOpenModifyDialog : public weld::GenericDialogController
|
||||||
|
|
||||||
class PasswordToOpenModifyDialog : public SfxModalDialog
|
|
||||||
{
|
{
|
||||||
std::unique_ptr< PasswordToOpenModifyDialog_Impl > m_pImpl;
|
std::unique_ptr<weld::Entry> m_xPasswdToOpenED;
|
||||||
|
std::unique_ptr<weld::Entry> m_xReenterPasswdToOpenED;
|
||||||
|
std::unique_ptr<weld::Expander> m_xOptionsExpander;
|
||||||
|
std::unique_ptr<weld::Button> m_xOk;
|
||||||
|
std::unique_ptr<weld::CheckButton> m_xOpenReadonlyCB;
|
||||||
|
std::unique_ptr<weld::Entry> m_xPasswdToModifyED;
|
||||||
|
std::unique_ptr<weld::Entry> m_xReenterPasswdToModifyED;
|
||||||
|
|
||||||
|
OUString m_aOneMismatch;
|
||||||
|
OUString m_aTwoMismatch;
|
||||||
|
OUString m_aInvalidStateForOkButton;
|
||||||
|
OUString m_aInvalidStateForOkButton_v2;
|
||||||
|
|
||||||
|
bool m_bIsPasswordToModify;
|
||||||
|
|
||||||
|
|
||||||
|
DECL_LINK(OkBtnClickHdl, weld::Button&, void);
|
||||||
|
|
||||||
PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ) = delete;
|
PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ) = delete;
|
||||||
PasswordToOpenModifyDialog & operator = ( const PasswordToOpenModifyDialog & ) = delete;
|
PasswordToOpenModifyDialog & operator = ( const PasswordToOpenModifyDialog & ) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PasswordToOpenModifyDialog( vcl::Window * pParent,
|
PasswordToOpenModifyDialog(weld::Window* pParent,
|
||||||
sal_uInt16 nMaxPasswdLen /* 0 -> no max len enforced */,
|
sal_uInt16 nMaxPasswdLen /* 0 -> no max len enforced */,
|
||||||
bool bIsPasswordToModify );
|
bool bIsPasswordToModify );
|
||||||
virtual ~PasswordToOpenModifyDialog() override;
|
|
||||||
|
|
||||||
// AbstractPasswordToOpenModifyDialog
|
// AbstractPasswordToOpenModifyDialog
|
||||||
OUString GetPasswordToOpen() const;
|
OUString GetPasswordToOpen() const;
|
||||||
@@ -46,7 +57,6 @@ public:
|
|||||||
bool IsRecommendToOpenReadonly() const;
|
bool IsRecommendToOpenReadonly() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -1,11 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.16.1 -->
|
<!-- Generated with glade 3.20.2 -->
|
||||||
<interface domain="cui">
|
<interface domain="cui">
|
||||||
<requires lib="gtk+" version="3.18"/>
|
<requires lib="gtk+" version="3.18"/>
|
||||||
<object class="GtkDialog" id="PasswordDialog">
|
<object class="GtkDialog" id="PasswordDialog">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="border_width">6</property>
|
<property name="border_width">6</property>
|
||||||
<property name="title" translatable="yes" context="password|PasswordDialog">Set Password</property>
|
<property name="title" translatable="yes" context="password|PasswordDialog">Set Password</property>
|
||||||
|
<property name="modal">True</property>
|
||||||
|
<property name="default_width">0</property>
|
||||||
|
<property name="default_height">0</property>
|
||||||
<property name="type_hint">normal</property>
|
<property name="type_hint">normal</property>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
<object class="GtkBox" id="dialog-vbox1">
|
<object class="GtkBox" id="dialog-vbox1">
|
||||||
@@ -86,32 +89,28 @@
|
|||||||
<object class="GtkLabel" id="label5">
|
<object class="GtkLabel" id="label5">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="password|label5">Confirm password</property>
|
<property name="label" translatable="yes" context="password|label5">Confirm password</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="mnemonic_widget">confirmpassEntry</property>
|
<property name="mnemonic_widget">confirmpassEntry</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label4">
|
<object class="GtkLabel" id="label4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="password|label4">_Enter password to open</property>
|
<property name="label" translatable="yes" context="password|label4">_Enter password to open</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="mnemonic_widget">newpassEntry</property>
|
<property name="mnemonic_widget">newpassEntry</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top_attach">0</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -120,12 +119,13 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="visibility">False</property>
|
<property name="visibility">False</property>
|
||||||
|
<property name="activates_default">True</property>
|
||||||
|
<property name="width_chars">50</property>
|
||||||
|
<property name="input_purpose">password</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -134,28 +134,26 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="visibility">False</property>
|
<property name="visibility">False</property>
|
||||||
|
<property name="activates_default">True</property>
|
||||||
|
<property name="input_purpose">password</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label1">
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="password|label1">Note: After a password has been set, the document will only open with the password. Should you lose the password, there will be no way to recover the document. Please also note that this password is case-sensitive.</property>
|
<property name="label" translatable="yes" context="password|label1">Note: After a password has been set, the document will only open with the password. Should you lose the password, there will be no way to recover the document. Please also note that this password is case-sensitive.</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
<property name="max_width_chars">60</property>
|
<property name="max_width_chars">60</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -192,24 +190,20 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top_attach">0</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label7">
|
<object class="GtkLabel" id="label7">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="password|label7">Enter password to allow editing</property>
|
<property name="label" translatable="yes" context="password|label7">Enter password to allow editing</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="mnemonic_widget">newpassroEntry</property>
|
<property name="mnemonic_widget">newpassroEntry</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -218,28 +212,26 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="visibility">False</property>
|
<property name="visibility">False</property>
|
||||||
|
<property name="activates_default">True</property>
|
||||||
|
<property name="input_purpose">password</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label8">
|
<object class="GtkLabel" id="label8">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes" context="password|label8">Confirm password</property>
|
<property name="label" translatable="yes" context="password|label8">Confirm password</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="mnemonic_widget">confirmropassEntry</property>
|
<property name="mnemonic_widget">confirmropassEntry</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -248,12 +240,12 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="visibility">False</property>
|
<property name="visibility">False</property>
|
||||||
|
<property name="activates_default">True</property>
|
||||||
|
<property name="input_purpose">password</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -284,8 +276,6 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">5</property>
|
<property name="top_attach">5</property>
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -322,6 +312,9 @@
|
|||||||
<action-widget response="-5">ok</action-widget>
|
<action-widget response="-5">ok</action-widget>
|
||||||
<action-widget response="-6">cancel</action-widget>
|
<action-widget response="-6">cancel</action-widget>
|
||||||
</action-widgets>
|
</action-widgets>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkSizeGroup" id="sizegroup1"/>
|
<object class="GtkSizeGroup" id="sizegroup1"/>
|
||||||
</interface>
|
</interface>
|
||||||
|
@@ -31,7 +31,11 @@
|
|||||||
namespace vcl { class Window; }
|
namespace vcl { class Window; }
|
||||||
class Dialog;
|
class Dialog;
|
||||||
class Bitmap;
|
class Bitmap;
|
||||||
namespace weld { class DialogController; }
|
namespace weld
|
||||||
|
{
|
||||||
|
class DialogController;
|
||||||
|
class Window;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some things multiple-inherit from VclAbstractDialog and OutputDevice,
|
* Some things multiple-inherit from VclAbstractDialog and OutputDevice,
|
||||||
@@ -120,7 +124,7 @@ public:
|
|||||||
virtual VclPtr<VclAbstractDialog> CreateVclDialog(vcl::Window* pParent, sal_uInt32 nId) = 0;
|
virtual VclPtr<VclAbstractDialog> CreateVclDialog(vcl::Window* pParent, sal_uInt32 nId) = 0;
|
||||||
|
|
||||||
// creates instance of PasswordToOpenModifyDialog from cui
|
// creates instance of PasswordToOpenModifyDialog from cui
|
||||||
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
|
virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) = 0;
|
||||||
|
|
||||||
// creates instance of ScreenshotAnnotationDlg from cui
|
// creates instance of ScreenshotAnnotationDlg from cui
|
||||||
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
|
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
|
||||||
|
@@ -500,7 +500,7 @@ handleMasterPasswordRequest_(
|
|||||||
|
|
||||||
void
|
void
|
||||||
executePasswordDialog(
|
executePasswordDialog(
|
||||||
vcl::Window * pParent,
|
weld::Window * pParent,
|
||||||
LoginErrorInfo & rInfo,
|
LoginErrorInfo & rInfo,
|
||||||
task::PasswordRequestMode nMode,
|
task::PasswordRequestMode nMode,
|
||||||
const OUString& aDocName,
|
const OUString& aDocName,
|
||||||
@@ -517,7 +517,7 @@ executePasswordDialog(
|
|||||||
{
|
{
|
||||||
if (bIsSimplePasswordRequest)
|
if (bIsSimplePasswordRequest)
|
||||||
{
|
{
|
||||||
std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent ? pParent->GetFrameWeld() : nullptr, nMode,
|
std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent, nMode,
|
||||||
aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest));
|
aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest));
|
||||||
xDialog->SetMinLen(0);
|
xDialog->SetMinLen(0);
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ executePasswordDialog(
|
|||||||
}
|
}
|
||||||
else // enter password or reenter password
|
else // enter password or reenter password
|
||||||
{
|
{
|
||||||
std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent ? pParent->GetFrameWeld() : nullptr, nMode,
|
std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent, nMode,
|
||||||
aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest));
|
aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest));
|
||||||
xDialog->SetMinLen(0);
|
xDialog->SetMinLen(0);
|
||||||
|
|
||||||
@@ -558,7 +558,7 @@ executePasswordDialog(
|
|||||||
|
|
||||||
void
|
void
|
||||||
handlePasswordRequest_(
|
handlePasswordRequest_(
|
||||||
vcl::Window * pParent,
|
weld::Window * pParent,
|
||||||
task::PasswordRequestMode nMode,
|
task::PasswordRequestMode nMode,
|
||||||
uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
|
uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
|
||||||
rContinuations,
|
rContinuations,
|
||||||
@@ -723,7 +723,7 @@ UUIInteractionHelper::handlePasswordRequest(
|
|||||||
|
|
||||||
if (bDoHandleRequest)
|
if (bDoHandleRequest)
|
||||||
{
|
{
|
||||||
handlePasswordRequest_( pParent, nMode, rContinuations,
|
handlePasswordRequest_( pParent ? pParent->GetFrameWeld() : nullptr, nMode, rContinuations,
|
||||||
aDocumentName, bMSCryptoMode, bIsPasswordToModify );
|
aDocumentName, bMSCryptoMode, bIsPasswordToModify );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -731,7 +731,7 @@ UUIInteractionHelper::handlePasswordRequest(
|
|||||||
task::PasswordRequest aPasswordRequest;
|
task::PasswordRequest aPasswordRequest;
|
||||||
if( aAnyRequest >>= aPasswordRequest )
|
if( aAnyRequest >>= aPasswordRequest )
|
||||||
{
|
{
|
||||||
handlePasswordRequest_(getParentProperty(),
|
handlePasswordRequest_(pParent ? pParent->GetFrameWeld() : nullptr,
|
||||||
aPasswordRequest.Mode,
|
aPasswordRequest.Mode,
|
||||||
rRequest->getContinuations(),
|
rRequest->getContinuations(),
|
||||||
OUString(),
|
OUString(),
|
||||||
|
Reference in New Issue
Block a user