[Libreoffice-commits] core.git: uui/AllLangResTarget_uui.mk uui/source uui/uiconfig uui/UIConfig_uui.mk

Caolán McNamara caolanm at redhat.com
Mon Dec 23 05:05:21 PST 2013


 uui/AllLangResTarget_uui.mk          |    1 
 uui/UIConfig_uui.mk                  |    1 
 uui/source/iahndl-authentication.cxx |    4 
 uui/source/ids.hrc                   |    8 
 uui/source/logindlg.cxx              |  261 +++++++--------------------
 uui/source/logindlg.hrc              |   52 -----
 uui/source/logindlg.hxx              |   69 +++----
 uui/source/logindlg.src              |  185 -------------------
 uui/uiconfig/ui/logindialog.ui       |  338 +++++++++++++++++++++++++++++++++++
 9 files changed, 444 insertions(+), 475 deletions(-)

New commits:
commit 190e66534868e6ed553150282d95381f5dd5f51a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 23 12:52:49 2013 +0000

    convert login dialog to .ui
    
    Change-Id: I775c87422f05552b7283f9c6f7103a72262f764e

diff --git a/uui/AllLangResTarget_uui.mk b/uui/AllLangResTarget_uui.mk
index 17e29b2..a0238f1 100644
--- a/uui/AllLangResTarget_uui.mk
+++ b/uui/AllLangResTarget_uui.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_SrsTarget_add_files,uui/res,\
 	uui/source/fltdlg.src \
 	uui/source/ids.src \
 	uui/source/lockfailed.src \
-	uui/source/logindlg.src \
 	uui/source/nameclashdlg.src \
 	uui/source/newerverwarn.src \
 	uui/source/openlocked.src \
