Changeset View
Changeset View
Standalone View
Standalone View
kstars/kstarslite/qml/indi/modules/MotionControl.qml
Show All 21 Lines | 21 | anchors { | |||
---|---|---|---|---|---|
22 | fill: parent | 22 | fill: parent | ||
23 | margins: Num.marginsKStab | 23 | margins: Num.marginsKStab | ||
24 | } | 24 | } | ||
25 | spacing: 5 * Num.dp | 25 | spacing: 5 * Num.dp | ||
26 | 26 | | |||
27 | enabled: buttonsEnabled | 27 | enabled: buttonsEnabled | ||
28 | 28 | | |||
29 | property string deviceName | 29 | property string deviceName | ||
30 | property var telescope: ClientManagerLite.getTelescope(deviceName) | 30 | property var telescope: ClientManagerLite.getTelescope() | ||
31 | property bool buttonsEnabled: telescope.isConnected() | 31 | property bool buttonsEnabled: ClientManagerLite.getTelescope().isConnected() | ||
32 | 32 | | |||
33 | Connections { | 33 | Connections { | ||
34 | target: ClientManagerLite | 34 | target: ClientManagerLite | ||
35 | onDeviceConnected: { | 35 | onDeviceConnected: { | ||
36 | if(motionCColumn.deviceName == deviceName) { | 36 | buttonsEnabled = ClientManagerLite.getTelescope().isConnected() | ||
37 | buttonsEnabled = isConnected | | |||
38 | } | | |||
39 | } | 37 | } | ||
40 | onTelescopeAdded: { | 38 | onTelescopeAdded: { | ||
41 | if(newTelescope.getDeviceName() === motionCColumn.deviceName) { | | |||
42 | telescope = newTelescope | 39 | telescope = newTelescope | ||
43 | } | 40 | } | ||
44 | } | 41 | } | ||
45 | } | | |||
46 | 42 | | |||
47 | //Row 1 | 43 | //Row 1 | ||
48 | RowLayout { | 44 | RowLayout { | ||
49 | Layout.fillHeight: true | 45 | Layout.fillHeight: true | ||
50 | anchors { | 46 | anchors { | ||
51 | left: parent.left | 47 | left: parent.left | ||
52 | right: parent.right | 48 | right: parent.right | ||
53 | } | 49 | } | ||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |