diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-08-17 17:15:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-08-18 21:12:31 +0200 |
commit | c4dd4d9a020db030b031e84677f7e857dce14b42 (patch) | |
tree | 045390d226456105da6ed13047cfbc9bd3e364ed /vcl/unx/generic | |
parent | 36ec19859c5a2e761649215d06e5d723b965faad (diff) |
Related: rhbz#1691287 fill in default domain and username
and grab focus to first entry entry
Change-Id: Icb50766948c77072eaab9faf89436c6ecbb49ecc
Reviewed-on: https://gerrit.libreoffice.org/77645
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/printer/cupsmgr.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 34da816abb28..7d107de5724d 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -718,7 +718,14 @@ namespace OUString aText(m_xText->get_label()); aText = aText.replaceFirst("%s", OStringToOUString(rServer, osl_getThreadTextEncoding())); m_xText->set_label(aText); - m_xUserEdit->set_text(OStringToOUString(rUserName, osl_getThreadTextEncoding())); + m_xDomainEdit->set_text("WORKGROUP"); + if (rUserName.isEmpty()) + m_xUserEdit->grab_focus(); + else + { + m_xUserEdit->set_text(OStringToOUString(rUserName, osl_getThreadTextEncoding())); + m_xPassEdit->grab_focus(); + } } bool AuthenticateQuery(const OString& rServer, OString& rUserName, OString& rPassword) @@ -786,8 +793,9 @@ bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTi if (bDomain || bUser || bPass) { OString sPrinterName(OUStringToOString(rPrintername, RTL_TEXTENCODING_UTF8)); + OString sUser = cupsUser(); vcl::Window* pWin = Application::GetDefDialogParent(); - RTSPWDialog aDialog(pWin ? pWin->GetFrameWeld() : nullptr, sPrinterName, ""); + RTSPWDialog aDialog(pWin ? pWin->GetFrameWeld() : nullptr, sPrinterName, sUser); aDialog.SetDomainVisible(bDomain); aDialog.SetUserVisible(bUser); aDialog.SetPassVisible(bPass); |