summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-18 11:41:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-19 09:51:51 +0200
commit48ecbe9f7b9e324e9acc544c9ad4121d30a232d7 (patch)
treef3e40e4073e2a9ea3cad5cfa946df9341868dd43 /sfx2
parent9697c3d8c8a82602b686e622f8e3a7fe41b8d7a8 (diff)
tdf#50400 show an explanatory label if ascii-only password is required
Change-Id: Ib0e3d07e29d56e9782b4b9d215eab4d743158a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134526 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/passwd.cxx12
-rw-r--r--sfx2/uiconfig/ui/password.ui19
2 files changed, 31 insertions, 0 deletions
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index da4dd80f0e6c..13822c4a94d4 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -56,7 +56,12 @@ IMPL_LINK(SfxPasswordDialog, InsertTextHdl, OUString&, rTest, bool)
}
if (bReset)
+ {
rTest = aFilter.makeStringAndClear();
+ // upgrade from "Normal" to "Warning" if a invalid letter was
+ // discarded
+ m_xOnlyAsciiFT->set_label_type(weld::LabelType::Warning);
+ }
return true;
}
@@ -97,6 +102,7 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, const OUString* pGro
, m_xConfirm2FT(m_xBuilder->weld_label("confirm2ft"))
, m_xConfirm2ED(m_xBuilder->weld_entry("confirm2ed"))
, m_xMinLengthFT(m_xBuilder->weld_label("minlenft"))
+ , m_xOnlyAsciiFT(m_xBuilder->weld_label("onlyascii"))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
, maMinLenPwdStr(SfxResId(STR_PASSWD_MIN_LEN))
, maMinLenPwdStr1(SfxResId(STR_PASSWD_MIN_LEN1))
@@ -153,6 +159,12 @@ void SfxPasswordDialog::ShowMinLengthText(bool bShow)
m_xMinLengthFT->set_visible(bShow);
}
+void SfxPasswordDialog::AllowAsciiOnly()
+{
+ mbAsciiOnly = true;
+ m_xOnlyAsciiFT->show();
+}
+
short SfxPasswordDialog::run()
{
m_xUserFT->hide();
diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
index 4cc57090042b..ff7cfe9f1006 100644
--- a/sfx2/uiconfig/ui/password.ui
+++ b/sfx2/uiconfig/ui/password.ui
@@ -330,6 +330,25 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="onlyascii">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="margin-start">6</property>
+ <property name="label" translatable="yes" context="password|onlyascii">Only Basic Latin characters can be entered</property>
+ <property name="xalign">0</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="onlyascii-atkobject">
+ <property name="AtkObject::accessible-role" translatable="no">static</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>