summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
Diffstat (limited to 'uui')
-rw-r--r--uui/source/masterpasscrtdlg.cxx7
-rw-r--r--uui/source/masterpasscrtdlg.hxx1
-rw-r--r--uui/uiconfig/ui/setmasterpassworddlg.ui23
3 files changed, 24 insertions, 7 deletions
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 4801bec28f85..2216ea5a1d48 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -21,6 +21,7 @@
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <strings.hrc>
+#include <svl/PasswordHelper.hxx>
#include "masterpasscrtdlg.hxx"
// MasterPasswordCreateDialog---------------------------------------------------
@@ -28,7 +29,10 @@
IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, weld::Entry&, void)
{
- m_xOKBtn->set_sensitive(m_xEDMasterPasswordCrt->get_text().getLength() >= 1);
+ OUString aPasswordText = m_xEDMasterPasswordCrt->get_text();
+ m_xOKBtn->set_sensitive(aPasswordText.getLength() >= 1);
+ m_xPasswdStrengthBar->set_percentage(
+ SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText));
}
IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void)
@@ -55,6 +59,7 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog(weld::Window* pParent, co
, m_xEDMasterPasswordCrt(m_xBuilder->weld_entry("password1"))
, m_xEDMasterPasswordRepeat(m_xBuilder->weld_entry("password2"))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
+ , m_xPasswdStrengthBar(m_xBuilder->weld_level_bar("password1levelbar"))
{
m_xOKBtn->set_sensitive(false);
m_xOKBtn->connect_clicked( LINK( this, MasterPasswordCreateDialog, OKHdl_Impl ) );
diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx
index a8695fc1ed27..f7f01cda79cc 100644
--- a/uui/source/masterpasscrtdlg.hxx
+++ b/uui/source/masterpasscrtdlg.hxx
@@ -29,6 +29,7 @@ private:
std::unique_ptr<weld::Entry> m_xEDMasterPasswordCrt;
std::unique_ptr<weld::Entry> m_xEDMasterPasswordRepeat;
std::unique_ptr<weld::Button> m_xOKBtn;
+ std::unique_ptr<weld::LevelBar> m_xPasswdStrengthBar;
DECL_LINK(OKHdl_Impl, weld::Button&, void);
DECL_LINK(EditHdl_Impl, weld::Entry&, void);
diff --git a/uui/uiconfig/ui/setmasterpassworddlg.ui b/uui/uiconfig/ui/setmasterpassworddlg.ui
index 0402b4de7b35..52cec48eb30a 100644
--- a/uui/uiconfig/ui/setmasterpassworddlg.ui
+++ b/uui/uiconfig/ui/setmasterpassworddlg.ui
@@ -130,18 +130,29 @@
</packing>
</child>
<child>
+ <object class="GtkLevelBar" id="password1levelbar">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="setmasterpassworddlg|label3">_Reenter password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">password2</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">password2</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -161,7 +172,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -180,7 +191,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>