(self, total_stats, detail_lines)
| 1453 | self.setWarninginfo(f"打开失败:{e}") |
| 1454 | |
| 1455 | def show_preview_dialog(self, total_stats, detail_lines): |
| 1456 | # 清理前预览,不再一点开始就直接进回收站。 |
| 1457 | preview_text = self.build_preview_text(total_stats, detail_lines) |
| 1458 | try: |
| 1459 | with open(PREVIEW_PATH, "w", encoding="utf-8") as f: |
| 1460 | f.write(preview_text + "\n\n") |
| 1461 | f.write("详细文件列表:\n") |
| 1462 | f.write("\n".join(detail_lines)) |
| 1463 | except Exception: |
| 1464 | logging.exception("写入扫描预览失败") |
| 1465 | |
| 1466 | dialog = QDialog(self) |
| 1467 | dialog.setWindowTitle("确认清理") |
| 1468 | dialog.setMinimumSize(820, 560) |
| 1469 | dialog.setStyleSheet(""" |
| 1470 | QDialog { |
| 1471 | background-color: #edf7f1; |
| 1472 | font-family: "Microsoft YaHei", "Segoe UI", sans-serif; |
| 1473 | color: #21352b; |
| 1474 | } |
| 1475 | QLabel#previewTitle { |
| 1476 | color: #21352b; |
| 1477 | font-size: 22px; |
| 1478 | font-weight: 700; |
| 1479 | } |
| 1480 | QLabel#previewSubtitle { |
| 1481 | color: #5e7468; |
| 1482 | font-size: 13px; |
| 1483 | } |
| 1484 | QLabel#previewCard { |
| 1485 | color: #395246; |
| 1486 | background-color: #f8fbf7; |
| 1487 | border: 1px solid #dcebe1; |
| 1488 | border-radius: 14px; |
| 1489 | padding: 12px 14px; |
| 1490 | font-size: 13px; |
| 1491 | } |
| 1492 | QTableWidget { |
| 1493 | background-color: #f8fbf7; |
| 1494 | border: 1px solid #dcebe1; |
| 1495 | border-radius: 14px; |
| 1496 | gridline-color: #e2eee6; |
| 1497 | color: #31483d; |
| 1498 | font-size: 12px; |
| 1499 | selection-background-color: #e8f6ed; |
| 1500 | selection-color: #21352b; |
| 1501 | } |
| 1502 | QTableWidget::item { |
| 1503 | padding: 4px 6px; |
| 1504 | } |
| 1505 | QHeaderView::section { |
| 1506 | background-color: #e8f6ed; |
| 1507 | color: #486256; |
| 1508 | border: 0; |
| 1509 | border-bottom: 1px solid #d3e4d8; |
| 1510 | padding: 8px; |
| 1511 | font-size: 12px; |
| 1512 | font-weight: 600; |
no test coverage detected