Check the service status at GUI startup
This commit is contained in:
parent
a74ccff6ab
commit
b25292582c
1 changed files with 9 additions and 5 deletions
|
@ -31,12 +31,16 @@ Page {
|
||||||
"empty": qsTr("empty", "Battery fully depleted"),
|
"empty": qsTr("empty", "Battery fully depleted"),
|
||||||
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
||||||
}
|
}
|
||||||
property bool settingsPagePushed: false
|
|
||||||
|
|
||||||
onStatusChanged: {
|
Timer {
|
||||||
if(status == PageStatus.Active && !settingsPagePushed) {
|
id: startupTimer
|
||||||
|
interval: 250
|
||||||
|
repeat: false
|
||||||
|
running: true
|
||||||
|
onTriggered: {
|
||||||
|
console.log("Startup timer started")
|
||||||
|
daemonStatus.start("/bin/systemctl", ["--user", "status", "harbour-batterybuddy.service"])
|
||||||
pageStack.pushAttached(Qt.resolvedUrl("SettingsPage.qml"))
|
pageStack.pushAttached(Qt.resolvedUrl("SettingsPage.qml"))
|
||||||
settingsPagePushed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +208,7 @@ Page {
|
||||||
daemonControlTimer.start()
|
daemonControlTimer.start()
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
enabled: true
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue