+ Component.onCompleted: {
+ SettingsStorage.initialize();
+
+ var address = SettingsStorage.getSetting("address");
+ var port = SettingsStorage.getSetting("port");
+ if(address !== "Unknown" && port !== "Unknown"){
+ console.log("Loaded address " + address + " and port " + port + " from DB.")
+ addressField.text = address
+ portField.text = port
+ }
+ }
+
+ states: [
+ State {
+ name: "active"
+ PropertyChanges {
+ target: cursorRectangle
+ x: moveArea.x + (moveArea.width * 0.5) + btConn.x - (cursorRectangle.width * 0.5)
+ y: moveArea.y + (moveArea.height * 0.5) + btConn.y - (cursorRectangle.height * 0.5)
+ }
+ PropertyChanges {
+ target: labelA
+ color: btConn.a ? "red" : "blue"
+ }
+ PropertyChanges {
+ target: labelB
+ color: btConn.b ? "red" : "blue"
+ }
+ PropertyChanges {
+ target: labelC
+ color: btConn.c ? "red" : "blue"
+ }
+ PropertyChanges {
+ target: labelD
+ color: btConn.d ? "red" : "blue"
+ }
+ },
+ State {
+ name: "inactive"
+ PropertyChanges {
+ target: cursorRectangle
+ x: moveArea.x + (moveArea.width * 0.5) - (cursorRectangle.width * 0.5)
+ y: moveArea.y + (moveArea.height * 0.5) - (cursorRectangle.height * 0.5)
+ }
+ PropertyChanges {
+ target: labelA
+ color: "blue"
+ }
+ PropertyChanges {
+ target: labelB
+ color: "blue"
+ }
+ PropertyChanges {
+ target: labelC
+ color: "blue"
+ }
+ PropertyChanges {
+ target: labelD
+ color: "blue"
+ }
+ }
+
+ ]
+
+ Connections {
+ target: platformWindow
+
+ onActiveChanged: {
+ if(platformWindow.active){
+ state = "active"
+ }else{
+ state = "inactive"
+ }
+ }
+ }
+