From 17694c906f94a195a2d5086e0e87afa1c852107b Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Mon, 7 Jun 2021 14:00:23 +0200 Subject: 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 --- uui/source/passworddlg.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'uui') 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 #include +#include #include #include #include @@ -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); -- cgit v1.2.3