[Libreoffice-commits] core.git: cui/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Aug 19 10:06:59 UTC 2018
cui/source/dialogs/passwdomdlg.cxx | 13 +++++++++++++
cui/source/inc/passwdomdlg.hxx | 3 +++
2 files changed, 16 insertions(+)
New commits:
commit ba91d344bbf81f9e9cc98e7a9bfef9f5e9cdeb07
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Aug 1 11:52:15 2018 +0200
Commit: Heiko Tietze <tietze.heiko at gmail.com>
CommitDate: Sun Aug 19 12:06:39 2018 +0200
tdf#119030: Disable entries if open file read-only is unchecked
Change-Id: I9e00094f92210a025537f2115e2529acb82d960f
Reviewed-on: https://gerrit.libreoffice.org/58400
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
Tested-by: Heiko Tietze <tietze.heiko at gmail.com>
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index a5efbd0d6428..dbe433f8a4f1 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -76,7 +76,9 @@ PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(weld::Window * pParent, s
, m_xOptionsExpander(m_xBuilder->weld_expander("expander"))
, m_xOk(m_xBuilder->weld_button("ok"))
, m_xOpenReadonlyCB(m_xBuilder->weld_check_button("readonly"))
+ , m_xPasswdToModifyFT(m_xBuilder->weld_label("label7"))
, m_xPasswdToModifyED(m_xBuilder->weld_entry("newpassroEntry"))
+ , m_xReenterPasswdToModifyFT(m_xBuilder->weld_label("label8"))
, m_xReenterPasswdToModifyED(m_xBuilder->weld_entry("confirmropassEntry"))
, m_aOneMismatch( CuiResId( RID_SVXSTR_ONE_PASSWORD_MISMATCH ) )
, m_aTwoMismatch( CuiResId( RID_SVXSTR_TWO_PASSWORDS_MISMATCH ) )
@@ -99,6 +101,9 @@ PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(weld::Window * pParent, s
m_xOptionsExpander->set_sensitive(bIsPasswordToModify);
if (!bIsPasswordToModify)
m_xOptionsExpander->hide();
+
+ m_xOpenReadonlyCB->connect_clicked(LINK(this, PasswordToOpenModifyDialog, ReadonlyOnOffHdl));
+ ReadonlyOnOffHdl(*m_xOpenReadonlyCB);
}
OUString PasswordToOpenModifyDialog::GetPasswordToOpen() const
@@ -124,5 +129,13 @@ bool PasswordToOpenModifyDialog::IsRecommendToOpenReadonly() const
return m_xOpenReadonlyCB->get_active();
}
+IMPL_LINK_NOARG(PasswordToOpenModifyDialog, ReadonlyOnOffHdl, weld::Button&, void)
+{
+ bool bEnable = m_xOpenReadonlyCB->get_active();
+ m_xPasswdToModifyED->set_sensitive(bEnable);
+ m_xPasswdToModifyFT->set_sensitive(bEnable);
+ m_xReenterPasswdToModifyED->set_sensitive(bEnable);
+ m_xReenterPasswdToModifyFT->set_sensitive(bEnable);
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/passwdomdlg.hxx b/cui/source/inc/passwdomdlg.hxx
index 2d56f3b480ce..73e8bade074a 100644
--- a/cui/source/inc/passwdomdlg.hxx
+++ b/cui/source/inc/passwdomdlg.hxx
@@ -30,7 +30,9 @@ class PasswordToOpenModifyDialog : public weld::GenericDialogController
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::Label> m_xPasswdToModifyFT;
std::unique_ptr<weld::Entry> m_xPasswdToModifyED;
+ std::unique_ptr<weld::Label> m_xReenterPasswdToModifyFT;
std::unique_ptr<weld::Entry> m_xReenterPasswdToModifyED;
OUString m_aOneMismatch;
@@ -42,6 +44,7 @@ class PasswordToOpenModifyDialog : public weld::GenericDialogController
DECL_LINK(OkBtnClickHdl, weld::Button&, void);
+ DECL_LINK(ReadonlyOnOffHdl, weld::Button&, void);
PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ) = delete;
PasswordToOpenModifyDialog & operator = ( const PasswordToOpenModifyDialog & ) = delete;
More information about the Libreoffice-commits
mailing list