diff --git a/uui/UIConfig_uui.mk b/uui/UIConfig_uui.mk
index 6c33a2c..df6d3e8 100644
--- a/uui/UIConfig_uui.mk
+++ b/uui/UIConfig_uui.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_UIConfig_UIConfig,uui))
 
 $(eval $(call gb_UIConfig_add_uifiles,uui,\
+	uui/uiconfig/ui/logindialog \
 	uui/uiconfig/ui/masterpassworddlg \
 	uui/uiconfig/ui/setmasterpassworddlg \
 	uui/uiconfig/ui/sslwarndialog \
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 0f5f728..e1868c6 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -87,9 +87,8 @@ executeLoginDialog(
         if (!bCanUseSysCreds)
             nFlags |= LF_NO_USESYSCREDS;
 
-        boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui"));
         boost::scoped_ptr< LoginDialog > xDialog(
-                new LoginDialog( pParent, nFlags, rInfo.GetServer(), rRealm, xManager.get()));
+                new LoginDialog(pParent, nFlags, rInfo.GetServer(), rRealm));
         if (!rInfo.GetErrorText().isEmpty())
             xDialog->SetErrorText(rInfo.GetErrorText());
         xDialog->SetName(rInfo.GetUserName());
@@ -101,6 +100,7 @@ executeLoginDialog(
 
         if (bSavePassword)
         {
+            boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui"));
             xDialog->SetSavePasswordText(
                 ResId(rInfo.GetIsRememberPersistent()
                           ? RID_SAVE_PASSWORD
diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc
index 9385d5c..c40067b6 100644
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
@@ -153,19 +153,11 @@
 #define ERRCODE_UUI_SSLWARN_INVALID_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 1)
 #define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3)
 
-#define HID_DLG_LOGIN                                          "UUI_HID_DLG_LOGIN"
 #define HID_DLG_FILTER_SELECT                                  "UUI_HID_DLG_FILTER_SELECT"
 #define HID_DLG_PASSWORD_UUI                                   "UUI_HID_DLG_PASSWORD_UUI"
 #define HID_XMLSECDLG_MACROWARN                                "UUI_HID_XMLSECDLG_MACROWARN"
 #define HID_DLG_NEWERVERSIONWARNING                            "UUI_HID_DLG_NEWERVERSIONWARNING"
 
-#define HID_LOGIN_DLG_PATH                      "UUI_HID_LOGIN_DLG_PATH"
-#define HID_LOGIN_DLG_BROWSE                    "UUI_HID_LOGIN_DLG_BROWSE"
-#define HID_LOGIN_DLG_USER_NAME                 "UUI_HID_LOGIN_DLG_USER_NAME"
-#define HID_LOGIN_DLG_PASSWORD                  "UUI_HID_LOGIN_DLG_PASSWORD"
-#define HID_LOGIN_DLG_ACCOUNT                   "UUI_HID_LOGIN_DLG_ACCOUNT"
-#define HID_LOGIN_DLG_REMEMBER_PASSWORD         "UUI_HID_LOGIN_DLG_REMEMBER_PASSWORD"
-#define HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS    "UUI_HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS"
 #define HID_DLG_SIMPLE_NAME_CLASH               "UUI_HID_DLG_SIMPLE_NAME_CLASH"
 
 #endif // UUI_IDS_HRC
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 8d9d96a..3775cc4 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -21,7 +21,6 @@
 #include <vcl/msgbox.hxx>
 #include "logindlg.hxx"
 
-#include "logindlg.hrc"
 #include "ids.hrc"
 #include <tools/resid.hxx>
 #include <osl/file.hxx>
@@ -37,175 +36,78 @@
 
 using namespace com::sun::star;
 
-static void lcl_Move( Window &rWin, long nOffset )
-{
-    Point aTmp( rWin.GetPosPixel() );
-    aTmp.Y() -= nOffset;
-    rWin.SetPosPixel( aTmp );
-}
-
-
 void LoginDialog::HideControls_Impl( sal_uInt16 nFlags )
 {
-    bool bPathHide = sal_False;
-    bool bErrorHide = sal_False;
-    bool bAccountHide = sal_False;
-    bool bUseSysCredsHide = sal_False;
-
     if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH )
     {
-        aPathFT.Hide();
-        aPathED.Hide();
-        aPathBtn.Hide();
-        bPathHide = sal_True;
+        m_pPathFT->Hide();
+        m_pPathED->Hide();
+        m_pPathBtn->Hide();
     }
     else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY )
     {
-        aPathED.Enable( sal_False );
-        aPathBtn.Enable( sal_False );
+        m_pPathED->Enable( sal_False );
+        m_pPathBtn->Enable( sal_False );
     }
 
     if ( ( nFlags & LF_NO_USERNAME ) == LF_NO_USERNAME )
     {
-        aNameFT.Hide();
-        aNameED.Hide();
+        m_pNameFT->Hide();
+        m_pNameED->Hide();
     }
     else if ( ( nFlags & LF_USERNAME_READONLY ) == LF_USERNAME_READONLY )
     {
-        aNameED.Enable( sal_False );
+        m_pNameED->Enable( sal_False );
     }
 
     if ( ( nFlags & LF_NO_PASSWORD ) == LF_NO_PASSWORD )
     {
-        aPasswordFT.Hide();
-        aPasswordED.Hide();
+        m_pPasswordFT->Hide();
+        m_pPasswordED->Hide();
     }
 
     if ( ( nFlags & LF_NO_SAVEPASSWORD ) == LF_NO_SAVEPASSWORD )
-        aSavePasswdBtn.Hide();
+        m_pSavePasswdBtn->Hide();
 
     if ( ( nFlags & LF_NO_ERRORTEXT ) == LF_NO_ERRORTEXT )
     {
-        aErrorInfo.Hide();
-        aErrorFT.Hide();
-        aLogin1FL.Hide();
-        bErrorHide = sal_True;
+        m_pErrorInfo->Hide();
+        m_pErrorFT->Hide();
     }
 
     if ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT )
     {
-        aAccountFT.Hide();
-        aAccountED.Hide();
-        bAccountHide = sal_True;
+        m_pAccountFT->Hide();
+        m_pAccountED->Hide();
     }
 
     if ( ( nFlags & LF_NO_USESYSCREDS ) == LF_NO_USESYSCREDS )
     {
-        aUseSysCredsCB.Hide();
-        bUseSysCredsHide = sal_True;
-    }
-
-    if ( bErrorHide )
-    {
-        long nOffset = aRequestInfo.GetPosPixel().Y() -
-                       aErrorFT.GetPosPixel().Y();
-        lcl_Move( aRequestInfo, nOffset );
-        lcl_Move( aLogin2FL, nOffset );
-        lcl_Move( aPathFT, nOffset );
-        lcl_Move( aPathED, nOffset );
-        lcl_Move( aPathBtn, nOffset );
-        lcl_Move( aNameFT, nOffset );
-        lcl_Move( aNameED, nOffset );
-        lcl_Move( aPasswordFT, nOffset );
-        lcl_Move( aPasswordED, nOffset );
-        lcl_Move( aAccountFT, nOffset );
-        lcl_Move( aAccountED, nOffset );
-        lcl_Move( aSavePasswdBtn, nOffset );
-        lcl_Move( aUseSysCredsCB, nOffset );
-        lcl_Move( aButtonsFL, nOffset );
-        lcl_Move( aOKBtn, nOffset );
-        lcl_Move( aCancelBtn, nOffset );
-        lcl_Move( aHelpBtn, nOffset );
-
-        Size aNewSiz = GetSizePixel();
-        aNewSiz.Height() -= nOffset;
-        SetSizePixel( aNewSiz );
-    }
-
-    if ( bPathHide )
-    {
-        long nOffset = aNameED.GetPosPixel().Y() -
-                       aPathED.GetPosPixel().Y();
-        lcl_Move( aNameFT, nOffset );
-        lcl_Move( aNameED, nOffset );
-        lcl_Move( aPasswordFT, nOffset );
-        lcl_Move( aPasswordED, nOffset );
-        lcl_Move( aAccountFT, nOffset );
-        lcl_Move( aAccountED, nOffset );
-        lcl_Move( aSavePasswdBtn, nOffset );
-        lcl_Move( aUseSysCredsCB, nOffset );
-        lcl_Move( aButtonsFL, nOffset );
-        lcl_Move( aOKBtn, nOffset );
-        lcl_Move( aCancelBtn, nOffset );
-        lcl_Move( aHelpBtn, nOffset );
-
-        Size aNewSz = GetSizePixel();
-        aNewSz.Height() -= nOffset;
-        SetSizePixel( aNewSz );
+        m_pUseSysCredsCB->Hide();
     }
-
-    if ( bAccountHide )
-    {
-        long nOffset = aAccountED.GetPosPixel().Y() -
-                       aPasswordED.GetPosPixel().Y();
-        lcl_Move( aSavePasswdBtn, nOffset );
-        lcl_Move( aUseSysCredsCB, nOffset );
-        lcl_Move( aButtonsFL, nOffset );
-        lcl_Move( aOKBtn, nOffset );
-        lcl_Move( aCancelBtn, nOffset );
-        lcl_Move( aHelpBtn, nOffset );
-
-        Size aNewSz = GetSizePixel();
-        aNewSz.Height() -= nOffset;
-        SetSizePixel( aNewSz );
-    }
-
-    if ( bUseSysCredsHide )
-    {
-        long nOffset = aUseSysCredsCB.GetPosPixel().Y() -
-                       aSavePasswdBtn.GetPosPixel().Y();
-        lcl_Move( aButtonsFL, nOffset );
-        lcl_Move( aOKBtn, nOffset );
-        lcl_Move( aCancelBtn, nOffset );
-        lcl_Move( aHelpBtn, nOffset );
-
-        Size aNewSz = GetSizePixel();
-        aNewSz.Height() -= nOffset;
-        SetSizePixel( aNewSz );
-    }
-};
+}
 
 void LoginDialog::EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled )
 {
-    aErrorInfo.Enable( !bUseSysCredsEnabled );
-    aErrorFT.Enable( !bUseSysCredsEnabled );
-    aRequestInfo.Enable( !bUseSysCredsEnabled );
-    aPathFT.Enable( !bUseSysCredsEnabled );
-    aPathED.Enable( !bUseSysCredsEnabled );
-    aPathBtn.Enable( !bUseSysCredsEnabled );
-    aNameFT.Enable( !bUseSysCredsEnabled );
-    aNameED.Enable( !bUseSysCredsEnabled );
-    aPasswordFT.Enable( !bUseSysCredsEnabled );
-    aPasswordED.Enable( !bUseSysCredsEnabled );
-    aAccountFT.Enable( !bUseSysCredsEnabled );
-    aAccountED.Enable( !bUseSysCredsEnabled );
+    m_pErrorInfo->Enable( !bUseSysCredsEnabled );
+    m_pErrorFT->Enable( !bUseSysCredsEnabled );
+    m_pRequestInfo->Enable( !bUseSysCredsEnabled );
+    m_pPathFT->Enable( !bUseSysCredsEnabled );
+    m_pPathED->Enable( !bUseSysCredsEnabled );
+    m_pPathBtn->Enable( !bUseSysCredsEnabled );
+    m_pNameFT->Enable( !bUseSysCredsEnabled );
+    m_pNameED->Enable( !bUseSysCredsEnabled );
+    m_pPasswordFT->Enable( !bUseSysCredsEnabled );
+    m_pPasswordED->Enable( !bUseSysCredsEnabled );
+    m_pAccountFT->Enable( !bUseSysCredsEnabled );
+    m_pAccountED->Enable( !bUseSysCredsEnabled );
 }
 
 IMPL_LINK_NOARG(LoginDialog, OKHdl_Impl)
 {
     // trim the strings
-    aNameED.SetText(comphelper::string::strip(aNameED.GetText(), ' '));
-    aPasswordED.SetText(comphelper::string::strip(aPasswordED.GetText(), ' '));
+    m_pNameED->SetText(comphelper::string::strip(m_pNameED->GetText(), ' '));
+    m_pPasswordED->SetText(comphelper::string::strip(m_pPasswordED->GetText(), ' '));
     EndDialog( RET_OK );
     return 1;
 }
@@ -216,14 +118,14 @@ IMPL_LINK_NOARG(LoginDialog, PathHdl_Impl)
     {
         uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(comphelper::getProcessComponentContext());
 
-        OUString aPath( aPathED.GetText() );
+        OUString aPath( m_pPathED->GetText() );
         osl::FileBase::getFileURLFromSystemPath( aPath, aPath );
         xFolderPicker->setDisplayDirectory( aPath );
 
         if (xFolderPicker->execute() == ui::dialogs::ExecutableDialogResults::OK)
         {
             osl::FileBase::getSystemPathFromFileURL( xFolderPicker->getDirectory(), aPath );
-            aPathED.SetText( aPath );
+            m_pPathED->SetText( aPath );
         }
     }
     catch (uno::Exception & e)
@@ -236,97 +138,78 @@ IMPL_LINK_NOARG(LoginDialog, PathHdl_Impl)
 
 IMPL_LINK_NOARG(LoginDialog, UseSysCredsHdl_Impl)
 {
-    EnableUseSysCredsControls_Impl( aUseSysCredsCB.IsChecked() );
+    EnableUseSysCredsControls_Impl( m_pUseSysCredsCB->IsChecked() );
     return 1;
 }
 
-LoginDialog::LoginDialog
-(
-    Window* pParent,
-    sal_uInt16 nFlags,
-    const OUString& rServer,
-    const OUString& rRealm,
-    ResMgr* pResMgr
-) :
-
-    ModalDialog( pParent, ResId( DLG_UUI_LOGIN, *pResMgr ) ),
-
-    aErrorFT        ( this, ResId( FT_LOGIN_ERROR, *pResMgr ) ),
-    aErrorInfo      ( this, ResId( FT_INFO_LOGIN_ERROR, *pResMgr ) ),
-    aLogin1FL       ( this, ResId( FL_LOGIN_1, *pResMgr ) ),
-    aRequestInfo    ( this, ResId( FT_INFO_LOGIN_REQUEST, *pResMgr ) ),
-    aLogin2FL       ( this, ResId( FL_LOGIN_2, *pResMgr ) ),
-    aPathFT         ( this, ResId( FT_LOGIN_PATH, *pResMgr ) ),
-    aPathED         ( this, ResId( ED_LOGIN_PATH, *pResMgr ) ),
-    aPathBtn        ( this, ResId( BTN_LOGIN_PATH, *pResMgr ) ),
-    aNameFT         ( this, ResId( FT_LOGIN_USERNAME, *pResMgr ) ),
-    aNameED         ( this, ResId( ED_LOGIN_USERNAME, *pResMgr ) ),
-    aPasswordFT     ( this, ResId( FT_LOGIN_PASSWORD, *pResMgr ) ),
-    aPasswordED     ( this, ResId( ED_LOGIN_PASSWORD, *pResMgr ) ),
-    aAccountFT      ( this, ResId( FT_LOGIN_ACCOUNT, *pResMgr ) ),
-    aAccountED      ( this, ResId( ED_LOGIN_ACCOUNT, *pResMgr ) ),
-    aSavePasswdBtn  ( this, ResId( CB_LOGIN_SAVEPASSWORD, *pResMgr ) ),
-    aUseSysCredsCB  ( this, ResId( CB_LOGIN_USESYSCREDS, *pResMgr ) ),
-    aButtonsFL      ( this, ResId( FL_BUTTONS, *pResMgr ) ),
-    aOKBtn          ( this, ResId( BTN_LOGIN_OK, *pResMgr ) ),
-    aCancelBtn      ( this, ResId( BTN_LOGIN_CANCEL, *pResMgr ) ),
-    aHelpBtn        ( this, ResId( BTN_LOGIN_HELP, *pResMgr ) )
-
+LoginDialog::LoginDialog(Window* pParent, sal_uInt16 nFlags,
+    const OUString& rServer, const OUString& rRealm)
+    : ModalDialog(pParent, "LoginDialog", "uui/ui/logindialog.ui")
 {
+    get(m_pErrorFT, "errorft");
+    get(m_pErrorInfo, "errorinfo");
+    get(m_pRequestInfo, "requestinfo");
+    get(m_pPathFT, "pathft");
+    get(m_pPathED, "pathed");
+    get(m_pPathBtn, "pathbtn");
+    get(m_pNameFT, "nameft");
+    get(m_pNameED, "nameed");
+    get(m_pPasswordFT, "passwordft");
+    get(m_pPasswordED, "passworded");
+    get(m_pAccountFT, "accountft");
+    get(m_pAccountED, "accounted");
+    get(m_pSavePasswdBtn, "remember");
+    get(m_pUseSysCredsCB, "syscreds");
+    get(m_pOKBtn, "ok");
+
     OUString aRequest;
     if ((nFlags & LF_NO_ACCOUNT) != 0 && !rRealm.isEmpty())
     {
-        aRequest = OUString(ResId(STR_LOGIN_REALM, *pResMgr));
+        aRequest = get<FixedText>("loginrealm")->GetText();
         aRequest = aRequest.replaceAll("%2", rRealm);
     }
     else
-        aRequest = aRequestInfo.GetText();
+        aRequest = m_pRequestInfo->GetText();
 
     if ( !( ( nFlags & LF_NO_USESYSCREDS ) == LF_NO_USESYSCREDS ) )
-      EnableUseSysCredsControls_Impl( aUseSysCredsCB.IsChecked() );
+      EnableUseSysCredsControls_Impl( m_pUseSysCredsCB->IsChecked() );
 
     aRequest = aRequest.replaceAll("%1", rServer);
-    aRequestInfo.SetText(aRequest);
+    m_pRequestInfo->SetText(aRequest);
 
-    FreeResource();
+    m_pPathED->SetMaxTextLen( _MAX_PATH );
+    m_pNameED->SetMaxTextLen( _MAX_PATH );
 
-    aPathED.SetMaxTextLen( _MAX_PATH );
-    aNameED.SetMaxTextLen( _MAX_PATH );
-
-    aOKBtn.SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) );
-    aPathBtn.SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) );
-    aUseSysCredsCB.SetClickHdl( LINK( this, LoginDialog, UseSysCredsHdl_Impl ) );
+    m_pOKBtn->SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) );
+    m_pPathBtn->SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) );
+    m_pUseSysCredsCB->SetClickHdl( LINK( this, LoginDialog, UseSysCredsHdl_Impl ) );
 
     HideControls_Impl( nFlags );
