diff options
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 31 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.hxx | 3 | ||||
-rw-r--r-- | fpicker/uiconfig/ui/remotefilesdialog.ui | 17 | ||||
-rw-r--r-- | include/svtools/fileview.hxx | 3 | ||||
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 11 |
5 files changed, 46 insertions, 19 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index e87f6cb1b0d1..ab6159ae010b 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -183,7 +183,6 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) get( m_pAddService_btn, "add_service_btn" ); get( m_pServices_lb, "services_lb" ); get( m_pFilter_lb, "filter_lb" ); - get( m_pName_ed, "name_ed" ); get( m_pNewFolder, "new_folder" ); m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN; @@ -194,6 +193,9 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) m_bServiceChanged = false; m_nCurrentFilter = LISTBOX_ENTRY_NOTFOUND; + m_pName_ed = VclPtr< AutocompleteEdit >::Create( get< vcl::Window >( "filename_container" ) ); + m_pName_ed->Show(); + m_pFilter_lb->Enable( false ); m_pName_ed->Enable( false ); @@ -1252,8 +1254,31 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL ) m_pTreeView->SetSelectHdl( Link<>() ); // read cached data for this url and fill the tree - const ::std::vector< std::pair< OUString, OUString > >& rFolders = m_pFileView->GetSubFolders(); - m_pTreeView->FillTreeEntry( rURL, rFolders ); + const ::std::vector< SvtContentEntry >& rFolders = m_pFileView->GetContent(); + ::std::vector< std::pair< OUString, OUString > > aFolders; + + m_pName_ed->ClearEntries(); + + for( ::std::vector< SvtContentEntry >::size_type i = 0; i < rFolders.size(); i++ ) + { + int nTitleStart = rFolders[i].maURL.lastIndexOf( '/' ); + if( nTitleStart != -1 ) + { + OUString sTitle( INetURLObject::decode( + rFolders[i].maURL.copy( nTitleStart + 1 ), + INetURLObject::DECODE_WITH_CHARSET ) ); + + if( rFolders[i].mbIsFolder ) + { + aFolders.push_back( std::pair< OUString, OUString > ( sTitle, rFolders[i].maURL ) ); + } + + // add entries to the autocompletion mechanism + m_pName_ed->AddEntry( sTitle ); + } + } + + m_pTreeView->FillTreeEntry( rURL, aFolders ); m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) ); diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 4fef385593cd..ad1323c2fea2 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -12,6 +12,7 @@ #include <comphelper/docpasswordrequest.hxx> +#include <svtools/autocmpledit.hxx> #include <svtools/foldertree.hxx> #include <svtools/place.hxx> #include <svtools/PlaceEditDialog.hxx> @@ -156,7 +157,7 @@ private: VclPtr< SvtFileView > m_pFileView; VclPtr< FileViewContainer > m_pContainer; VclPtr< ListBox > m_pFilter_lb; - VclPtr< Edit > m_pName_ed; + VclPtr< AutocompleteEdit > m_pName_ed; PopupMenu* m_pAddMenu; ImageList m_aImages; diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui index e0699a5b96a8..78593484273b 100644 --- a/fpicker/uiconfig/ui/remotefilesdialog.ui +++ b/fpicker/uiconfig/ui/remotefilesdialog.ui @@ -234,26 +234,29 @@ </packing> </child> <child> - <object class="GtkEntry" id="name_ed"> + <object class="GtkComboBox" id="filter_lb"> + <property name="width_request">200</property> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can_focus">False</property> <property name="hexpand">True</property> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">0</property> </packing> </child> <child> - <object class="GtkComboBox" id="filter_lb"> - <property name="width_request">200</property> + <object class="GtkBox" id="filename_container"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">1</property> </packing> </child> </object> diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx index db6d49141d31..afc7dab7366c 100644 --- a/include/svtools/fileview.hxx +++ b/include/svtools/fileview.hxx @@ -36,6 +36,7 @@ class ViewTabListBox_Impl; class SvtFileView_Impl; class SvTreeListEntry; class HeaderBar; +struct SvtContentEntry; /// the result of an action in the FileView enum FileViewResult @@ -173,7 +174,7 @@ public: void EndInplaceEditing( bool _bCancel ); - ::std::vector< std::pair< OUString, OUString > > GetSubFolders(); + ::std::vector< SvtContentEntry > GetContent(); protected: virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 81e7f5e8b32c..1ce95e82b98d 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1393,17 +1393,14 @@ OUString SvtFileView::GetConfigString() const return sRet; } -::std::vector< std::pair< OUString, OUString > > SvtFileView::GetSubFolders() +::std::vector< SvtContentEntry > SvtFileView::GetContent() { - ::std::vector< std::pair< OUString, OUString > > aContent; + ::std::vector< SvtContentEntry > aContent; for( ::std::vector< SortingData_Impl* >::size_type i = 0; i < mpImp->maContent.size(); i++ ) { - if( mpImp->maContent[i]->mbIsFolder ) - { - std::pair< OUString, OUString > aEntry( mpImp->maContent[i]->GetTitle(), mpImp->maContent[i]->maTargetURL ); - aContent.push_back( aEntry ); - } + SvtContentEntry aEntry( mpImp->maContent[i]->maTargetURL, mpImp->maContent[i]->mbIsFolder ); + aContent.push_back( aEntry ); } return aContent; |