Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions WindowsAppDataManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ find_package(Qt${QT_VERSION_MAJOR}
Qml
Quick
QuickControls2
QuickDialogs2
REQUIRED
)
qt_standard_project_setup()
Expand Down Expand Up @@ -49,6 +50,10 @@ set(BACKEND_SOURCES
src/platform/windows/registry/InstalledApplicationRegistry.h
src/services/ScanService.cpp
src/services/ScanService.h
src/services/CleanupPlanBuilder.cpp
src/services/CleanupPlanBuilder.h
src/services/ScanReportExporter.cpp
src/services/ScanReportExporter.h
src/services/SettingsService.cpp
src/services/SettingsService.h
)
Expand All @@ -68,7 +73,9 @@ if(QT_VERSION_MAJOR EQUAL 6)
rules/schema.json
rules/builtin/chrome.json
rules/builtin/chromium.json
rules/builtin/microsoft-edge.json
rules/builtin/discord.json
rules/builtin/obs-studio.json
rules/builtin/vscode.json
rules/builtin/jetbrains.json
rules/builtin/windows-temp.json
Expand Down Expand Up @@ -111,6 +118,8 @@ if(QT_VERSION VERSION_GREATER_EQUAL 6.2)
components/EmptyState.qml
components/InlineNotice.qml
components/ScanProgressStrip.qml
components/ScanIssuesDialog.qml
components/CleanupPlanDialog.qml
components/OverviewStats.qml
components/DispositionSummary.qml
components/OverviewApplicationList.qml
Expand Down Expand Up @@ -192,6 +201,7 @@ target_link_libraries(${PROJECT_NAME}
Qt::Qml
Qt::Quick
Qt::QuickControls2
Qt::QuickDialogs2
)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/qmlmodels
Expand Down Expand Up @@ -228,9 +238,7 @@ endif()