-};
-
-LoginDialog::~LoginDialog()
-{
 }
 
 void LoginDialog::SetUseSystemCredentials( sal_Bool bUse )
 {
-    if ( aUseSysCredsCB.IsVisible() )
+    if ( m_pUseSysCredsCB->IsVisible() )
     {
-        aUseSysCredsCB.Check( bUse );
+        m_pUseSysCredsCB->Check( bUse );
         EnableUseSysCredsControls_Impl( bUse );
     }
 }
 
 void LoginDialog::ClearPassword()
 {
-    aPasswordED.SetText( OUString() );
+    m_pPasswordED->SetText( OUString() );
 
-    if ( aNameED.GetText().isEmpty() )
-        aNameED.GrabFocus();
+    if ( m_pNameED->GetText().isEmpty() )
+        m_pNameED->GrabFocus();
     else
-        aPasswordED.GrabFocus();
-};
+        m_pPasswordED->GrabFocus();
+}
 
 void LoginDialog::ClearAccount()
 {
-    aAccountED.SetText( OUString() );
-    aAccountED.GrabFocus();
-};
+    m_pAccountED->SetText( OUString() );
+    m_pAccountED->GrabFocus();
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc
deleted file mode 100644
index 4f7f4d9..0000000
--- a/uui/source/logindlg.hrc
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef UUI_LOGINDLG_HRC
-#define UUI_LOGINDLG_HRC
-
-
-//============================================================================
-#define FT_INFO_LOGIN_ERROR     10
-#define FT_LOGIN_ERROR          11
-
-#define FT_INFO_LOGIN_REQUEST   20
-#define FT_LOGIN_PATH           21
-#define ED_LOGIN_PATH           22
-#define BTN_LOGIN_PATH          23
-#define FT_LOGIN_USERNAME       24
-#define ED_LOGIN_USERNAME       25
-#define FT_LOGIN_PASSWORD       26
-#define ED_LOGIN_PASSWORD       27
-#define FT_LOGIN_ACCOUNT        28
-#define ED_LOGIN_ACCOUNT        29
-#define CB_LOGIN_SAVEPASSWORD   30
-#define CB_LOGIN_USESYSCREDS    31
-#define FL_LOGIN_1              32
-#define FL_LOGIN_2              33
-#define FL_BUTTONS              34
-
-#define BTN_LOGIN_OK            50
-#define BTN_LOGIN_CANCEL        51
-#define BTN_LOGIN_HELP          52
-
-#define STR_LOGIN_REALM         60
-
-#endif // UUI_LOGINDLG_HRC
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index 7aad211..0f93d4c 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -43,26 +43,21 @@
 //============================================================================
 class LoginDialog : public ModalDialog
 {
-    FixedText       aErrorFT;
-    FixedInfo       aErrorInfo;
-    FixedLine       aLogin1FL;
-    FixedInfo       aRequestInfo;
-    FixedLine       aLogin2FL;
-    FixedText       aPathFT;
-    Edit            aPathED;
-    PushButton      aPathBtn;
-    FixedText       aNameFT;
-    Edit            aNameED;
-    FixedText       aPasswordFT;
-    Edit            aPasswordED;
-    FixedText       aAccountFT;
-    Edit            aAccountED;
-    CheckBox        aSavePasswdBtn;
-    CheckBox        aUseSysCredsCB;
-    FixedLine       aButtonsFL;
-    OKButton        aOKBtn;
-    CancelButton    aCancelBtn;
-    HelpButton      aHelpBtn;
+    FixedText*      m_pErrorFT;
+    FixedText*      m_pErrorInfo;
+    FixedText*      m_pRequestInfo;
+    FixedText*      m_pPathFT;
+    Edit*           m_pPathED;
+    PushButton*     m_pPathBtn;
+    FixedText*      m_pNameFT;
+    Edit*           m_pNameED;
+    FixedText*      m_pPasswordFT;
+    Edit*           m_pPasswordED;
+    FixedText*      m_pAccountFT;
+    Edit*           m_pAccountED;
+    CheckBox*       m_pSavePasswdBtn;
+    CheckBox*       m_pUseSysCredsCB;
+    OKButton*       m_pOKBtn;
 
     void            HideControls_Impl( sal_uInt16 nFlags );
     void            EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled );
