-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.qml
250 lines (247 loc) · 6.69 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import QtQuick 2.15
import QtQuick.Window
import QtQuick.Controls 2.0
import "Mycomponent"
Window {
id: root
width: 1050
height: 600
visible: true
title: qsTr("H-box")
property var dict:({})
property string datadir:cfg.getdatadir()
property var config:({})
Component.onCompleted: {
// stack.push(netview)
// stack.push(home)
config = cfg.lang(9)
let lock = cfg.getlock()
if(lock===0){
main.visible = true
lockview.visible = false
}else{
main.visible = false
lockview.visible = true
}
}
VideoView{
id: videoviews
}
MsgTip{
id:msgtip
}
Row{
id:main
visible:false
Rectangle {
id: left
height: root.height
width: 130
color: cfg.c("left.bg")
Rectangle{
id:version
visible: false
height: 30
width:parent.width*2/3
anchors.horizontalCenter: left.horizontalCenter
y:root.height-70
radius: 10
color:"yellow"
Text {
anchors.centerIn: parent
text: "new version"
}
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Qt.openUrlExternally("https://github.com/alishanjack/h-box")
}
}
}
Label{
anchors.horizontalCenter: left.horizontalCenter
y:root.height-30
text:cfg.c("config.version")
}
Column {
anchors.horizontalCenter: left.horizontalCenter
spacing: 10
y:10
MyButton {
id:homebutton
nameb:config.left.home
text: config.left.home
stackview: home
icon{
source: "./icon/home.svg"
}
}
MyButton {
id:collectbutton
text: config.left.collect
nameb:config.left.collect
stackview: collect
icon{
source: "./icon/love.svg"
}
}
MyButton {
id:tagsbutton
text: config.left.tags
nameb: config.left.tags
stackview: tags
icon{
source: "./icon/tag.svg"
}
}
MyButton {
id:historybutton
text: config.left.history
stackview: history
nameb:config.left.history
icon{
source: "./icon/history.svg"
}
}
// MyButton{
// id:daoru
// text:config.left.import
// nameb:config.left.import
// stackview: daoruview
// icon{
// source:"./icon/import.svg"
// }
// }
MyButton{
id:downnet
text:config.left.netdown
nameb:config.left.netdown
stackview: netview
icon{
source:"./icon/download.svg"
}
}
MyButton {
id:settingbutton
text: config.left.setting
nameb: config.left.setting
stackview: setting
icon{
source: "./icon/setting.svg"
}
}
Button{
width: 104
height: 30
spacing:5
font.pointSize: 10
text:"Join Us"
background: Rectangle {
anchors.fill: parent
color: "white"
radius: 5
}
icon{
width: 20
height: 20
source: "./icon/telegram.svg"
}
onClicked: {
Qt.openUrlExternally("https://t.me/hboxapp")
}
}
Button{
width: 104
height: 30
spacing:5
font.pointSize: 10
text:"Address"
background: Rectangle {
anchors.fill: parent
color: "white"
radius: 5
}
icon{
width: 20
height: 20
source: "./icon/github.svg"
}
onClicked: {
Qt.openUrlExternally("https://github.com/alishanjack/h-box")
}
}
}
}
Rectangle {
id: right
height: root.height
width: root.width - 130
StackView {
clip: true
id: stack
initialItem: netview
anchors.fill: parent
}
}
}
Component {
id: home
HomeView{}
}
Component {
id: collect
CollectView{}
}
Component {
id: history
HistoryView{}
}
Component {
id: setting
SettingView{}
}
Component {
id: tags
TagView{}
}
// Component {
// id: daoruview
// DownLoad{}
// }
Component {
id: netview
NetDown{objectName: "net"}
}
Rectangle {
id:lockview
anchors.fill: parent
visible:false
Column{
anchors.centerIn: parent
Text{
id:err
text:"passwd error"
visible:false
}
TextField{
id:pwd
placeholderText: "password"
onAccepted:{
if(cfg.checkpwd(pwd.text)){
main.visible = true
lockview.visible = false
}else{
err.visible=true
}
}
}
}
}
Connections{
target: bgsig
function onSig(ver){
version.visible = true
}
}
}