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
d31dfe4e
Kaydet (Commit)
d31dfe4e
authored
Haz 09, 2015
tarafından
Szymon Kłos
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
the base of breadcrumb widget
Change-Id: I6775b43c270faa7158ffb2a3a9ae0f19700ddef3
üst
e0080650
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
132 additions
and
6 deletions
+132
-6
RemoteFilesDialog.hxx
include/svtools/RemoteFilesDialog.hxx
+5
-1
RemoteFilesDialog.cxx
svtools/source/dialogs/RemoteFilesDialog.cxx
+121
-3
remotefilesdialog.ui
svtools/uiconfig/ui/remotefilesdialog.ui
+6
-2
No files found.
include/svtools/RemoteFilesDialog.hxx
Dosyayı görüntüle @
d31dfe4e
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <vcl/vclptr.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/split.hxx>
#include <vcl/split.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/fixedhyper.hxx>
#include <svtools/fileview.hxx>
#include <svtools/fileview.hxx>
#include <svtools/treelistentry.hxx>
#include <svtools/treelistentry.hxx>
...
@@ -63,6 +64,7 @@ typedef std::shared_ptr<Place> ServicePtr;
...
@@ -63,6 +64,7 @@ typedef std::shared_ptr<Place> ServicePtr;
typedef
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
OUStringList
;
typedef
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
OUStringList
;
class
FileViewContainer
;
class
FileViewContainer
;
class
Breadcrumb
;
class
SVT_DLLPUBLIC
RemoteFilesDialog
:
public
ModalDialog
class
SVT_DLLPUBLIC
RemoteFilesDialog
:
public
ModalDialog
{
{
...
@@ -92,7 +94,7 @@ private:
...
@@ -92,7 +94,7 @@ private:
VclPtr
<
CancelButton
>
m_pCancel_btn
;
VclPtr
<
CancelButton
>
m_pCancel_btn
;
VclPtr
<
MenuButton
>
m_pAddService_btn
;
VclPtr
<
MenuButton
>
m_pAddService_btn
;
VclPtr
<
ListBox
>
m_pServices_lb
;
VclPtr
<
ListBox
>
m_pServices_lb
;
VclPtr
<
Edit
>
m_pPath_ed
;
VclPtr
<
Breadcrumb
>
m_pPath
;
VclPtr
<
Splitter
>
m_pSplitter
;
VclPtr
<
Splitter
>
m_pSplitter
;
VclPtr
<
SvTreeListBox
>
m_pTreeView
;
VclPtr
<
SvTreeListBox
>
m_pTreeView
;
VclPtr
<
SvtFileView
>
m_pFileView
;
VclPtr
<
SvtFileView
>
m_pFileView
;
...
@@ -127,6 +129,8 @@ private:
...
@@ -127,6 +129,8 @@ private:
DECL_LINK
(
TreeSelectHdl
,
SvTreeListBox
*
);
DECL_LINK
(
TreeSelectHdl
,
SvTreeListBox
*
);
DECL_LINK
(
TreeExpandHdl
,
SvTreeListBox
*
);
DECL_LINK
(
TreeExpandHdl
,
SvTreeListBox
*
);
DECL_LINK
(
SelectBreadcrumbHdl
,
Breadcrumb
*
);
};
};
#endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
#endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
...
...
svtools/source/dialogs/RemoteFilesDialog.cxx
Dosyayı görüntüle @
d31dfe4e
...
@@ -75,6 +75,110 @@ class FileViewContainer : public vcl::Window
...
@@ -75,6 +75,110 @@ class FileViewContainer : public vcl::Window
}
}
};
};
class
Breadcrumb
:
public
VclHBox
{
private
:
const
unsigned
int
m_cCount
=
4
;
// how many labels we have - temporary
std
::
vector
<
VclPtr
<
FixedHyperlink
>
>
m_aLinks
;
std
::
vector
<
VclPtr
<
FixedText
>
>
m_aSeparators
;
OUString
m_sPath
;
OUString
m_sClickedURL
;
Link
<>
m_aClickHdl
;
DECL_LINK
(
ClickLinkHdl
,
FixedHyperlink
*
);
public
:
Breadcrumb
(
vcl
::
Window
*
pParent
)
:
VclHBox
(
pParent
)
{
set_spacing
(
6
);
for
(
unsigned
int
i
=
0
;
i
<
m_cCount
;
i
++
)
{
m_aLinks
.
push_back
(
VclPtr
<
FixedHyperlink
>::
Create
(
this
)
);
m_aLinks
[
i
]
->
Hide
();
m_aLinks
[
i
]
->
SetClickHdl
(
LINK
(
this
,
Breadcrumb
,
ClickLinkHdl
)
);
m_aSeparators
.
push_back
(
VclPtr
<
FixedText
>::
Create
(
this
)
);
m_aSeparators
[
i
]
->
SetText
(
">"
);
m_aSeparators
[
i
]
->
Hide
();
}
}
~
Breadcrumb
()
{
disposeOnce
();
}
void
dispose
()
{
for
(
unsigned
int
i
=
0
;
i
<
m_cCount
;
i
++
)
{
m_aSeparators
[
i
].
disposeAndClear
();
m_aLinks
[
i
].
disposeAndClear
();
}
VclHBox
::
dispose
();
}
void
SetClickHdl
(
const
Link
<>&
rLink
)
{
m_aClickHdl
=
rLink
;
}
OUString
GetHdlURL
()
{
return
m_sClickedURL
;
}
void
SetURL
(
const
OUString
&
rURL
)
{
m_sPath
=
rURL
;
INetURLObject
aURL
(
rURL
);
aURL
.
setFinalSlash
();
OUString
sPath
=
aURL
.
GetURLPath
(
INetURLObject
::
DECODE_WITH_CHARSET
);
unsigned
int
nSegments
=
aURL
.
getSegmentCount
();
unsigned
int
nPos
=
0
;
unsigned
int
i
;
m_aLinks
[
0
]
->
SetText
(
"Root"
);
m_aLinks
[
0
]
->
Show
();
m_aLinks
[
0
]
->
SetURL
(
INetURLObject
::
GetScheme
(
aURL
.
GetProtocol
()
)
+
aURL
.
GetHost
()
);
m_aSeparators
[
0
]
->
Show
();
for
(
i
=
1
;
i
<
m_cCount
&&
i
<
nSegments
+
1
;
i
++
)
{
unsigned
int
nEnd
=
sPath
.
indexOf
(
'/'
,
nPos
+
1
);
OUString
sLabel
=
OUString
(
sPath
.
getStr
()
+
nPos
+
1
,
nEnd
-
nPos
-
1
);
m_aLinks
[
i
]
->
SetText
(
sLabel
);
m_aLinks
[
i
]
->
SetURL
(
INetURLObject
::
GetScheme
(
aURL
.
GetProtocol
()
)
+
aURL
.
GetHost
()
+
OUString
(
sPath
.
getStr
(),
nEnd
)
);
m_aLinks
[
i
]
->
Show
();
m_aSeparators
[
i
]
->
Show
();
nPos
=
nEnd
;
}
for
(;
i
<
m_cCount
;
i
++
)
{
m_aLinks
[
i
]
->
Hide
();
m_aSeparators
[
i
]
->
Hide
();
}
}
};
IMPL_LINK
(
Breadcrumb
,
ClickLinkHdl
,
FixedHyperlink
*
,
pLink
)
{
m_sClickedURL
=
pLink
->
GetURL
();
m_aClickHdl
.
Call
(
this
);
return
1
;
}
RemoteFilesDialog
::
RemoteFilesDialog
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
RemoteFilesDialog
::
RemoteFilesDialog
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
ModalDialog
(
pParent
,
"RemoteFilesDialog"
,
"svt/ui/remotefilesdialog.ui"
)
:
ModalDialog
(
pParent
,
"RemoteFilesDialog"
,
"svt/ui/remotefilesdialog.ui"
)
,
m_context
(
comphelper
::
getProcessComponentContext
())
,
m_context
(
comphelper
::
getProcessComponentContext
())
...
@@ -88,7 +192,6 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
...
@@ -88,7 +192,6 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
get
(
m_pCancel_btn
,
"cancel"
);
get
(
m_pCancel_btn
,
"cancel"
);
get
(
m_pAddService_btn
,
"add_service_btn"
);
get
(
m_pAddService_btn
,
"add_service_btn"
);
get
(
m_pServices_lb
,
"services_lb"
);
get
(
m_pServices_lb
,
"services_lb"
);
get
(
m_pPath_ed
,
"path"
);
get
(
m_pFilter_lb
,
"filter_lb"
);
get
(
m_pFilter_lb
,
"filter_lb"
);
get
(
m_pName_ed
,
"name_ed"
);
get
(
m_pName_ed
,
"name_ed"
);
...
@@ -118,6 +221,11 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
...
@@ -118,6 +221,11 @@ RemoteFilesDialog::RemoteFilesDialog(vcl::Window* pParent, WinBits nBits)
m_pOpen_btn
->
Hide
();
m_pOpen_btn
->
Hide
();
}
}
m_pPath
=
VclPtr
<
Breadcrumb
>::
Create
(
get
<
vcl
::
Window
>
(
"breadcrumb_container"
)
);
m_pPath
->
set_hexpand
(
true
);
m_pPath
->
SetClickHdl
(
LINK
(
this
,
RemoteFilesDialog
,
SelectBreadcrumbHdl
)
);
m_pPath
->
Show
();
m_pContainer
=
VclPtr
<
FileViewContainer
>::
Create
(
get
<
vcl
::
Window
>
(
"container"
)
);
m_pContainer
=
VclPtr
<
FileViewContainer
>::
Create
(
get
<
vcl
::
Window
>
(
"container"
)
);
m_pContainer
->
set_hexpand
(
true
);
m_pContainer
->
set_hexpand
(
true
);
...
@@ -201,13 +309,13 @@ void RemoteFilesDialog::dispose()
...
@@ -201,13 +309,13 @@ void RemoteFilesDialog::dispose()
m_pFileView
.
disposeAndClear
();
m_pFileView
.
disposeAndClear
();
m_pSplitter
.
disposeAndClear
();
m_pSplitter
.
disposeAndClear
();
m_pContainer
.
disposeAndClear
();
m_pContainer
.
disposeAndClear
();
m_pPath
.
disposeAndClear
();
m_pOpen_btn
.
clear
();
m_pOpen_btn
.
clear
();
m_pSave_btn
.
clear
();
m_pSave_btn
.
clear
();
m_pCancel_btn
.
clear
();
m_pCancel_btn
.
clear
();
m_pAddService_btn
.
clear
();
m_pAddService_btn
.
clear
();
m_pServices_lb
.
clear
();
m_pServices_lb
.
clear
();
m_pPath_ed
.
clear
();
m_pFilter_lb
.
clear
();
m_pFilter_lb
.
clear
();
m_pName_ed
.
clear
();
m_pName_ed
.
clear
();
...
@@ -307,11 +415,11 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString sURL )
...
@@ -307,11 +415,11 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString sURL )
OUString
sFilter
=
getCurrentFilter
();
OUString
sFilter
=
getCurrentFilter
();
m_pFileView
->
EndInplaceEditing
(
false
);
m_pFileView
->
EndInplaceEditing
(
false
);
m_pPath_ed
->
SetText
(
sURL
);
eResult
=
m_pFileView
->
Initialize
(
sURL
,
sFilter
,
NULL
,
BlackList
);
eResult
=
m_pFileView
->
Initialize
(
sURL
,
sFilter
,
NULL
,
BlackList
);
if
(
eResult
==
eSuccess
)
if
(
eResult
==
eSuccess
)
{
{
m_pPath
->
SetURL
(
sURL
);
m_pFilter_lb
->
Enable
(
true
);
m_pFilter_lb
->
Enable
(
true
);
m_pName_ed
->
Enable
(
true
);
m_pName_ed
->
Enable
(
true
);
m_pContainer
->
Enable
(
true
);
m_pContainer
->
Enable
(
true
);
...
@@ -563,4 +671,14 @@ IMPL_LINK ( RemoteFilesDialog, TreeExpandHdl, SvTreeListBox *, pBox )
...
@@ -563,4 +671,14 @@ IMPL_LINK ( RemoteFilesDialog, TreeExpandHdl, SvTreeListBox *, pBox )
return
1
;
return
1
;
}
}
IMPL_LINK
(
RemoteFilesDialog
,
SelectBreadcrumbHdl
,
Breadcrumb
*
,
pPtr
)
{
if
(
pPtr
)
{
OpenURL
(
pPtr
->
GetHdlURL
()
);
}
return
1
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/uiconfig/ui/remotefilesdialog.ui
Dosyayı görüntüle @
d31dfe4e
...
@@ -123,9 +123,13 @@
...
@@ -123,9 +123,13 @@
</packing>
</packing>
</child>
</child>
<child>
<child>
<object
class=
"Gtk
Entry"
id=
"path
"
>
<object
class=
"Gtk
Box"
id=
"breadcrumb_container
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"hexpand"
>
True
</property>
<child>
<placeholder/>
</child>
</object>
</object>
<packing>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"expand"
>
False
</property>
...
...
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