@@ -72,26 +67,24 @@ class LoginDialog : public ModalDialog
     DECL_LINK(UseSysCredsHdl_Impl, void *);
 
 public:
-    LoginDialog( Window* pParent, sal_uInt16 nFlags,
-                 const OUString& rServer, const OUString &rRealm,
-                 ResMgr * pResMgr );
-    virtual ~LoginDialog();
+    LoginDialog(Window* pParent, sal_uInt16 nFlags,
+        const OUString& rServer, const OUString &rRealm);
 
-    OUString        GetPath() const                             { return aPathED.GetText(); }
-    void            SetPath( const OUString& rNewPath )           { aPathED.SetText( rNewPath ); }
-    OUString        GetName() const                             { return aNameED.GetText(); }
-    void            SetName( const OUString& rNewName )           { aNameED.SetText( rNewName ); }
-    OUString        GetPassword() const                         { return aPasswordED.GetText(); }
-    void            SetPassword( const OUString& rNew )           { aPasswordED.SetText( rNew ); }
-    OUString        GetAccount() const                          { return aAccountED.GetText(); }
-    void            SetAccount( const OUString& rNew )            { aAccountED.SetText( rNew ); }
-    sal_Bool            IsSavePassword() const                      { return aSavePasswdBtn.IsChecked(); }
-    void            SetSavePassword( sal_Bool bSave )               { aSavePasswdBtn.Check( bSave ); }
-    void            SetSavePasswordText( const OUString& rTxt )   { aSavePasswdBtn.SetText( rTxt ); }
-    sal_Bool            IsUseSystemCredentials() const              { return aUseSysCredsCB.IsChecked(); }
+    OUString        GetPath() const                             { return m_pPathED->GetText(); }
+    void            SetPath( const OUString& rNewPath )           { m_pPathED->SetText( rNewPath ); }
+    OUString        GetName() const                             { return m_pNameED->GetText(); }
+    void            SetName( const OUString& rNewName )           { m_pNameED->SetText( rNewName ); }
+    OUString        GetPassword() const                         { return m_pPasswordED->GetText(); }
+    void            SetPassword( const OUString& rNew )           { m_pPasswordED->SetText( rNew ); }
+    OUString        GetAccount() const                          { return m_pAccountED->GetText(); }
+    void            SetAccount( const OUString& rNew )            { m_pAccountED->SetText( rNew ); }
+    sal_Bool            IsSavePassword() const                      { return m_pSavePasswdBtn->IsChecked(); }
+    void            SetSavePassword( sal_Bool bSave )               { m_pSavePasswdBtn->Check( bSave ); }
+    void            SetSavePasswordText( const OUString& rTxt )   { m_pSavePasswdBtn->SetText( rTxt ); }
+    sal_Bool        IsUseSystemCredentials() const              { return m_pUseSysCredsCB->IsChecked(); }
     void            SetUseSystemCredentials( sal_Bool bUse );
