Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Alderaan
pan-light
提交
3a6d997f
P
pan-light
项目概览
Alderaan
/
pan-light
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pan-light
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3a6d997f
编写于
7月 02, 2019
作者:
P
peterq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix pc: crash in mac
上级
0cbc8172
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
336 addition
and
0 deletion
+336
-0
pc/gui/qml/explore/Explore.qml
pc/gui/qml/explore/Explore.qml
+135
-0
pc/gui/qml/pan/Pan.qml
pc/gui/qml/pan/Pan.qml
+87
-0
pc/gui/qml/transfer/Transfer.qml
pc/gui/qml/transfer/Transfer.qml
+114
-0
未找到文件。
pc/gui/qml/explore/Explore.qml
0 → 100644
浏览文件 @
3a6d997f
import
QtQuick
2.0
import
"
../comps
"
Item
{
id
:
root
property
var
tasbs
:
Object
.
keys
(
tasbsMap
)
property
var
tasbsMap
:
{
"
newest
"
:
'
最新
'
,
"
hottest
"
:
'
最热
'
,
"
official
"
:
'
官方
'
}
property
string
currentTab
:
'
newest
'
signal
active
onCurrentTabChanged
:
{
listRepeater
.
itemAt
(
tasbs
.
indexOf
(
currentTab
)).
active
()
}
onActive
:
{
listRepeater
.
itemAt
(
tasbs
.
indexOf
(
currentTab
)).
active
()
}
DataSaver
{
$key
:
'
page-explorer
'
property
alias
showTip
:
tip
.
showTip
}
Column
{
anchors.fill
:
parent
Rectangle
{
id
:
tip
property
string
showTip
:
'
show
'
visible
:
showTip
===
'
show
'
color
:
'
#409EFF
'
width
:
parent
.
width
height
:
visible
?
textTip
.
implicitHeight
+
20
:
0
Text
{
id
:
textTip
color
:
'
white
'
width
:
parent
.
width
-
40
anchors.centerIn
:
parent
wrapMode
:
Text
.
WrapAnywhere
text
:
'
开放型的资源广场, 突破版权文件分享限制(被和谐的违规文件除外).实验性功能, 暂只支持分享大于256k的文件.
'
}
IconButton
{
iconType
:
'
close
'
color
:
'
red
'
anchors.right
:
parent
.
right
anchors.rightMargin
:
10
anchors.verticalCenter
:
parent
.
verticalCenter
onClicked
:
{
tip
.
showTip
=
''
}
}
}
Rectangle
{
id
:
tabsBar
width
:
parent
.
width
height
:
60
Rectangle
{
width
:
parent
.
width
height
:
1
color
:
'
#ddd
'
anchors.bottom
:
parent
.
bottom
}
Item
{
id
:
typeTab
property
int
padding
:
4
property
int
tabWidth
:
80
width
:
tabWidth
*
tabs
.
length
+
2
*
padding
height
:
parent
.
height
*
0.7
anchors.verticalCenter
:
parent
.
verticalCenter
x
:
10
Rectangle
{
anchors.fill
:
parent
radius
:
3
color
:
'
#eee
'
}
Rectangle
{
radius
:
3
width
:
typeTab
.
tabWidth
height
:
typeTab
.
height
-
2
*
typeTab
.
padding
color
:
'
#fff
'
anchors.verticalCenter
:
parent
.
verticalCenter
x
:
typeTab
.
padding
+
root
.
tasbs
.
indexOf
(
root
.
currentTab
)
*
typeTab
.
tabWidth
Behavior
on
x
{
PropertyAnimation
{
duration
:
400
easing.type
:
Easing
.
OutCubic
}
}
}
Repeater
{
model
:
root
.
tasbs
delegate
:
Item
{
width
:
typeTab
.
tabWidth
height
:
typeTab
.
height
-
2
*
typeTab
.
padding
anchors.verticalCenter
:
parent
.
verticalCenter
x
:
typeTab
.
padding
+
index
*
typeTab
.
tabWidth
Text
{
text
:
root
.
tasbsMap
[
modelData
]
anchors.centerIn
:
parent
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
root
.
currentTab
=
modelData
}
}
}
}
}
}
Repeater
{
id
:
listRepeater
model
:
root
.
tasbs
ShareList
{
id
:
shareList
type
:
modelData
height
:
parent
.
height
-
tip
.
height
-
tabsBar
.
height
width
:
parent
.
width
visible
:
root
.
currentTab
==
type
}
}
}
}
pc/gui/qml/pan/Pan.qml
0 → 100644
浏览文件 @
3a6d997f
import
QtQuick
2.0
import
'
../videoPlayer
'
import
'
../js/app.js
'
as
App
import
'
../js/util.js
'
as
Util
import
'
../comps
'
import
'
./left-panel
'
Rectangle
{
id
:
root
signal
active
// 左侧信息栏
LeftPanel
{
id
:
leftPanel
height
:
parent
.
height
width
:
250
// 右侧border
Rectangle
{
color
:
'
gray
'
width
:
2
height
:
parent
.
height
anchors.right
:
parent
.
right
}
}
// 头部加列表
Rectangle
{
anchors.left
:
leftPanel
.
right
width
:
root
.
width
-
leftPanel
.
width
height
:
parent
.
height
PathNav
{
id
:
pathNav
width
:
parent
.
width
height
:
40
// 下侧border
Rectangle
{
color
:
'
gray
'
width
:
parent
.
width
height
:
2
anchors.bottom
:
parent
.
bottom
}
}
FileList
{
width
:
parent
.
width
height
:
parent
.
height
-
pathNav
.
height
anchors.top
:
pathNav
.
bottom
color
:
"
#fff
"
Rectangle
{
id
:
loading
anchors.fill
:
parent
visible
:
false
color
:
Qt
.
rgba
(
1
,
1
,
1
,.
6
)
Component
{
id
:
iconComp
IconFont
{
type
:
'
loading
'
width
:
Math
.
min
(
loading
.
width
,
loading
.
height
)
*
0.3
}
}
Loader
{
id
:
iconLoader
focus
:
true
anchors.centerIn
:
parent
}
Component.onCompleted
:
{
// 监听进入path, 延时500ms显示加载动画
App
.
appState
.
enterPathPromiseChanged
.
connect
(
function
()
{
if
(
!
App
.
appState
.
enterPathPromise
)
{
loading
.
visible
=
false
iconLoader
.
sourceComponent
=
null
return
}
var
p
=
App
.
appState
.
enterPathPromise
Util
.
sleep
(
500
)
.
then
(
function
(){
if
(
App
.
appState
.
enterPathPromise
===
p
)
{
iconLoader
.
sourceComponent
=
iconComp
loading
.
visible
=
true
}
})
})
}
}
LoadDirError
{}
}
}
}
pc/gui/qml/transfer/Transfer.qml
0 → 100644
浏览文件 @
3a6d997f
import
QtQuick
2.0
import
"
../js/app.js
"
as
App
import
"
../js/util.js
"
as
Util
Item
{
id
:
root
signal
sumSpeed
(
var
data
)
signal
active
HeaderBar
{
id
:
headerBar
}
Rectangle
{
width
:
parent
.
width
height
:
2
color
:
'
gray
'
anchors.bottom
:
headerBar
.
bottom
}
DownloadList
{
id
:
downloadingList
visible
:
headerBar
.
currentTab
==
'
下载中
'
isFinish
:
false
anchors.top
:
headerBar
.
bottom
width
:
parent
.
width
height
:
parent
.
height
-
headerBar
.
height
}
DownloadList
{
id
:
downloadedList
visible
:
headerBar
.
currentTab
==
'
已完成
'
isFinish
:
true
anchors.top
:
headerBar
.
bottom
width
:
parent
.
width
height
:
parent
.
height
-
headerBar
.
height
}
Component.onCompleted
:
{
App
.
appState
.
transferComp
=
root
}
function
addDownload
(
meta
,
useVip
)
{
return
Util
.
Promise
.
resolve
().
then
(
function
()
{
var
evt
=
{
"
fid
"
:
meta
.
fs_id
+
''
,
"
exist
"
:
false
}
downloadingList
.
checkFid
(
evt
)
if
(
evt
.
exist
)
return
Util
.
confirm
()
return
true
}).
then
(
function
()
{
if
(
App
.
appState
.
settings
.
defaultDownloadPath
)
return
App
.
appState
.
settings
.
defaultDownloadPath
return
Util
.
pickSavePath
({
"
fileName
"
:
meta
.
server_filename
,
"
defaultFolder
"
:
App
.
appState
.
settings
.
lastDownloadPath
})
}).
then
(
function
(
savePath
)
{
savePath
=
savePath
.
toString
()
var
newFid
=
(
useVip
?
'
vip
'
:
'
direct
'
)
+
'
.
'
+
meta
.
fs_id
var
id
=
Util
.
callGoSync
(
'
download.new
'
,
{
"
fid
"
:
newFid
,
"
savePath
"
:
savePath
})
var
obj
=
JSON
.
parse
(
JSON
.
stringify
(
meta
))
obj
.
downloadId
=
id
var
sep
=
Qt
.
platform
.
os
==
"
windows
"
?
'
\\
'
:
'
/
'
var
t
=
String
.
prototype
.
split
.
call
(
savePath
,
sep
)
obj
.
newFid
=
newFid
obj
.
saveName
=
t
.
pop
()
obj
.
savePath
=
savePath
obj
.
useVip
=
!!
useVip
downloadingList
.
add
(
obj
)
})
}
function
addDownloadShare
(
md5
,
sliceMd5
,
fileSize
,
fileName
)
{
var
fid
=
[
'
share
'
,
md5
,
sliceMd5
,
fileSize
].
join
(
'
.
'
)
return
Util
.
Promise
.
resolve
().
then
(
function
()
{
return
Util
.
pickSavePath
({
"
fileName
"
:
fileName
,
"
defaultFolder
"
:
App
.
appState
.
settings
.
lastDownloadPath
})
}).
then
(
function
(
savePath
)
{
var
id
=
Util
.
callGoSync
(
'
download.new
'
,
{
"
fid
"
:
fid
,
"
savePath
"
:
savePath
})
var
obj
=
{
"
size
"
:
fileSize
,
"
downloadId
"
:
id
,
"
newFid
"
:
fid
,
"
savePath
"
:
savePath
,
"
useVip
"
:
true
,
"
fileName
"
:
fileName
,
"
isShare
"
:
true
}
var
sep
=
Qt
.
platform
.
os
==
"
windows
"
?
'
\\
'
:
'
/
'
var
t
=
String
.
prototype
.
split
.
call
(
savePath
,
sep
)
obj
.
saveName
=
t
.
pop
()
downloadingList
.
add
(
obj
)
})
}
function
deleteItem
(
idx
,
isFinish
)
{
var
c
=
isFinish
?
downloadedList
:
downloadingList
c
.
remove
(
idx
)
}
function
itemCompleted
(
idx
)
{
var
data
=
JSON
.
parse
(
JSON
.
stringify
(
downloadingList
.
get
(
idx
)))
downloadingList
.
remove
(
idx
)
downloadedList
.
add
(
data
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录