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
1abade4f
Kaydet (Commit)
1abade4f
authored
Tem 13, 2015
tarafından
Szymon Kłos
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
moved the FolderTree class
Change-Id: I3231b32d3e3ade7dc3b366f03d6e189f5bc4d431
üst
1c25093f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
174 additions
and
128 deletions
+174
-128
RemoteFilesDialog.hxx
include/svtools/RemoteFilesDialog.hxx
+1
-15
foldertree.hxx
include/svtools/foldertree.hxx
+56
-0
Library_svt.mk
svtools/Library_svt.mk
+1
-0
foldertree.cxx
svtools/source/contnr/foldertree.cxx
+116
-0
RemoteFilesDialog.cxx
svtools/source/dialogs/RemoteFilesDialog.cxx
+0
-113
No files found.
include/svtools/RemoteFilesDialog.hxx
Dosyayı görüntüle @
1abade4f
...
...
@@ -10,18 +10,15 @@
#ifndef INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
#define INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
#include <svtools/foldertree.hxx>
#include <svtools/svtdllapi.h>
#include <svtools/place.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <svtools/svtools.hrc>
#include <svtools/svtresid.hxx>
#include <svtools/breadcrumb.hxx>
#include <svtools/fileview.hxx>
#include <svtools/treelistentry.hxx>
#include <vcl/button.hxx>
#include <vcl/menubtn.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/dialog.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/split.hxx>
...
...
@@ -30,11 +27,6 @@
#include <officecfg/Office/Common.hxx>
#include <com/sun/star/beans/StringPair.hpp>
#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>
...
...
@@ -42,11 +34,7 @@
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
ucb
;
using
namespace
::
com
::
sun
::
star
::
task
;
using
namespace
::
com
::
sun
::
star
::
ui
::
dialogs
;
using
namespace
::
comphelper
;
using
namespace
::
svt
;
enum
SvtRemoteDlgMode
{
...
...
@@ -64,8 +52,6 @@ typedef std::shared_ptr< Place > ServicePtr;
typedef
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
OUStringList
;
class
FileViewContainer
;
class
Breadcrumb
;
class
FolderTree
;
class
SVT_DLLPUBLIC
RemoteFilesDialog
:
public
SvtFileDialog_Base
{
...
...
include/svtools/foldertree.hxx
0 → 100644
Dosyayı görüntüle @
1abade4f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SVTOOLS_FOLDERTREE_HXX
#define INCLUDED_SVTOOLS_FOLDERTREE_HXX
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <officecfg/Office/Common.hxx>
#include <svtools/svtdllapi.h>
#include <svtools/svtools.hrc>
#include <svtools/svtresid.hxx>
#include <svtools/treelistentry.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <vcl/image.hxx>
#include <vcl/lstbox.hxx>
using
namespace
::
com
::
sun
::
star
::
ucb
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
task
;
using
namespace
::
svt
;
class
SVT_DLLPUBLIC
FolderTree
:
public
SvTreeListBox
{
private
:
Reference
<
XCommandEnvironment
>
m_xEnv
;
::
osl
::
Mutex
m_aMutex
;
Sequence
<
OUString
>
m_aBlackList
;
Image
m_aFolderImage
;
public
:
FolderTree
(
vcl
::
Window
*
pParent
,
WinBits
nBits
);
virtual
void
RequestingChildren
(
SvTreeListEntry
*
pEntry
);
void
FillTreeEntry
(
SvTreeListEntry
*
pEntry
);
void
SetTreePath
(
OUString
sUrl
);
void
SetBlackList
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>&
rBlackList
);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/Library_svt.mk
Dosyayı görüntüle @
1abade4f
...
...
@@ -92,6 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/DocumentInfoPreview \
svtools/source/contnr/contentenumeration \
svtools/source/contnr/fileview \
svtools/source/contnr/foldertree \
svtools/source/contnr/imivctl1 \
svtools/source/contnr/imivctl2 \
svtools/source/contnr/ivctrl \
...
...
svtools/source/contnr/foldertree.cxx
0 → 100644
Dosyayı görüntüle @
1abade4f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <svtools/foldertree.hxx>
#include "contentenumeration.hxx"
FolderTree
::
FolderTree
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
SvTreeListBox
(
pParent
,
nBits
|
WB_SORT
|
WB_TABSTOP
)
,
m_aFolderImage
(
SvtResId
(
IMG_SVT_FOLDER
)
)
{
Reference
<
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
Reference
<
XInteractionHandler
>
xInteractionHandler
(
InteractionHandler
::
createWithParent
(
xContext
,
0
),
UNO_QUERY_THROW
);
m_xEnv
=
new
::
ucbhelper
::
CommandEnvironment
(
xInteractionHandler
,
Reference
<
XProgressHandler
>
()
);
SetDefaultCollapsedEntryBmp
(
m_aFolderImage
);
SetDefaultExpandedEntryBmp
(
m_aFolderImage
);
}
void
FolderTree
::
RequestingChildren
(
SvTreeListEntry
*
pEntry
)
{
FillTreeEntry
(
pEntry
);
}
void
FolderTree
::
FillTreeEntry
(
SvTreeListEntry
*
pEntry
)
{
// fill only empty entries
if
(
pEntry
&&
GetChildCount
(
pEntry
)
==
0
)
{
::
std
::
vector
<
SortingData_Impl
*
>
aContent
;
FileViewContentEnumerator
*
pContentEnumerator
=
new
FileViewContentEnumerator
(
m_xEnv
,
aContent
,
m_aMutex
,
NULL
);
OUString
*
pURL
=
static_cast
<
OUString
*
>
(
pEntry
->
GetUserData
()
);
if
(
pURL
)
{
FolderDescriptor
aFolder
(
*
pURL
);
EnumerationResult
eResult
=
pContentEnumerator
->
enumerateFolderContentSync
(
aFolder
,
m_aBlackList
);
if
(
SUCCESS
==
eResult
)
{
for
(
unsigned
int
i
=
0
;
i
<
aContent
.
size
();
i
++
)
{
if
(
aContent
[
i
]
->
mbIsFolder
)
{
SvTreeListEntry
*
pNewEntry
=
InsertEntry
(
aContent
[
i
]
->
GetTitle
(),
pEntry
,
true
);
OUString
*
sData
=
new
OUString
(
aContent
[
i
]
->
maTargetURL
);
pNewEntry
->
SetUserData
(
static_cast
<
void
*
>
(
sData
)
);
}
}
}
}
}
}
void
FolderTree
::
SetTreePath
(
OUString
sUrl
)
{
INetURLObject
aUrl
(
sUrl
);
aUrl
.
setFinalSlash
();
OUString
sPath
=
aUrl
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
SvTreeListEntry
*
pEntry
=
First
();
bool
end
=
false
;
while
(
pEntry
&&
!
end
)
{
if
(
pEntry
->
GetUserData
()
)
{
OUString
sNodeUrl
=
*
static_cast
<
OUString
*
>
(
pEntry
->
GetUserData
()
);
INetURLObject
aUrlObj
(
sNodeUrl
);
aUrlObj
.
setFinalSlash
();
sNodeUrl
=
aUrlObj
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
if
(
sPath
==
sNodeUrl
)
{
Select
(
pEntry
);
end
=
true
;
}
else
if
(
sPath
.
startsWith
(
sNodeUrl
)
)
{
if
(
!
IsExpanded
(
pEntry
)
)
Expand
(
pEntry
);
pEntry
=
FirstChild
(
pEntry
);
}
else
{
pEntry
=
NextSibling
(
pEntry
);
}
}
else
break
;
}
}
void
FolderTree
::
SetBlackList
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>&
rBlackList
)
{
m_aBlackList
=
rBlackList
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/source/dialogs/RemoteFilesDialog.cxx
Dosyayı görüntüle @
1abade4f
...
...
@@ -8,119 +8,6 @@
*/
#include <svtools/RemoteFilesDialog.hxx>
#include "../contnr/contentenumeration.hxx"
class
FolderTree
:
public
SvTreeListBox
{
private
:
Reference
<
XCommandEnvironment
>
m_xEnv
;
::
osl
::
Mutex
m_aMutex
;
Sequence
<
OUString
>
m_aBlackList
;
Image
m_aFolderImage
;
public
:
FolderTree
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
SvTreeListBox
(
pParent
,
nBits
|
WB_SORT
|
WB_TABSTOP
)
,
m_aFolderImage
(
SvtResId
(
IMG_SVT_FOLDER
)
)
{
Reference
<
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
Reference
<
XInteractionHandler
>
xInteractionHandler
(
InteractionHandler
::
createWithParent
(
xContext
,
0
),
UNO_QUERY_THROW
);
m_xEnv
=
new
::
ucbhelper
::
CommandEnvironment
(
xInteractionHandler
,
Reference
<
XProgressHandler
>
()
);
SetDefaultCollapsedEntryBmp
(
m_aFolderImage
);
SetDefaultExpandedEntryBmp
(
m_aFolderImage
);
}
virtual
void
RequestingChildren
(
SvTreeListEntry
*
pEntry
)
{
FillTreeEntry
(
pEntry
);
}
void
FillTreeEntry
(
SvTreeListEntry
*
pEntry
)
{
// fill only empty entries
if
(
pEntry
&&
GetChildCount
(
pEntry
)
==
0
)
{
::
std
::
vector
<
SortingData_Impl
*
>
aContent
;
FileViewContentEnumerator
*
pContentEnumerator
=
new
FileViewContentEnumerator
(
m_xEnv
,
aContent
,
m_aMutex
,
NULL
);
OUString
*
pURL
=
static_cast
<
OUString
*
>
(
pEntry
->
GetUserData
()
);
if
(
pURL
)
{
FolderDescriptor
aFolder
(
*
pURL
);
EnumerationResult
eResult
=
pContentEnumerator
->
enumerateFolderContentSync
(
aFolder
,
m_aBlackList
);
if
(
SUCCESS
==
eResult
)
{
for
(
unsigned
int
i
=
0
;
i
<
aContent
.
size
();
i
++
)
{
if
(
aContent
[
i
]
->
mbIsFolder
)
{
SvTreeListEntry
*
pNewEntry
=
InsertEntry
(
aContent
[
i
]
->
GetTitle
(),
pEntry
,
true
);
OUString
*
sData
=
new
OUString
(
aContent
[
i
]
->
maTargetURL
);
pNewEntry
->
SetUserData
(
static_cast
<
void
*
>
(
sData
)
);
}
}
}
}
}
}
void
SetTreePath
(
OUString
sUrl
)
{
INetURLObject
aUrl
(
sUrl
);
aUrl
.
setFinalSlash
();
OUString
sPath
=
aUrl
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
SvTreeListEntry
*
pEntry
=
First
();
bool
end
=
false
;
while
(
pEntry
&&
!
end
)
{
if
(
pEntry
->
GetUserData
()
)
{
OUString
sNodeUrl
=
*
static_cast
<
OUString
*
>
(
pEntry
->
GetUserData
()
);
INetURLObject
aUrlObj
(
sNodeUrl
);
aUrlObj
.
setFinalSlash
();
sNodeUrl
=
aUrlObj
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
if
(
sPath
==
sNodeUrl
)
{
Select
(
pEntry
);
end
=
true
;
}
else
if
(
sPath
.
startsWith
(
sNodeUrl
)
)
{
if
(
!
IsExpanded
(
pEntry
)
)
Expand
(
pEntry
);
pEntry
=
FirstChild
(
pEntry
);
}
else
{
pEntry
=
NextSibling
(
pEntry
);
}
}
else
break
;
}
}
void
SetBlackList
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>&
rBlackList
)
{
m_aBlackList
=
rBlackList
;
}
};
class
FileViewContainer
:
public
vcl
::
Window
{
...
...
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