-    void            SetErrorText( const OUString& rTxt )          { aErrorInfo.SetText( rTxt ); }
-    void            SetLoginRequestText( const OUString& rTxt )   { aRequestInfo.SetText( rTxt ); }
+    void            SetErrorText( const OUString& rTxt )          { m_pErrorInfo->SetText( rTxt ); }
+    void            SetLoginRequestText( const OUString& rTxt )   { m_pRequestInfo->SetText( rTxt ); }
     void            ClearPassword();
     void            ClearAccount();
 };
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
deleted file mode 100644
index 6a6a5f5..0000000
--- a/uui/source/logindlg.src
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define __RSC
-
-#include "ids.hrc"
-#include "logindlg.hrc"
-
-ModalDialog DLG_UUI_LOGIN
-{
-    HelpId = HID_DLG_LOGIN ;
-    Border = TRUE ;
-    Moveable = TRUE ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT( 177 , 247 ) ;
-    Text [ en-US ] = "Authentication Required" ;
-
-    FixedText FT_LOGIN_ERROR
-    {
-        Pos = MAP_APPFONT( 6 , 6 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-        Text [ en-US ] = "Message from server:" ;
-    };
-
-    FixedText FT_INFO_LOGIN_ERROR
-    {
-        Pos = MAP_APPFONT( 6 , 14 ) ;
-        Size = MAP_APPFONT( 165 , 3*8 ) ;
-        WordBreak = TRUE ;
-    };
-
-    FixedLine FL_LOGIN_1
-    {
-        Pos = MAP_APPFONT( 6 , 41 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-    };
-
-    FixedText FT_INFO_LOGIN_REQUEST
-    {
-        Pos = MAP_APPFONT( 6 , 52 ) ;
-        Size = MAP_APPFONT( 165 , 2*8 ) ;
-        WordBreak = TRUE ;
-        Text [ en-US ] = "Enter user name and password for: \n%1" ;
-    };
-
-    String STR_LOGIN_REALM
-    {
-        Text [ en-US ] = "Enter user name and password for: \n\"%2\" on %1" ;
-    };
-
-    FixedLine FL_LOGIN_2
-    {
-        Pos = MAP_APPFONT( 6 , 71 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-    };
-
-    FixedText FT_LOGIN_PATH
-    {
-        Pos = MAP_APPFONT( 6 , 84 ) ;
-        Size = MAP_APPFONT( 112 , 8 ) ;
-        Text [ en-US ] = "~Path" ;
-    };
-
-    Edit ED_LOGIN_PATH
-    {
-        HelpId = HID_LOGIN_DLG_PATH;
-        Border = TRUE ;
-        Pos = MAP_APPFONT( 6 , 95 ) ;
-        Size = MAP_APPFONT( 112 , 12 ) ;
-    };
-    PushButton BTN_LOGIN_PATH
-    {
-        HelpId = HID_LOGIN_DLG_BROWSE;
-        Pos = MAP_APPFONT( 121 , 94 ) ;
-        Size = MAP_APPFONT( 50 , 14 ) ;
-        Text = "~Browse..." ;
-    };
-
-    FixedText FT_LOGIN_USERNAME
-    {
-        Pos = MAP_APPFONT( 6 , 110 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-        Text [ en-US ] = "~User name" ;
-    };
-
-    Edit ED_LOGIN_USERNAME
-    {
-        HelpId = HID_LOGIN_DLG_USER_NAME;
-        Border = TRUE ;
-        Pos = MAP_APPFONT( 6 , 121 ) ;
-        Size = MAP_APPFONT( 165 , 12 ) ;
-    };
-
-    FixedText FT_LOGIN_PASSWORD
-    {
-        Pos = MAP_APPFONT( 6 , 136 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-        Text [ en-US ] = "Pass~word" ;
-    };
-
-    Edit ED_LOGIN_PASSWORD
-    {
-        HelpId = HID_LOGIN_DLG_PASSWORD;
-        Border = TRUE ;
-        Pos = MAP_APPFONT( 6 , 147 ) ;
-        Size = MAP_APPFONT( 165 , 12 ) ;
-        PassWord = TRUE ;
-    };
-
-    FixedText FT_LOGIN_ACCOUNT
-    {
-        Pos = MAP_APPFONT( 6 , 162 ) ;
-        Size = MAP_APPFONT( 165 , 8 ) ;
-        Text [ en-US ] = "A~ccount";
-    };
-
-    Edit ED_LOGIN_ACCOUNT
-    {
-        HelpId = HID_LOGIN_DLG_ACCOUNT;
-        Border = TRUE ;
-        Pos = MAP_APPFONT( 6 , 173 ) ;
-        Size = MAP_APPFONT( 165 , 12 ) ;
-        PassWord = TRUE ;
-    };
-
-    CheckBox CB_LOGIN_SAVEPASSWORD
-    {
-        HelpId = HID_LOGIN_DLG_REMEMBER_PASSWORD;
-        Pos = MAP_APPFONT( 6 , 190 ) ;
-        Size = MAP_APPFONT( 165 , 10 ) ;
-        Text [ en-US ] = "~Remember password" ;
-    };
-
-    CheckBox CB_LOGIN_USESYSCREDS
-    {
-        HelpId = HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS;
-        Pos = MAP_APPFONT( 6 , 203 ) ;
-        Size = MAP_APPFONT( 165 , 10 ) ;
-        Text [ en-US ] = "~Use system credentials" ;
-    };
-
-    FixedLine FL_BUTTONS
-    {
-        Pos = MAP_APPFONT( 0 , 216 ) ;
-        Size = MAP_APPFONT( 177 , 8 ) ;
-    };
-
-    HelpButton BTN_LOGIN_HELP
-    {
-        Pos = MAP_APPFONT( 6 , 227 ) ;
-        Size = MAP_APPFONT( 50 , 14 ) ;
-    };
-
-    OKButton BTN_LOGIN_OK
-    {
-        Pos = MAP_APPFONT( 66 , 227 ) ;
-        Size = MAP_APPFONT( 50 , 14 ) ;
-        DefButton = TRUE ;
-    };
-
-    CancelButton BTN_LOGIN_CANCEL
-    {
-        Pos = MAP_APPFONT( 121 , 227 ) ;
-        Size = MAP_APPFONT( 50 , 14 ) ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/uiconfig/ui/logindialog.ui b/uui/uiconfig/ui/logindialog.ui
new file mode 100644
index 0000000..4c92cf2
--- /dev/null
+++ b/uui/uiconfig/ui/logindialog.ui
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="LoginDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Authentication Required</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkCheckButton" id="syscreds">
+                <property name="label" translatable="yes">_Use system credentials</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">9</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="remember">
+                <property name="label" translatable="yes">_Remember password</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">8</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="accounted">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="invisible_char">●</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">7</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="accountft">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">A_ccount</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">accounted</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">7</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="passwordft">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Pass_word</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">passworded</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">6</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="passworded">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="visibility">False</property>
+                <property name="invisible_char">●</property>
+                <property name="invisible_char_set">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">6</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="nameed">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="invisible_char">●</property>
+                <property name="invisible_char_set">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">5</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="nameft">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">_User name</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">nameed</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">5</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="pathft">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">_Path</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">pathed</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">4</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="column_spacing">12</property>
+                <child>
+                  <object class="GtkEntry" id="pathed">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="invisible_char">●</property>
+                    <property name="invisible_char_set">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="pathbtn">
+                    <property name="label" translatable="yes">_Browse...</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="loginrealm">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Enter user name and password for:
+"%2" on %1</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="requestinfo">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Enter user name and password for:
+%1</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="errorft">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Message from server:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">errorinfo</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="errorinfo">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="wrap">True</property>
+                <property name="width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">2</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list