diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-06-04 16:39:44 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:52:46 +0200 |
commit | a736dc21c53513fd7b90c217a5271316a8351407 (patch) | |
tree | 1d56fb0b22d7f048aff7b3ab3da7d9035f65d134 /svtools | |
parent | c9934f5b46922bd10406ec7e7687c87ed7153680 (diff) |
added fields for name and filters
Change-Id: I758bb4e1009c44aad7f4f5d3d0e07939b9962ce5
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/dialogs/RemoteFilesDialog.cxx | 31 | ||||
-rw-r--r-- | svtools/uiconfig/ui/remotefilesdialog.ui | 61 |
2 files changed, 89 insertions, 3 deletions
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx index 98ace3d67bf9..f13aa2d0c2ca 100644 --- a/svtools/source/dialogs/RemoteFilesDialog.cxx +++ b/svtools/source/dialogs/RemoteFilesDialog.cxx @@ -11,7 +11,7 @@ using namespace ::com::sun::star::uno; -#define NO_FILTER "*.*" +#define FILTER_ALL "*.*" class FileViewContainer : public vcl::Window { @@ -65,6 +65,8 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits) get(m_pAddService_btn, "add_service_btn"); get(m_pServices_lb, "services_lb"); get(m_pPath_ed, "path"); + get(m_pFilter_lb, "filter_lb"); + get(m_pName_ed, "name_ed"); m_eMode = (nBits & WB_SAVEAS) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN; m_eType = (nBits & WB_PATH) ? REMOTEDLG_TYPE_PATHDLG : REMOTEDLG_TYPE_FILEDLG; @@ -94,6 +96,7 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits) m_pFileView->Show(); m_pFileView->EnableAutoResize(); m_pFileView->SetDoubleClickHdl( LINK( this, RemoteFilesDialog, DoubleClickHdl ) ); + m_pFileView->SetSelectHdl( LINK( this, RemoteFilesDialog, SelectHdl ) ); m_pContainer->init(m_pFileView); m_pContainer->Show(); @@ -105,6 +108,9 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits) FillServicesListbox(); m_pServices_lb->SetSelectHdl( LINK( this, RemoteFilesDialog, SelectServiceHdl ) ); + + m_pFilter_lb->InsertEntry(FILTER_ALL); + m_pFilter_lb->SelectEntryPos(0); } RemoteFilesDialog::~RemoteFilesDialog() @@ -196,16 +202,26 @@ int RemoteFilesDialog::GetSelectedServicePos() return nPos; } +OUString RemoteFilesDialog::getCurrentFilter() +{ + OUString sFilter; + + sFilter = m_pFilter_lb->GetSelectEntry(); + + return sFilter; +} + void RemoteFilesDialog::OpenURL( OUString sURL ) { if(m_pFileView) { OUStringList BlackList; FileViewResult eResult = eFailure; + OUString sFilter = getCurrentFilter(); m_pFileView->EndInplaceEditing( false ); m_pPath_ed->SetText( sURL ); - eResult = m_pFileView->Initialize( sURL, NO_FILTER, NULL, BlackList ); + eResult = m_pFileView->Initialize( sURL, sFilter, NULL, BlackList ); } } @@ -320,4 +336,15 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl ) return 1; } +IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl ) +{ + SvTreeListEntry* pEntry = m_pFileView->FirstSelected(); + SvtContentEntry* pData = static_cast<SvtContentEntry*>(pEntry->GetUserData()); + + INetURLObject aURL(pData->maURL); + m_pName_ed->SetText(aURL.GetLastName()); + + return 1; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/uiconfig/ui/remotefilesdialog.ui b/svtools/uiconfig/ui/remotefilesdialog.ui index 62ce906c0693..c79b10be9cf1 100644 --- a/svtools/uiconfig/ui/remotefilesdialog.ui +++ b/svtools/uiconfig/ui/remotefilesdialog.ui @@ -65,7 +65,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">3</property> + <property name="position">4</property> </packing> </child> <child> @@ -152,6 +152,65 @@ <property name="position">2</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">6</property> + <child> + <object class="GtkLabel" id="filterLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Filter</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="nameLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Full name</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="name_ed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="filter_lb"> + <property name="visible">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">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> </child> </object> |