Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e0080650
Kaydet (Commit)
e0080650
authored
Haz 06, 2015
tarafından
Szymon Kłos
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
TreeView filling
Change-Id: I24963a23d1821fafecff5025dcacde255c5244f6
üst
9464775a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
6 deletions
+127
-6
RemoteFilesDialog.hxx
include/svtools/RemoteFilesDialog.hxx
+23
-1
RemoteFilesDialog.cxx
svtools/source/dialogs/RemoteFilesDialog.cxx
+104
-5
No files found.
include/svtools/RemoteFilesDialog.hxx
Dosyayı görüntüle @
e0080650
...
...
@@ -13,6 +13,8 @@
#include <svtools/svtdllapi.h>
#include <svtools/place.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <svtools/svtools.hrc>
#include <svtools/svtresid.hxx>
#include <vcl/button.hxx>
#include <vcl/menubtn.hxx>
...
...
@@ -27,9 +29,20 @@
#include <officecfg/Office/Common.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <ucbhelper/commandenvironment.hxx>
#include <vector>
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
ucb
;
using
namespace
::
com
::
sun
::
star
::
task
;
using
namespace
::
comphelper
;
using
namespace
::
svt
;
#define WB_MULTISELECTION 0x20000000L
#define FILTER_ALL "*.*"
...
...
@@ -69,6 +82,10 @@ private:
SvtRemoteDlgType
m_eType
;
bool
m_bMultiselection
;
bool
m_bIsUpdated
;
Image
m_aFolderImage
;
Reference
<
XCommandEnvironment
>
m_xEnv
;
::
osl
::
Mutex
m_aMutex
;
VclPtr
<
PushButton
>
m_pOpen_btn
;
VclPtr
<
PushButton
>
m_pSave_btn
;
...
...
@@ -93,7 +110,9 @@ private:
OUString
getCurrentFilter
();
void
OpenURL
(
OUString
sURL
);
FileViewResult
OpenURL
(
OUString
sURL
);
void
fillTreeEntry
(
SvTreeListEntry
*
pParent
);
DECL_LINK
(
AddServiceHdl
,
void
*
);
DECL_LINK
(
SelectServiceHdl
,
void
*
);
...
...
@@ -105,6 +124,9 @@ private:
DECL_LINK
(
SplitHdl
,
void
*
);
DECL_LINK
(
SelectFilterHdl
,
void
*
);
DECL_LINK
(
TreeSelectHdl
,
SvTreeListBox
*
);
DECL_LINK
(
TreeExpandHdl
,
SvTreeListBox
*
);
};
#endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
...
...
svtools/source/dialogs/RemoteFilesDialog.cxx
Dosyayı görüntüle @
e0080650
...
...
@@ -8,8 +8,7 @@
*/
#include <svtools/RemoteFilesDialog.hxx>
using
namespace
::
com
::
sun
::
star
::
uno
;
#include "../contnr/contentenumeration.hxx"
class
FileViewContainer
:
public
vcl
::
Window
{
...
...
@@ -79,6 +78,7 @@ class FileViewContainer : public vcl::Window
RemoteFilesDialog
::
RemoteFilesDialog
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
ModalDialog
(
pParent
,
"RemoteFilesDialog"
,
"svt/ui/remotefilesdialog.ui"
)
,
m_context
(
comphelper
::
getProcessComponentContext
())
,
m_aFolderImage
(
SvtResId
(
IMG_SVT_FOLDER
))
,
m_pSplitter
(
NULL
)
,
m_pFileView
(
NULL
)
,
m_pContainer
(
NULL
)
...
...
@@ -92,6 +92,11 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
get
(
m_pFilter_lb
,
"filter_lb"
);
get
(
m_pName_ed
,
"name_ed"
);
Reference
<
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
Reference
<
XInteractionHandler
>
xInteractionHandler
(
InteractionHandler
::
createWithParent
(
xContext
,
0
),
UNO_QUERY_THROW
);
m_xEnv
=
new
::
ucbhelper
::
CommandEnvironment
(
xInteractionHandler
,
Reference
<
XProgressHandler
>
()
);
m_eMode
=
(
nBits
&
WB_SAVEAS
)
?
REMOTEDLG_MODE_SAVE
:
REMOTEDLG_MODE_OPEN
;
m_eType
=
(
nBits
&
WB_PATH
)
?
REMOTEDLG_TYPE_PATHDLG
:
REMOTEDLG_TYPE_FILEDLG
;
m_bMultiselection
=
(
nBits
&
WB_MULTISELECTION
)
?
true
:
false
;
...
...
@@ -138,6 +143,11 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
m_pTreeView
->
set_width_request
(
aSize
.
Width
());
m_pTreeView
->
SetSizePixel
(
aSize
);
m_pTreeView
->
Show
();
m_pTreeView
->
SetDefaultCollapsedEntryBmp
(
m_aFolderImage
);
m_pTreeView
->
SetDefaultExpandedEntryBmp
(
m_aFolderImage
);
m_pTreeView
->
SetSelectHdl
(
LINK
(
this
,
RemoteFilesDialog
,
TreeSelectHdl
)
);
m_pTreeView
->
SetExpandedHdl
(
LINK
(
this
,
RemoteFilesDialog
,
TreeExpandHdl
)
);
sal_Int32
nPosX
=
m_pTreeView
->
GetSizePixel
().
Width
();
m_pSplitter
->
SetPosPixel
(
Point
(
nPosX
,
0
));
...
...
@@ -287,12 +297,13 @@ OUString RemoteFilesDialog::getCurrentFilter()
return
sFilter
;
}
void
RemoteFilesDialog
::
OpenURL
(
OUString
sURL
)
FileViewResult
RemoteFilesDialog
::
OpenURL
(
OUString
sURL
)
{
FileViewResult
eResult
=
eFailure
;
if
(
m_pFileView
)
{
OUStringList
BlackList
;
FileViewResult
eResult
=
eFailure
;
OUString
sFilter
=
getCurrentFilter
();
m_pFileView
->
EndInplaceEditing
(
false
);
...
...
@@ -306,6 +317,68 @@ void RemoteFilesDialog::OpenURL( OUString sURL )
m_pContainer
->
Enable
(
true
);
}
}
return
eResult
;
}
void
RemoteFilesDialog
::
fillTreeEntry
(
SvTreeListEntry
*
pParent
)
{
if
(
pParent
&&
m_pTreeView
->
IsExpanded
(
pParent
)
)
{
// remove childs
if
(
pParent
)
{
SvTreeList
*
pModel
=
m_pTreeView
->
GetModel
();
if
(
pModel
->
HasChildren
(
pParent
)
)
{
SvTreeListEntries
&
rEntries
=
pModel
->
GetChildList
(
pParent
);
rEntries
.
clear
();
}
}
// fill with new ones
::
std
::
vector
<
SortingData_Impl
*
>
aContent
;
FileViewContentEnumerator
*
pContentEnumerator
=
new
FileViewContentEnumerator
(
m_xEnv
,
aContent
,
m_aMutex
,
NULL
);
OUString
*
pURL
=
static_cast
<
OUString
*
>
(
pParent
->
GetUserData
()
);
if
(
pURL
)
{
FolderDescriptor
aFolder
(
*
pURL
);
Sequence
<
OUString
>
aBlackList
;
EnumerationResult
eResult
=
pContentEnumerator
->
enumerateFolderContentSync
(
aFolder
,
aBlackList
);
if
(
SUCCESS
==
eResult
)
{
unsigned
int
nChilds
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
aContent
.
size
();
i
++
)
{
if
(
aContent
[
i
]
->
mbIsFolder
)
{
SvTreeListEntry
*
pEntry
=
m_pTreeView
->
InsertEntry
(
aContent
[
i
]
->
GetTitle
(),
pParent
,
true
);
OUString
*
sData
=
new
OUString
(
aContent
[
i
]
->
maTargetURL
);
pEntry
->
SetUserData
(
static_cast
<
void
*
>
(
sData
)
);
nChilds
++
;
}
}
if
(
nChilds
==
0
)
{
m_pTreeView
->
Collapse
(
pParent
);
}
}
}
}
}
IMPL_LINK_NOARG
(
RemoteFilesDialog
,
AddServiceHdl
)
...
...
@@ -343,7 +416,16 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl )
{
OUString
sURL
=
m_aServices
[
nPos
]
->
GetUrl
();
OpenURL
(
sURL
);
if
(
OpenURL
(
sURL
)
==
eSuccess
)
{
m_pTreeView
->
Clear
();
SvTreeListEntry
*
pRoot
=
m_pTreeView
->
InsertEntry
(
m_pServices_lb
->
GetSelectEntry
(),
NULL
,
true
);
OUString
*
sData
=
new
OUString
(
sURL
);
pRoot
->
SetUserData
(
static_cast
<
void
*
>
(
sData
)
);
m_pTreeView
->
Expand
(
pRoot
);
}
}
return
1
;
...
...
@@ -464,4 +546,21 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl )
return
1
;
}
IMPL_LINK
(
RemoteFilesDialog
,
TreeSelectHdl
,
SvTreeListBox
*
,
pBox
)
{
OUString
*
sURL
=
static_cast
<
OUString
*
>
(
pBox
->
GetHdlEntry
()
->
GetUserData
()
);
if
(
sURL
)
OpenURL
(
*
sURL
);
return
1
;
}
IMPL_LINK
(
RemoteFilesDialog
,
TreeExpandHdl
,
SvTreeListBox
*
,
pBox
)
{
fillTreeEntry
(
pBox
->
GetHdlEntry
()
);
return
1
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment