diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-06-30 23:18:55 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:17 +0200 |
commit | 34b2aa7f2bc70cae902e3beaa8a467ab6a1e5ad3 (patch) | |
tree | 3f96adda671cafc8b345b679514ad5ad210d144d /sfx2 | |
parent | 86859c115c9d8ff1b46f6fef4fdc0fc30a4a766f (diff) |
added RemoteFilesDialog support in FileDialogHelper_Impl
Change-Id: Ic4854841deeebeccd31cd1b78680755cd97fdfbb
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 26 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 2 |
2 files changed, 8 insertions, 20 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index b51d6fce0a5a..cbb7acb4f639 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -625,6 +625,10 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( pSystemDialogItem ) nDialog = pSystemDialogItem->GetValue() ? SFX2_IMPL_DIALOG_SYSTEM : SFX2_IMPL_DIALOG_OOO; + SFX_REQUEST_ARG( rReq, pRemoteDialogItem, SfxBoolItem, SID_REMOTE_DIALOG, false ); + if ( pRemoteDialogItem && pRemoteDialogItem->GetValue()) + nDialog = SFX2_IMPL_DIALOG_REMOTE; + OUString sStandardDir; SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR, false ); @@ -1127,26 +1131,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) void SfxApplication::OpenRemoteExec_Impl( SfxRequest& rReq ) { - ScopedVclPtrInstance< RemoteFilesDialog > aDlg( ( vcl::Window* )NULL, WB_OPEN ); - - // Filters for test purposes - aDlg->AddFilter("All files", FILTER_ALL); - aDlg->AddFilter("ODT files", "*.odt"); - aDlg->AddFilter("ODS files", "*.ods"); - - short nResult = aDlg->Execute(); - - if( nResult == RET_OK ) - { - OUString sFileName = aDlg->GetPath(); - - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString( "_default" ) ) ); - rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) ); - rReq.RemoveItem( SID_FILE_NAME ); - rReq.AppendItem( SfxStringItem( SID_FILE_NAME, sFileName ) ); - - GetDispatcher_Impl()->Execute( SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs() ); - } + rReq.AppendItem( SfxBoolItem( SID_REMOTE_DIALOG, true ) ); + GetDispatcher_Impl()->Execute( SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index a1a38f542c4e..d4d9e14b2c94 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -863,6 +863,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( pServiceName = FILE_OPEN_SERVICE_NAME_OOO; else if ( nDialog == SFX2_IMPL_DIALOG_OOO ) pServiceName = FILE_OPEN_SERVICE_NAME_OOO; + else if ( nDialog == SFX2_IMPL_DIALOG_REMOTE ) + pServiceName = "com.sun.star.ui.dialogs.RemoteFilePicker"; else pServiceName = "com.sun.star.ui.dialogs.FilePicker"; OUString aService = OUString::createFromAscii( pServiceName ); |