if(WIN32 AND QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::windeployqt)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E env
"PATH=$<TARGET_FILE_DIR:Qt6::windeployqt>;$ENV{PATH}"
$<TARGET_FILE:Qt6::windeployqt>
COMMAND $<TARGET_FILE:Qt6::windeployqt>
$<IF:$<CONFIG:Debug>,--debug,--release>
--qmldir "${CMAKE_CURRENT_SOURCE_DIR}"
--no-translations
Expand Down
198 changes: 198 additions & 0 deletions WindowsAppDataManager/components/CleanupPlanDialog.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
pragma ComponentBehavior: Bound

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Dialog {
id: dialog

property var items: []
property string totalText: "0 B"

modal: true
focus: true
width: Math.min(760, parent ? parent.width - 56 : 760)
height: Math.min(640, parent ? parent.height - 72 : 640)
x: parent ? Math.round((parent.width - width) / 2) : 0
y: parent ? Math.round((parent.height - height) / 2) : 0
padding: 0
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside

background: Rectangle {
radius: Theme.radiusLarge
color: Theme.surface
border.width: 1
border.color: Theme.border
}

header: Rectangle {
implicitHeight: 58
color: Theme.surface

RowLayout {
anchors.fill: parent
anchors.leftMargin: 18
anchors.rightMargin: 8
spacing: 10

Rectangle {
Layout.preferredWidth: 30
Layout.preferredHeight: 30
radius: Theme.radiusSmall
color: Theme.greenSoft

ThemedIcon {
anchors.centerIn: parent
width: 16
height: 16
source: Qt.resolvedUrl("../resources/Icons/IcBaselineCleaningServices.svg")
color: Theme.greenText
}
}

ColumnLayout {
Layout.fillWidth: true
spacing: 0

Text {
text: "清理计划"
color: Theme.textPrimary
font.pixelSize: 15
font.weight: Font.DemiBold
}

Text {
text: dialog.items.length + " 项候选,合计 " + dialog.totalText
color: Theme.textMuted
font.pixelSize: 10
}
}

IconButton {
iconSource: Qt.resolvedUrl("../resources/Icons/TablerX.svg")
tooltip: "关闭"
onClicked: dialog.close()
}
}
}

contentItem: ColumnLayout {
spacing: 0

Rectangle { Layout.fillWidth: true; Layout.preferredHeight: 1; color: Theme.divider }

Rectangle {
Layout.fillWidth: true
Layout.margins: 16
Layout.bottomMargin: 10
implicitHeight: previewNotice.implicitHeight + 16
radius: Theme.radiusSmall
color: Theme.accentSoft

Text {
id: previewNotice
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 8
text: "这是只读预览,不会删除任何文件。仅列出规则明确、可重新生成,且风险为安全或低风险的数据。"
color: Theme.accentText
font.pixelSize: 11
wrapMode: Text.WordWrap
}
}

ListView {
id: planList

Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.bottomMargin: 14
clip: true
spacing: 8
model: dialog.items
ScrollBar.vertical: ScrollBar { }

delegate: Rectangle {
id: planRow

required property var modelData
width: planList.width
height: planContent.implicitHeight + 18
radius: Theme.radiusMedium
color: Theme.surfaceRaised
border.width: 1
border.color: Theme.border

Column {
id: planContent
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 10
spacing: 6

RowLayout {
width: parent.width
spacing: 8

Text {
Layout.fillWidth: true
text: planRow.modelData.applicationName + " · "
+ planRow.modelData.categoryText
color: Theme.textPrimary
font.pixelSize: 12
font.weight: Font.DemiBold
elide: Text.ElideRight
}

Text {
text: planRow.modelData.sizeText
color: Theme.textPrimary
font.pixelSize: 11
font.weight: Font.Medium
}

RiskBadge {
level: planRow.modelData.riskLevel
label: planRow.modelData.riskText
}
}

Text {
width: parent.width
text: planRow.modelData.impact
color: Theme.textSecondary
font.pixelSize: 10
wrapMode: Text.WordWrap
}

PathField {
width: parent.width
label: "路径"
value: planRow.modelData.path
}

Text {
width: parent.width
text: "依据 " + planRow.modelData.ruleSource
color: Theme.textMuted
font.pixelSize: 10
elide: Text.ElideRight
}
}
}

Text {
anchors.centerIn: parent
visible: planList.count === 0
text: "当前没有符合安全边界的可重建数据。"
color: Theme.textMuted
font.pixelSize: 12
}
}
}
}
21 changes: 21 additions & 0 deletions WindowsAppDataManager/components/DataCategoryRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Rectangle {

required property var rowData
property bool expanded: false
readonly property int unknownRiskLevel: 5

function toggleExpanded() {
expanded = !expanded
Expand Down Expand Up @@ -151,6 +152,26 @@ Rectangle {
font.pixelSize: 10
elide: Text.ElideRight
}

Rectangle {
width: parent.width
height: unknownExplanation.implicitHeight + 14
visible: categoryRow.rowData.riskLevel === categoryRow.unknownRiskLevel
radius: Theme.radiusSmall
color: Theme.neutralSoft

Text {
id: unknownExplanation
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 7
text: "为什么暂时不能判断:当前只获得目录名称或路径特征,缺少足够的应用归属证据。该项已被读取,但不代表可以安全处理。"
color: Theme.textSecondary
font.pixelSize: 10
wrapMode: Text.WordWrap
}
}
}

Behavior on height {
Expand Down
31 changes: 31 additions & 0 deletions WindowsAppDataManager/components/InlineNotice.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Rectangle {
Expand All @@ -11,8 +12,11 @@ Rectangle {
property url actionIconSource
property string actionTooltip: ""
property bool actionVisible: false
property string detailActionText: ""
property bool detailActionVisible: false

signal actionRequested()
signal detailActionRequested()

implicitHeight: 44
radius: Theme.radiusSmall
Expand Down Expand Up @@ -40,6 +44,33 @@ Rectangle {
elide: Text.ElideMiddle
}

Button {
id: detailAction

visible: notice.detailActionVisible
text: notice.detailActionText
hoverEnabled: true
padding: 0
font.pixelSize: 11
font.weight: Font.DemiBold

contentItem: Text {
text: detailAction.text
color: notice.accent
font.pixelSize: 11
font.weight: Font.DemiBold
verticalAlignment: Text.AlignVCenter
}

background: Rectangle {
radius: Theme.radiusSmall
color: detailAction.down ? Theme.surfaceSelected
: detailAction.hovered ? Theme.surfaceHover : "transparent"
}

onClicked: notice.detailActionRequested()
}

IconButton {
visible: notice.actionVisible
iconSource: notice.actionIconSource
Expand Down
Loading