diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-06-24 18:15:26 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:07 +0200 |
commit | 7a77b45830225de507593f5d60b103098132ff0b (patch) | |
tree | cee772efc7c845618ea21f57aeea84daeea90a99 | |
parent | 3c0766319f9820f583f193c665c0ebc49b358646 (diff) |
OK button handler & opening the files (very basic)
Change-Id: I14ea89b118fdd5d97cb162523b55ca61cee0c97a
-rw-r--r-- | include/svtools/RemoteFilesDialog.hxx | 2 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 2 | ||||
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 11 | ||||
-rw-r--r-- | svtools/source/dialogs/RemoteFilesDialog.cxx | 11 |
4 files changed, 24 insertions, 2 deletions
diff --git a/include/svtools/RemoteFilesDialog.hxx b/include/svtools/RemoteFilesDialog.hxx index 67f1609a4e68..033e8c054e4f 100644 --- a/include/svtools/RemoteFilesDialog.hxx +++ b/include/svtools/RemoteFilesDialog.hxx @@ -135,6 +135,8 @@ private: DECL_LINK( TreeExpandHdl, SvTreeListBox * ); DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * ); + + DECL_LINK( OkHdl, void * ); }; #endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 57dd23c57e55..8ccc619890fe 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3801,7 +3801,7 @@ SfxObjectItem Open SID_OPENDOC ] SfxObjectItem OpenRemote SID_OPENREMOTE -() +(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem OpenFlags SID_OPTIONS,SfxStringItem Password SID_PASSWORD,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxInt16Item Version SID_VERSION,SfxStringItem Referer SID_REFERER,SfxStringItem SuggestedSaveAsDir SID_DEFAULTFILEPATH,SfxStringItem SuggestedSaveAsName SID_DEFAULTFILENAME) [ /* flags: */ AutoUpdate = FALSE, diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 001ed1b176d3..7fce0c2a0d6a 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -1125,7 +1125,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) } } -void SfxApplication::OpenRemoteExec_Impl( SfxRequest& ) +void SfxApplication::OpenRemoteExec_Impl( SfxRequest& rReq ) { ScopedVclPtrInstance< RemoteFilesDialog > aDlg((vcl::Window*)NULL, WB_OPEN); @@ -1135,6 +1135,15 @@ void SfxApplication::OpenRemoteExec_Impl( SfxRequest& ) aDlg->AddFilter("ODS files", "*.ods"); aDlg->Execute(); + + 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() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx index 253417f5de00..b7734e01facf 100644 --- a/svtools/source/dialogs/RemoteFilesDialog.cxx +++ b/svtools/source/dialogs/RemoteFilesDialog.cxx @@ -163,6 +163,8 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits) m_pOpen_btn->Hide(); } + m_pOpen_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) ); + m_pPath = VclPtr<Breadcrumb>::Create( get<vcl::Window>("breadcrumb_container") ); m_pPath->set_hexpand(true); m_pPath->SetClickHdl( LINK( this, RemoteFilesDialog, SelectBreadcrumbHdl ) ); @@ -650,9 +652,12 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl ) m_sPath = pData->maURL; m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) ); + + m_pOpen_btn->Enable( true ); } else { + m_pOpen_btn->Enable( false ); m_sPath = ""; m_pName_ed->SetText( "" ); } @@ -721,4 +726,10 @@ IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr ) return 1; } +IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl ) +{ + EndDialog( RET_OK ); + return 1; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |