feat: 恢复完整功能,包含D-Bus通信和QML界面
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import org.deepin.ds 1.0
|
||||
|
||||
ContainmentItem {
|
||||
@@ -13,6 +14,8 @@ ContainmentItem {
|
||||
implicitHeight: 56
|
||||
property int dockOrder: 20
|
||||
|
||||
property var applet: Applet
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#3498db"
|
||||
@@ -24,5 +27,127 @@ ContainmentItem {
|
||||
font.pixelSize: 14
|
||||
color: "white"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
popup.visible = !popup.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: popup
|
||||
x: 0
|
||||
y: -popup.height - 10
|
||||
width: 300
|
||||
height: 400
|
||||
closePolicy: Popup.CloseOnPressOutside
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
text: "Graphics Driver Manager"
|
||||
font.pixelSize: 16
|
||||
font.bold: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: "#ccc"
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
title: "Device Information"
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 8
|
||||
|
||||
Text {
|
||||
text: "Current Driver: " + (root.applet ? root.applet.currentDriver || "Unknown" : "Unknown")
|
||||
font.pixelSize: 12
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Device Info: " + (root.applet ? root.applet.deviceInfo || "Unknown" : "Unknown")
|
||||
font.pixelSize: 12
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Refresh"
|
||||
Layout.fillWidth: true
|
||||
onClicked: {
|
||||
if (root.applet) {
|
||||
root.applet.refreshDeviceInfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Test Install"
|
||||
Layout.fillWidth: true
|
||||
enabled: root.applet && !root.applet.isInstalling
|
||||
onClicked: {
|
||||
if (root.applet) {
|
||||
root.applet.testInstall()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
visible: root.applet && root.applet.isInstalling
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
|
||||
Text {
|
||||
text: "Installing... " + (root.applet ? root.applet.installProgress + "%" : "0%")
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
Layout.fillWidth: true
|
||||
value: root.applet ? root.applet.installProgress / 100 : 0
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Cancel"
|
||||
Layout.fillWidth: true
|
||||
onClicked: {
|
||||
if (root.applet) {
|
||||
root.applet.cancelInstall()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.applet
|
||||
function onInstallSuccess() {
|
||||
console.log("Install succeeded")
|
||||
}
|
||||
function onInstallFailed(error) {
|
||||
console.log("Install failed:", error)
|
||||
}
|
||||
function onRequestReboot() {
|
||||
console.log("Reboot requested")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user