[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 18 19:13:40 UTC 2019


 vcl/unx/generic/printer/cupsmgr.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit c4dd4d9a020db030b031e84677f7e857dce14b42
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Aug 17 17:15:40 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Aug 18 21:12:31 2019 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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);


More information about the Libreoffice-commits mailing list