diff options
-rw-r--r-- | include/sfx2/passwd.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 12 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/password.ui | 19 |
3 files changed, 33 insertions, 4 deletions
diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx index cbbbf7a4a33d..3302c370b3b2 100644 --- a/include/sfx2/passwd.hxx +++ b/include/sfx2/passwd.hxx @@ -60,6 +60,7 @@ private: std::unique_ptr<weld::Entry> m_xConfirm2ED; std::unique_ptr<weld::Label> m_xMinLengthFT; + std::unique_ptr<weld::Label> m_xOnlyAsciiFT; std::unique_ptr<weld::Button> m_xOKBtn; @@ -117,11 +118,8 @@ public: { mnExtras = nExtras; } - void AllowAsciiOnly() - { - mbAsciiOnly = true; - } + void AllowAsciiOnly(); void ShowMinLengthText(bool bShow); virtual short run() override; 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> |