diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-06-07 14:00:23 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-06-09 21:45:53 +0200 |
commit | 17694c906f94a195a2d5086e0e87afa1c852107b (patch) | |
tree | b3dd4cf92a821f5cb3bf0ca0a285c0b275764d46 /uui | |
parent | 2aa2d03ec4e775d9399420c21cd1f2e972984154 (diff) |
tdf#66553 - Add file/product name to title bar for password managers
Change-Id: I6a16e654edcbc3511ee8cbea0889d858e22f2a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116782
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/passworddlg.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx index 3e8d1550f6cd..694e717216b1 100644 --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -21,6 +21,7 @@ #include <strings.hrc> #include <unotools/resmgr.hxx> +#include <unotools/configmgr.hxx> #include <tools/urlobj.hxx> #include <tools/debug.hxx> #include <vcl/svapp.hxx> @@ -78,6 +79,14 @@ PasswordDialog::PasswordDialog(weld::Window* pParent, const char* pStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN; OUString aMessage(Translate::get(pStrId, rResLocale)); INetURLObject url(aDocURL); + + // tdf#66553 - add file name to title bar for password managers + OUString aFileName = url.getName(INetURLObject::LAST_SEGMENT, true, + INetURLObject::DecodeMechanism::Unambiguous); + if (!aFileName.isEmpty()) + aFileName += " - " + utl::ConfigManager::getProductName(); + m_xDialog->set_title(aTitle + " - " + aFileName); + aMessage += url.HasError() ? aDocURL : url.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous); m_xFTPassword->set_label(aMessage); |