Kaydet (Commit) a736dc21 authored tarafından Szymon Kłos's avatar Szymon Kłos

added fields for name and filters

Change-Id: I758bb4e1009c44aad7f4f5d3d0e07939b9962ce5
üst c9934f5b
......@@ -21,6 +21,7 @@
#include <vcl/vclptr.hxx>
#include <svtools/fileview.hxx>
#include <svtools/treelistentry.hxx>
#include <officecfg/Office/Common.hxx>
#include <com/sun/star/uno/Sequence.hxx>
......@@ -71,6 +72,8 @@ private:
VclPtr<Edit> m_pPath_ed;
VclPtr<SvtFileView> m_pFileView;
VclPtr<FileViewContainer> m_pContainer;
VclPtr<ListBox> m_pFilter_lb;
VclPtr<Edit> m_pName_ed;
std::vector<ServicePtr> m_aServices;
......@@ -79,6 +82,8 @@ private:
/* If failure returns < 0 */
int GetSelectedServicePos();
OUString getCurrentFilter();
void OpenURL( OUString sURL );
DECL_LINK ( AddServiceHdl, void * );
......@@ -86,6 +91,7 @@ private:
DECL_LINK_TYPED ( EditServiceMenuHdl, MenuButton *, void );
DECL_LINK( DoubleClickHdl, void * );
DECL_LINK( SelectHdl, void * );
};
#endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
......
......@@ -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: */
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment