36
36
property int sof_num:sof_sub_num
37
37
property bool sof_null_flag: false
38
38
property bool sof_check_flag:true
39
property int deleget_arrow :0
42
41
function remove_last_name(str)
52
51
//get data of cookies
53
52
// var software_data = systemdispatcher.scan_softwarecenter_cruft_qt();
54
53
var software_data = sessiondispatcher.scan_softwarecenter_cruft_qt();
55
if (software_data == "")
54
if (software_data == "") {
56
55
root.sof_null_flag = true;
56
if(sof_statusImage.visible == true)
57
sof_statusImage.visible = false;
58
60
root.sof_null_flag = false;
61
sof_statusImage.visible == true
59
63
root.sof_sub_num = software_data.length;
60
64
systemdispatcher.clear_software_args();
61
65
sof_subModel.clear();
70
sof_subModel.append({"itemTitle": splitlist[0], "desc": "","number": splitlist[1] + "字节"});
74
sof_subModel.append({"itemTitle": splitlist[0], "desc": "","number": splitlist[1]});
71
75
systemdispatcher.set_software_args(splitlist[0]);
74
78
root.sof_sub_num -= num;
79
sof_num = sof_sub_num;
77
81
sof_check_flag=true;
78
82
sof_mainModel.clear();
79
83
sof_mainModel.append({"itemTitle": "软件中心缓存清理",
80
84
"picture": "../img/toolWidget/software-min.png",
81
"detailstr": "用户可以根据扫描结果选择性地清理软件中心缓存,缓存路径为:" + sessiondispatcher.get_home_path() + "/.cache/software-center/",
85
"detailstr": "用户可以根据扫描结果选择性地清理软件中心缓存,缓存路径为:" + sessiondispatcher.getHomePath() + "/.cache/software-center/",
82
86
"flags": "clear_software",
84
88
[{"subItemTitle": "Cookies1"},
128
onFinishCleanWorkError: {
129
if (sof_btn_flag == "software_work") {
130
if (msg == "software") {
131
root.sof_work_result = msg;
132
root.state = "SoftwareWorkError";
133
toolkits.alertMSG("清理出现异常!", mainwindow.pos.x, mainwindow.pos.y);
124
137
onFinishCleanWork: {
125
138
if (sof_btn_flag == "software_work") {
126
if (msg == "software") {
140
resetBtn.visible = true;
142
else if (msg == "software") {
127
143
root.sof_work_result = msg;
128
144
root.state = "SoftwareWorkFinish";
145
toolkits.alertMSG("清理完毕!", mainwindow.pos.x, mainwindow.pos.y);
146
software_signal("SoftwareWork");
170
188
anchors { top: parent.top; topMargin: 30;right: parent.right ; rightMargin: 40 }
175
// id: sof_statusImage
176
// source: "../img/toolWidget/unfinish.png"
177
// fillMode: "PreserveAspectFit"
179
// anchors.verticalCenter: parent.verticalCenter
181
191
Common.StatusImage {
182
192
id: sof_statusImage
183
194
iconName: "yellow.png"
185
196
anchors.verticalCenter: parent.verticalCenter
192
anchors.verticalCenter: parent.verticalCenter
197
199
id: sof_bitButton
200
202
hoverimage: "green1.png"
201
203
text: root.btn_text
202
205
anchors.verticalCenter: parent.verticalCenter
207
resetBtn.visible = false;
204
208
if(root.sof_check_flag)
208
212
software_signal("SoftwareWork");
209
213
if(root.sof_null_flag == true) {
210
214
root.state = "SoftwareWorkEmpty";
211
sessiondispatcher.send_warningdialog_msg("友情提示:","扫描内容为空,不再执行清理!");
216
sessiondispatcher.showWarningDialog("友情提示:","扫描内容为空,不再执行清理!", mainwindow.pos.x, mainwindow.pos.y);
213
218
else if(root.sof_null_flag == false)
214
220
root.state = "SoftwareWork";
222
toolkits.alertMSG("扫描完成!", mainwindow.pos.x, mainwindow.pos.y);
216
225
else if (sof_btn_flag == "software_work") {
217
226
systemdispatcher.clean_file_cruft_qt(systemdispatcher.get_software_args(), "software");
221
sessiondispatcher.send_warningdialog_msg("友情提示:","对不起,您没有选择需要清理的项,请确认!");
228
//// hoverimage: "scan-start.png"
232
// anchors.verticalCenter: parent.verticalCenter
234
// if(root.sof_check_flag)
237
// if (sof_btn_flag == "software_scan") {
238
// software_signal("SoftwareWork");
239
// if(root.sof_null_flag == true) {
240
// root.state = "SoftwareWorkEmpty";
241
// sessiondispatcher.send_warningdialog_msg("友情提示:","扫描内容为空,不再执行清理!");
243
// else if(root.sof_null_flag == false)
244
// root.state = "SoftwareWork";
246
// else if (sof_btn_flag == "software_work") {
247
// systemdispatcher.clean_file_cruft_qt(systemdispatcher.get_software_args(), "software");
248
//// sessiondispatcher.clean_file_cruft_qt(systemdispatcher.get_software_args(), "software");
252
// sessiondispatcher.send_warningdialog_msg("友情提示:","对不起,您没有选择需要清理的项,请确认!");
231
sessiondispatcher.showWarningDialog("友情提示:","对不起,您没有选择需要清理的项,请确认!", mainwindow.pos.x, mainwindow.pos.y);
238
iconName: "revoke.png"
240
anchors.verticalCenter: parent.verticalCenter
242
resetBtn.visible = false;
243
sof_subModel.clear();
244
root.state = "SoftwareWorkAGAIN";
265
257
width: parent.width - 4
271
// id: listViewDelegate
274
// property alias expandedItemCount: subItemRepeater.count
277
// height: headerItemRect.height + subItemsRect.height
280
// //checkbox, picture and words
282
// id: headerItemRect
285
// height: root.itemHeight
291
// fillMode: "PreserveAspectFit"
292
// height: parent.height*0.9
298
// id: status_update_content
300
// anchors.verticalCenter: parent.verticalCenter
303
// font.pointSize: 11
317
// fillMode: "PreserveAspectFit"
318
//// height: parent.height*0.3
323
// source: root.arrow
324
// //当鼠标点击后,箭头图片旋转90度
325
//// rotation: expanded ? 90 : 0
326
// rotation: expanded ? 0 : -180
330
// anchors.fill: parent
332
// expanded = !expanded
340
// property int itemHeight: root.itemHeight
341
// y: headerItemRect.height
343
// //当高度需要扩展时,根据expandedItemCount数目和itemHeight高度去扩展
344
// height: expanded ? delegate.expandedItemCount * itemHeight : 0
347
// Behavior on height {
348
// SequentialAnimation {
349
// NumberAnimation { duration: 100; easing.type: Easing.InOutQuad }
356
// id: subItemRepeater
357
// model: sof_subModel
358
// width: subItemsRect.width
361
// split_status: true
363
// height: subItemsRect.itemHeight
364
//// text: subItemTitle
368
// checkbox_status: root.sof_check_flag
369
//// bgImage: "../../img/icons/list_subitem.png"
371
// fontName: root.subItemFontName
372
// fontSize: root.subItemFontSize
373
// fontColor: root.subItemFontColor
376
// btn_flag: root.sof_btn_flag
388
261
Common.ScrollArea {
390
263
anchors.top: sof_titlebar.bottom
391
anchors.topMargin: 30
392
height: root.height -sof_titlebar.height - 50
264
anchors.topMargin: 20//30
265
anchors.left:parent.left
266
anchors.leftMargin: 27
267
height: root.height -sof_titlebar.height - 37//50
268
width: parent.width - 27 -2
395
270
width: parent.width
396
271
height: (root.sof_num + 1) * 40 //450 + //this height must be higher than root.height, then the slidebar can display
400
275
height: parent.height
401
276
model: sof_mainModel
402
277
delegate: Cleardelegate{
403
sub_num: sof_sub_num;sub_model: sof_subModel;btn_flag: sof_btn_flag
278
sub_num: sof_sub_num;sub_model: sof_subModel;btn_flag: sof_btn_flag;arrow_display:deleget_arrow;
404
279
delegate_flag: true
405
280
onSubpressed: {root.sof_num=hMark}
406
281
onCheckchanged: {root.sof_check_flag=checkchange}
423
298
name: "SoftwareWork"
424
PropertyChanges { target: sof_label; visible: true; text: "software扫描完成"}
425
PropertyChanges { target: sof_bitButton; /*hoverimage: "clear-start.png"*/text:"开始清理" }
299
PropertyChanges { target: sof_bitButton; text:"开始清理" }
426
300
PropertyChanges { target: root; sof_btn_flag: "software_work" }
301
PropertyChanges { target: sof_statusImage; visible: true; iconName: "yellow.png"; text: "未完成"}
304
name: "SoftwareWorkAGAIN"
305
PropertyChanges { target: sof_bitButton; text:"开始扫描" }
306
PropertyChanges { target: root; sof_btn_flag: "software_scan" }
307
PropertyChanges { target: sof_statusImage; visible: false }
310
name: "SoftwareWorkError"
311
PropertyChanges { target: sof_bitButton; text:"开始扫描" }
312
PropertyChanges { target: root; sof_btn_flag: "software_scan" }
313
PropertyChanges { target: sof_statusImage; visible: true; iconName: "red.png"; text: "出现异常"}
429
316
name: "SoftwareWorkFinish"
430
PropertyChanges { target: sof_label; visible: true; text: root.sof_work_result + "清理完毕!" }
431
PropertyChanges { target: sof_bitButton; /*hoverimage: "scan-start.png"*/text:"开始扫描" }
317
PropertyChanges { target: sof_bitButton; text:"开始扫描" }
432
318
PropertyChanges { target: root; sof_btn_flag: "software_scan" }
433
PropertyChanges { target: sof_statusImage; iconName: "green.png"; text: "已完成"}
319
PropertyChanges { target: sof_statusImage; visible: true; iconName: "green.png"; text: "已完成"}
436
322
name: "SoftwareWorkEmpty"
437
PropertyChanges { target: sof_label; visible: true; text: "扫描内容为空,不再执行清理!" }
438
PropertyChanges { target: sof_bitButton; /*hoverimage: "scan-start.png"*/text:"开始扫描" }
323
PropertyChanges { target: sof_bitButton; text:"开始扫描" }
439
324
PropertyChanges { target: root; sof_btn_flag: "software_scan" }
440
PropertyChanges { target: sof_statusImage; iconName: "green.png"; text: "已完成"}
325
PropertyChanges { target: sof_statusImage; visible: false}