This commit is contained in:
Domipoke
2026-06-25 19:58:23 +02:00
parent 372c622025
commit 955801c666
147 changed files with 18829 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
import QtQuick
import Quickshell
import Quickshell.Services.Polkit
import qs.Commons
Item {
id: root
property var pluginApi: null
PolkitAgent {
id: agent
onIsActiveChanged: {
if (isActive) {
openWindow()
} else {
closeWindow()
}
}
}
property var window: null
function openWindow() {
if (agent.flow === null) {
Logger.w("polkit-agent: Cannot open window, agent.flow is null");
return;
}
if (window === null) {
var component = Qt.createComponent("PolkitWindow.qml");
if (component.status === Component.Ready) {
window = component.createObject(root, {
flow: agent.flow,
pluginApi: root.pluginApi
});
if (window !== null) {
window.visible = true;
}
}
component.destroy();
} else {
window.flow = agent.flow;
window.pluginApi = root.pluginApi;
window.visible = true;
}
}
function closeWindow() {
if (window !== null) {
window.destroy();
window = null;
}
}
}