forked from Shinonome/dots-hyprland
quickshell polkit agent
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Polkit
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
property alias agent: polkitAgent
|
||||
property alias active: polkitAgent.isActive
|
||||
property alias flow: polkitAgent.flow
|
||||
property bool interactionAvailable: false
|
||||
|
||||
function cancel() {
|
||||
root.flow.cancelAuthenticationRequest()
|
||||
}
|
||||
|
||||
function submit(string) {
|
||||
root.flow.submit(string)
|
||||
root.interactionAvailable = false
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.flow
|
||||
function onAuthenticationFailed() {
|
||||
root.interactionAvailable = true;
|
||||
}
|
||||
}
|
||||
|
||||
PolkitAgent {
|
||||
id: polkitAgent
|
||||
onAuthenticationRequestStarted: {
|
||||
root.interactionAvailable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,6 @@ Singleton {
|
||||
signal contentLoaded(var data)
|
||||
|
||||
function reread() { // Proper reload in case the file was incorrect before
|
||||
print("rereading translations for", translationReader.languageCode);
|
||||
translationReader.path = "";
|
||||
translationReader.path = `${translationReader.translationsDir}/${translationReader.languageCode}.json`;
|
||||
translationReader.reload();
|
||||
|
||||
Reference in New Issue
Block a user