37
37
property bool apt_check_flag: true
38
38
property bool apt_null_flag: false
39
39
property int apt_num: apt_sub_num
40
property int deleget_arrow :0
42
42
signal apt_signal(string apt_msg);
44
44
if (apt_msg == "AptWork") {
45
45
//get data of cookies
46
46
var apt_data = sessiondispatcher.scan_apt_cruft_qt();
48
48
root.apt_null_flag = true;
49
if(apt_statusImage.visible == true)
50
apt_statusImage.visible = false;
50
53
root.apt_null_flag = false;
54
apt_statusImage.visible = true;
51
56
root.apt_sub_num = apt_data.length;
52
57
systemdispatcher.clear_apt_args();
53
58
apt_subModel.clear();
62
apt_subModel.append({"itemTitle": splitlist[0], "desc": "","number": splitlist[1] + "字节"});
67
apt_subModel.append({"itemTitle": splitlist[0], "desc": "","number": splitlist[1]});
63
68
systemdispatcher.set_apt_args(splitlist[0]);
92
97
// titleBar.state = "AptWork";
100
onFinishCleanWorkError: {
101
if (apt_btn_flag == "apt_work") {
103
root.apt_work_result = msg;
104
root.state = "AptWorkError";
105
toolkits.alertMSG("清理出现异常!", mainwindow.pos.x, mainwindow.pos.y);
95
109
onFinishCleanWork: {
96
110
if (apt_btn_flag == "apt_work") {
112
resetBtn.visible = true;
114
else if (msg == "apt") {
98
115
root.apt_work_result = msg;
99
116
root.state = "AptWorkFinish";
117
toolkits.alertMSG("清理完毕!", mainwindow.pos.x, mainwindow.pos.y);
118
apt_signal("AptWork");
195
208
apt_signal("AptWork");
196
209
if(root.apt_null_flag == true) {
197
210
root.state = "AptWorkEmpty";
198
sessiondispatcher.send_warningdialog_msg("友情提示:","扫描内容为空,不再执行清理!");
212
sessiondispatcher.showWarningDialog("友情提示:","扫描内容为空,不再执行清理!", mainwindow.pos.x, mainwindow.pos.y);
200
214
else if(root.apt_null_flag == false)
201
216
root.state = "AptWork";
218
toolkits.alertMSG("扫描完成!", mainwindow.pos.x, mainwindow.pos.y);
203
221
else if (apt_btn_flag == "apt_work") {
204
222
systemdispatcher.clean_file_cruft_qt(systemdispatcher.get_apt_args(), "apt");
208
sessiondispatcher.send_warningdialog_msg("友情提示:","对不起,您没有选择需要清理的项,请确认!")
215
//// hoverimage: "scan-start.png"
219
// anchors.verticalCenter: parent.verticalCenter
221
// if(apt_check_flag)
224
// if (apt_btn_flag == "apt_scan") {
225
// apt_signal("AptWork");
226
// if(root.apt_null_flag == true) {
227
// root.state = "AptWorkEmpty";
228
// sessiondispatcher.send_warningdialog_msg("友情提示:","扫描内容为空,不再执行清理!");
230
// else if(root.apt_null_flag == false)
231
// root.state = "AptWork";
233
// else if (apt_btn_flag == "apt_work") {
234
// systemdispatcher.clean_file_cruft_qt(systemdispatcher.get_apt_args(), "apt");
238
// sessiondispatcher.send_warningdialog_msg("友情提示:","对不起,您没有选择需要清理的项,请确认!")
227
sessiondispatcher.showWarningDialog("友情提示:","对不起,您没有选择需要清理的项,请确认!", mainwindow.pos.x, mainwindow.pos.y)
235
iconName: "revoke.png"
237
anchors.verticalCenter: parent.verticalCenter
239
resetBtn.visible = false;
240
apt_subModel.clear();
241
root.state = "AptWorkAGAIN";
251
254
width: parent.width - 4
257
// id: listViewDelegate
260
// property alias expandedItemCount: subItemRepeater.count
263
// height: headerItemRect.height + subItemsRect.height
266
// //checkbox, picture and words
268
// id: headerItemRect
271
// height: root.itemHeight
277
// fillMode: "PreserveAspectFit"
278
// height: parent.height*0.9
284
// id: status_update_content
286
// anchors.verticalCenter: parent.verticalCenter
290
// font.pointSize: 11
303
// fillMode: "PreserveAspectFit"
308
//// height: parent.height*0.3
309
// source: root.arrow
310
// //当鼠标点击后,箭头图片旋转90度
311
//// rotation: expanded ? 90 : 0
312
// rotation: expanded ? 0 : -180
316
// anchors.fill: parent
318
// expanded = !expanded
326
// property int itemHeight: root.itemHeight
327
// y: headerItemRect.height
329
// //当高度需要扩展时,根据expandedItemCount数目和itemHeight高度去扩展
330
// height: expanded ? delegate.expandedItemCount * itemHeight : 0
333
// Behavior on height {
334
// SequentialAnimation {
335
// NumberAnimation { duration: 100; easing.type: Easing.InOutQuad }
342
// id: subItemRepeater
343
// model: apt_subModel
344
// width: subItemsRect.width
347
// split_status: true
349
// height: subItemsRect.itemHeight
350
//// text: subItemTitle
354
// checkbox_status: root.apt_check_flag
355
//// bgImage: "../../img/icons/list_subitem.png"
357
// fontName: root.subItemFontName
358
// fontSize: root.subItemFontSize
359
// fontColor: root.subItemFontColor
361
// btn_flag: root.apt_btn_flag
372
259
Common.ScrollArea {
374
261
anchors.top: apt_titlebar.bottom
375
anchors.topMargin: 30
376
height: root.height -apt_titlebar.height - 50
262
anchors.topMargin: 20//30
263
anchors.left:parent.left
264
anchors.leftMargin: 27
265
height: root.height -apt_titlebar.height - 37//50
266
width: parent.width - 27 -2
379
268
width: parent.width
380
269
height: (root.apt_num + 1) * 40 //450 + //this height must be higher than root.height, then the slidebar can display
384
273
height: parent.height
385
274
model: apt_mainModel
386
275
delegate: Cleardelegate{
387
sub_num: apt_sub_num;sub_model: apt_subModel;btn_flag: apt_btn_flag
276
sub_num: apt_sub_num;sub_model: apt_subModel;btn_flag: apt_btn_flag;arrow_display:deleget_arrow;
388
277
delegate_flag: true
389
278
onSubpressed: {root.apt_num=hMark}
390
279
onCheckchanged: {root.apt_check_flag=checkchange}
408
PropertyChanges { target: apt_label; visible: true; text: "apt扫描完成"}
409
PropertyChanges { target: apt_bitButton; /*hoverimage: "clear-start.png"*/ text:"开始清理"}
297
PropertyChanges { target: apt_bitButton; text:"开始清理"}
410
298
PropertyChanges { target: root; apt_btn_flag: "apt_work" }
299
PropertyChanges { target: apt_statusImage; visible: true; iconName: "yellow.png"; text: "未完成"}
303
PropertyChanges { target: apt_bitButton; text:"开始扫描" }
304
PropertyChanges { target: root; apt_btn_flag: "apt_scan" }
305
PropertyChanges { target: apt_statusImage; visible: false }
309
PropertyChanges { target: apt_bitButton; text:"开始扫描" }
310
PropertyChanges { target: root; apt_btn_flag: "apt_scan" }
311
PropertyChanges { target: apt_statusImage; visible: true; iconName: "red.png"; text: "出现异常"}
414
314
name: "AptWorkFinish"
415
PropertyChanges { target: apt_label; visible: true; text: root.apt_work_result + "清理完毕!" }
416
PropertyChanges { target: apt_bitButton; /*hoverimage: "scan-start.png"*/text:"开始扫描" }
315
PropertyChanges { target: apt_bitButton; text:"开始扫描" }
417
316
PropertyChanges { target: root; apt_btn_flag: "apt_scan" }
418
PropertyChanges { target: apt_statusImage; iconName: "green.png"; text: "已完成"}
317
PropertyChanges { target: apt_statusImage; visible: true; iconName: "green.png"; text: "已完成"}
421
320
name: "AptWorkEmpty"
422
PropertyChanges { target: apt_label; visible: true; text: "扫描内容为空,不再执行清理!" }
423
PropertyChanges { target: apt_bitButton; /*hoverimage: "scan-start.png"*/ text:"开始扫描"}
321
PropertyChanges { target: apt_bitButton; text:"开始扫描"}
424
322
PropertyChanges { target: root; apt_btn_flag: "apt_scan" }
425
PropertyChanges { target: apt_statusImage; iconName: "green.png"; text: "已完成"}
323
PropertyChanges { target: apt_statusImage; visible: false}