summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2013-03-29 07:29:34 -0700
committerAndras Timar <atimar@suse.com>2013-03-29 07:33:37 -0700
commitf7f9b74163acd6811ccfaabb2a1d762225258e15 (patch)
tree85eca0dcce0520c73d70986edb02fcbe573e29fa /uui
parent37303d227d9b48ef6030388b1e70a8c8b8359367 (diff)
replace PathDialog to xFolderPicker, remmove obsoleted PathDialog class
and at the same time we got rid of tools/fsys.hxx dependency in svtools Change-Id: I5237529681a8b6ec32f41086af41ac575fbcff9b
Diffstat (limited to 'uui')
-rw-r--r--uui/source/logindlg.cxx51
1 files changed, 22 insertions, 29 deletions
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index f4e6fa990e50..aa25574c4873 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -18,23 +18,24 @@
*/
#include <comphelper/string.hxx>
-#include <svtools/filedlg.hxx>
#include <vcl/msgbox.hxx>
#include "logindlg.hxx"
#include "logindlg.hrc"
#include "ids.hrc"
#include <tools/resid.hxx>
+#include <osl/file.hxx>
#ifdef UNX
#include <limits.h>
#define _MAX_PATH PATH_MAX
#endif
-// LoginDialog -------------------------------------------------------
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
+#include <comphelper/processfactory.hxx>
-//............................................................................
-//............................................................................
+using namespace com::sun::star;
static void lcl_Move( Window &rWin, long nOffset )
{
@@ -184,7 +185,6 @@ void LoginDialog::HideControls_Impl( sal_uInt16 nFlags )
}
};
-// -----------------------------------------------------------------------
void LoginDialog::EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled )
{
aErrorInfo.Enable( !bUseSysCredsEnabled );
@@ -201,8 +201,6 @@ void LoginDialog::EnableUseSysCredsControls_Impl( sal_Bool bUseSysCredsEnabled )
aAccountED.Enable( !bUseSysCredsEnabled );
}
-// -----------------------------------------------------------------------
-
IMPL_LINK_NOARG(LoginDialog, OKHdl_Impl)
{
// trim the strings
@@ -212,30 +210,36 @@ IMPL_LINK_NOARG(LoginDialog, OKHdl_Impl)
return 1;
}
-// -----------------------------------------------------------------------
-
IMPL_LINK_NOARG(LoginDialog, PathHdl_Impl)
{
- PathDialog* pDlg = new PathDialog( this, WB_3DLOOK );
- pDlg->SetPath( aPathED.GetText() );
+ try
+ {
+ uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(comphelper::getProcessComponentContext());
+
+ OUString aPath( aPathED.GetText() );
+ osl::FileBase::getFileURLFromSystemPath( aPath, aPath );
+ xFolderPicker->setDisplayDirectory( aPath );
- if ( pDlg->Execute() == RET_OK )
- aPathED.SetText( pDlg->GetPath() );
+ if (xFolderPicker->execute() == ui::dialogs::ExecutableDialogResults::OK)
+ {
+ osl::FileBase::getSystemPathFromFileURL( xFolderPicker->getDirectory(), aPath );
+ aPathED.SetText( aPath );
+ }
+ }
+ catch (uno::Exception & e)
+ {
+ SAL_WARN("uui", "LoginDialog::PathHdl_Impl: caught UNO exception: " << e.Message);
+ }
- delete pDlg;
return 1;
}
-// -----------------------------------------------------------------------
-
IMPL_LINK_NOARG(LoginDialog, UseSysCredsHdl_Impl)
{
EnableUseSysCredsControls_Impl( aUseSysCredsCB.IsChecked() );
return 1;
}
-// -----------------------------------------------------------------------
-
LoginDialog::LoginDialog
(
Window* pParent,
@@ -296,14 +300,10 @@ LoginDialog::LoginDialog
HideControls_Impl( nFlags );
};
-// -----------------------------------------------------------------------
-
LoginDialog::~LoginDialog()
{
}
-// -----------------------------------------------------------------------
-
void LoginDialog::SetUseSystemCredentials( sal_Bool bUse )
{
if ( aUseSysCredsCB.IsVisible() )
@@ -313,8 +313,6 @@ void LoginDialog::SetUseSystemCredentials( sal_Bool bUse )
}
}
-// -----------------------------------------------------------------------
-
void LoginDialog::ClearPassword()
{
aPasswordED.SetText( String() );
@@ -325,15 +323,10 @@ void LoginDialog::ClearPassword()
aPasswordED.GrabFocus();
};
-// -----------------------------------------------------------------------
-
void LoginDialog::ClearAccount()
{
aAccountED.SetText( String() );
aAccountED.GrabFocus();
};
-//............................................................................
-//............................................................................
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */