5import QtQuick.Window 2.2
6import QtQuick.Controls 2.0
7import QtQuick.Layouts 1.2
8import Qt.labs.settings 1.0
10import "../constants" 1.0
14 objectName:
"indiControlPanel"
15 title:
xi18n(
"INDI Control Panel")
18 property alias webMStatusText: webMStatusLabel.text
19 property alias webMStatusTextVisible: webMStatusLabel.visible
20 property alias webMActiveProfileText: webMActiveProfileLabel.text
21 property alias webMActiveProfileLayoutVisible: webMActiveProfileLayout.visible
22 property alias webMBrowserButtonVisible: webMBrowserButton.visible
23 property alias webMProfileListVisible: webMProfileList.visible
25 function connectIndiServer() {
26 indiServerConnectButton.clicked()
29 Component.onCompleted: {
35 if (!indiPage.connected) {
36 for (var i = 0; i < devicesModel.count; ++i) {
37 devicesModel.get(i).panel.destroy()
38 stackView.pop(indiPage)
41 skyMapLite.notification.showNotification(
"Disconnected from the server")
51 visible: !indiPage.connected
58 text:
xi18n(
"IP Address or Hostname")
69 placeholderText:
xi18n(
"xxx.xxx.xxx.xxx")
70 Layout.alignment:
Qt.AlignHCenter
71 Layout.maximumWidth: parent.width*0.8
72 Layout.fillWidth: true
73 font.capitalization: Font.AllLowercase
79 property alias ipHostText : ipHost.text
85 text:
xi18n(
"Web Manager Port")
96 placeholderText:
xi18n(
"xxxx")
97 Layout.alignment:
Qt.AlignHCenter
98 Layout.maximumWidth: parent.width*0.2
99 Layout.fillWidth: true
105 property alias portWebManagerText : portWebManager.text
110 id: webMConnectButton
111 text:
xi18n(
"Get Status")
115 Qt.inputMethod.hide()
122 text:
xi18n(
"Web Manager Status:")
127 id: webMActiveProfileLayout
131 id: webMActiveProfileLabel
132 text:
xi18n(
"Active Profile:")
147 model: webMProfileModel
148 highlightFollowsCurrentItem:
false
150 height: childrenRect.height
153 delegate: RowLayout {
154 height: webMConnectButton.height
157 width: webMStatusLabel.width
158 height: webMConnectButton.height
160 text:
xi18n(
"Profile: %1", modelData)
165 height: webMConnectButton.height
176 id: webMBrowserButton
177 text:
xi18n(
"Manage Profiles")
181 Qt.openUrlExternally(
"http://"+ipHost.text+
":"+portWebManager.text)
186 text:
xi18n(
"Server Port")
197 placeholderText:
xi18n(
"INDI Server Port")
198 Layout.alignment:
Qt.AlignHCenter
199 Layout.maximumWidth: parent.width*0.2
200 Layout.fillWidth: true
206 property alias portHostText : portHost.text
211 id: indiServerConnectButton
212 text: indiPage.connected ?
xi18n(
"Disconnect") :
xi18n(
"Connect")
215 if (!indiPage.connected) {
216 if(ClientManagerLite.setHost(ipHost.text, parseInt(portHost.text))) {
217 skyMapLite.notification.showNotification(xi18n(
"Successfully connected to the server"))
219 skyMapLite.notification.showNotification(xi18n(
"Could not connect to the server"))
225 Qt.inputMethod.hide()
234 visible: indiPage.connected
240 Layout.fillHeight:
true
241 Layout.fillWidth:
true
242 visible: indiPage.connected
245 Layout.fillWidth:
true
252 text:
xi18n(
"Available Devices")
262 var component =
Qt.createComponent(
Qt.resolvedUrl(
"./DevicePanel.qml"));
263 var devicePanel = component.createObject(window);
264 devicePanel.deviceName = deviceName
265 devicesModel.append({
name: deviceName, panel: devicePanel })
267 onRemoveINDIDevice: {
268 for (i = 0; i < devicesModel.count; ++i) {
269 if(devicesModel.get(i).name == deviceName) {
270 devicesModel.panel.destroy()
271 devicesModel.remove(i)
276 skyMapLite.notification.showNotification(message)
283 Layout.fillHeight:
true
284 Layout.fillWidth:
true
290 stackView.push(devicesModel.get(currentIndex).panel)
297 visible: indiPage.connected
298 text:
xi18n(
"Disconnect INDI");
Q_INVOKABLE void getWebManagerProfiles(const QString &ip, unsigned int port)
Get the profiles from Web Manager.
Q_INVOKABLE void startWebManagerProfile(const QString &profile)
Start an INDI server with a Web Manager profile.
Q_INVOKABLE void stopWebManagerProfile()
Stop the INDI server with an active Web Manager profile.
QString xi18n(const char *text, const TYPE &arg...)
QString name(GameStandardAction id)
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)