diff --git a/kstars/indi/clientmanagerlite.h b/kstars/indi/clientmanagerlite.h --- a/kstars/indi/clientmanagerlite.h +++ b/kstars/indi/clientmanagerlite.h @@ -108,7 +108,7 @@ /** Do actions when async Web Manager requests are finished */ Q_INVOKABLE void webManagerReplyFinished(); - Q_INVOKABLE TelescopeLite *getTelescope(const QString &deviceName); + Q_INVOKABLE TelescopeLite *getTelescope(); QString connectedHost() { return m_connectedHost; } void setConnectedHost(const QString &connectedHost); @@ -222,6 +222,8 @@ void connectedChanged(bool); void telescopeAdded(TelescopeLite *newTelescope); void telescopeRemoved(TelescopeLite *delTelescope); + void telescopeConnected(TelescopeLite *telescope); + void telescopeDisconnected(); void lastUsedServerChanged(); void lastUsedPortChanged(); @@ -251,6 +253,7 @@ std::unique_ptr webMStartProfileReply; /// Web Manager profiles QStringList webMProfiles; + TelescopeLite *m_telescope { nullptr }; #ifdef ANDROID QString defaultImageType; QString defaultImagesLocation; diff --git a/kstars/indi/clientmanagerlite.cpp b/kstars/indi/clientmanagerlite.cpp --- a/kstars/indi/clientmanagerlite.cpp +++ b/kstars/indi/clientmanagerlite.cpp @@ -46,7 +46,7 @@ #include "libraw/libraw.h" #endif -DeviceInfoLite::DeviceInfoLite(INDI::BaseDevice *dev) : device(dev), telescope(nullptr) +DeviceInfoLite::DeviceInfoLite(INDI::BaseDevice *dev) : device(dev) { } @@ -284,11 +284,11 @@ } } -TelescopeLite *ClientManagerLite::getTelescope(const QString &deviceName) +TelescopeLite *ClientManagerLite::getTelescope() { for (auto& devInfo : m_devices) { - if (devInfo->device->getDeviceName() == deviceName) + if (devInfo->telescope.get()) { return devInfo->telescope.get(); } @@ -906,6 +906,13 @@ { devInfo->telescope.reset(new TelescopeLite(devInfo->device)); emit telescopeAdded(devInfo->telescope.get()); + // The connected signal must be emitted for already connected scopes otherwise + // the motion control page remains disabled. + if (devInfo->telescope->isConnected()) + { + emit deviceConnected(devInfo->telescope->getDeviceName(), true); + emit telescopeConnected(devInfo->telescope.get()); + } } } @@ -1149,6 +1156,15 @@ if (QString(sw->name) == QString("CONNECT")) { emit deviceConnected(svp->device, sw->s == ISS_ON); + if (m_telescope->getDeviceName() == svp->device) + { + if (sw->s == ISS_ON) + { + emit telescopeConnected(m_telescope); + } else { + emit telescopeDisconnected(); + } + } } if (sw != nullptr) { diff --git a/kstars/indi/inditelescopelite.h b/kstars/indi/inditelescopelite.h --- a/kstars/indi/inditelescopelite.h +++ b/kstars/indi/inditelescopelite.h @@ -68,7 +68,7 @@ INDI::BaseDevice *getDevice() { return baseDevice; } //deviceName QString getDeviceName() { return m_deviceName; } - void setDeviceName(QString deviceName); + void setDeviceName(const QString &deviceName); bool isSlewDecreasable() { return m_slewDecreasable; } bool isSlewIncreasable() { return m_slewIncreasable; } @@ -78,7 +78,7 @@ void setSlewDecreasable(bool slewDecreasable); void setSlewIncreasable(bool slewIncreasable); - void setSlewRateLabel(QString slewRateLabel); + void setSlewRateLabel(const QString &slewRateLabel); Q_INVOKABLE bool decreaseSlewRate(); Q_INVOKABLE bool increaseSlewRate(); @@ -103,6 +103,7 @@ bool getEqCoords(double *ra, double *dec); void setAltLimits(double minAltitude, double maxAltitude); Q_INVOKABLE bool isConnected() { return baseDevice->isConnected(); } + Q_INVOKABLE QStringList getSlewRateLabels() { return m_slewRateLabels; }; protected: bool sendCoords(SkyPoint *ScopeTarget); @@ -112,14 +113,15 @@ bool park(); bool unPark(); bool setSlewRate(int index); - void updateSlewRate(QString deviceName, QString propName); + void updateSlewRate(const QString &deviceName, const QString &propName); signals: void slewDecreasableChanged(bool); void slewIncreasableChanged(bool); void slewRateLabelChanged(QString); void deviceNameChanged(QString); void newTelescopeLiteCreated(TelescopeLite *); + void slewRateUpdate(int index, int count); private: SkyPoint currentCoord; @@ -133,4 +135,5 @@ bool m_slewDecreasable { false }; bool m_slewIncreasable { false }; QString m_slewRateLabel; + QStringList m_slewRateLabels; }; diff --git a/kstars/indi/inditelescopelite.cpp b/kstars/indi/inditelescopelite.cpp --- a/kstars/indi/inditelescopelite.cpp +++ b/kstars/indi/inditelescopelite.cpp @@ -27,7 +27,7 @@ connect(clientManager, &ClientManagerLite::newINDISwitch, this, &TelescopeLite::updateSlewRate); } -void TelescopeLite::updateSlewRate(QString deviceName, QString propName) +void TelescopeLite::updateSlewRate(const QString &deviceName, const QString &propName) { if (deviceName == baseDevice->getDeviceName() && propName == "TELESCOPE_SLEW_RATE") { @@ -41,6 +41,12 @@ break; } } + m_slewRateLabels.clear(); + for (int i = 0; i < slewRateSP->nsp; ++i) + { + m_slewRateLabels.push_back(slewRateSP->sp[i].label); + } + emit slewRateUpdate(index, m_slewRateLabels.size()); setSlewRate(index); } } @@ -67,16 +73,16 @@ } } -void TelescopeLite::setSlewRateLabel(QString slewRateLabel) +void TelescopeLite::setSlewRateLabel(const QString &slewRateLabel) { if (m_slewRateLabel != slewRateLabel) { m_slewRateLabel = slewRateLabel; emit slewRateLabelChanged(slewRateLabel); } } -void TelescopeLite::setDeviceName(QString deviceName) +void TelescopeLite::setDeviceName(const QString &deviceName) { if (m_deviceName != deviceName) { @@ -552,6 +558,14 @@ motionSouth->s = ISS_ON; } + if (cmd == MOTION_STOP) + { + if (dir == MOTION_NORTH) + motionNorth->s = ISS_OFF; + else + motionSouth->s = ISS_OFF; + } + clientManager->sendNewSwitch(motionSP); return true; @@ -587,6 +601,14 @@ motionEast->s = ISS_ON; } + if (cmd == MOTION_STOP) + { + if (dir == MOTION_WEST) + motionWest->s = ISS_OFF; + else + motionEast->s = ISS_OFF; + } + clientManager->sendNewSwitch(motionSP); return true; diff --git a/kstars/kstarslite.h b/kstars/kstarslite.h --- a/kstars/kstarslite.h +++ b/kstars/kstarslite.h @@ -167,7 +167,7 @@ /** @} */ // end of kconfigwrappers group - signals: +signals: /** Sent when KStarsData finishes loading data */ void dataLoadFinished(); @@ -216,7 +216,7 @@ /** start tracking clickedPoint or stop tracking if we are already tracking some object **/ void slotTrack(); - private slots: +private slots: /** finish setting up after the KStarsData has finished */ void datainitFinished(); diff --git a/kstars/kstarslite.cpp b/kstars/kstarslite.cpp --- a/kstars/kstarslite.cpp +++ b/kstars/kstarslite.cpp @@ -25,6 +25,7 @@ #include "skymaplite.h" #include "version.h" #include "indi/clientmanagerlite.h" +#include "indi/inditelescopelite.h" #include "kstarslite/imageprovider.h" #include "kstarslite/dialogs/finddialoglite.h" #include "kstarslite/dialogs/detaildialoglite.h" @@ -103,6 +104,19 @@ m_RootObject = m_Engine.rootObjects()[0]; m_clientManager->setIndiControlPage(*m_RootObject->findChild("indiControlPanel")); + connect(m_clientManager, &ClientManagerLite::telescopeConnected, + [=](TelescopeLite *telescope) { + m_RootObject->findChild("bottomMenu")->setProperty("telescope", true); + connect(telescope, &TelescopeLite::slewRateUpdate, + [=](int index, int count) { + m_RootObject->findChild("bottomMenu")->setProperty("slewCount", count); + m_RootObject->findChild("bottomMenu")->setProperty("sliderValue", index); + } ); + } ); + connect(m_clientManager, &ClientManagerLite::telescopeDisconnected, + [=]() { + m_RootObject->findChild("bottomMenu")->setProperty("telescope", false); + } ); // Set the About information QObject *aboutDialog = m_RootObject->findChild("aboutDialog"); diff --git a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml --- a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml +++ b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml @@ -95,7 +95,7 @@ text: editMode ? xi18n("Save") : xi18n("Add") onClicked: { if(descField.text == "" || urlField.text == "") { - notification.showNotification(xi18n("Please, fill in URL and Description")) + skyMapLite.notification.showNotification(xi18n("Please, fill in URL and Description")) return } diff --git a/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml b/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml --- a/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml +++ b/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml @@ -41,7 +41,7 @@ loadingText = fetchingCoordinatesLoading if(!positionSource.valid) { positionSource.stop() - notification.showNotification(xi18("Positioning is not available on your device")) + skyMapLite.notification.showNotification(xi18("Positioning is not available on your device")) } } @@ -66,21 +66,21 @@ var province = xi18n("Default province") var country = xi18n("Default country") if(addAutomatically) { - notification.showNotification(xi18n("Could not fetch location name (check your Internet connection). Added with default name")) + skyMapLite.notification.showNotification(xi18n("Could not fetch location name (check your Internet connection). Added with default name")) if(!LocationDialogLite.addCity(city, province, country, lat, lng, tz, "--")) { - notification.showNotification(xi18n("Failed to set location")) + skyMapLite.notification.showNotification(xi18n("Failed to set location")) return } if(LocationDialogLite.setLocation(city + ", " + province + ", " + country)) { - notification.showNotification(xi18n("Successfully set your location")) + skyMapLite.notification.showNotification(xi18n("Successfully set your location")) } else { - notification.showNotification(xi18n("Could not set your location")) + skyMapLite.notification.showNotification(xi18n("Could not set your location")) } } else { - notification.showNotification(xi18n("Could not fetch location name (check your Internet connection). Set default name")) + skyMapLite.notification.showNotification(xi18n("Could not fetch location name (check your Internet connection). Set default name")) cityField.text = city provinceField.text = province countryField.text = country @@ -100,13 +100,13 @@ if(!LocationDialogLite.addCity(city, region, country, lat, lng, tz, "--")) { - notification.showNotification(xi18n("Failed to set location")) + skyMapLite.notification.showNotification(xi18n("Failed to set location")) } if(LocationDialogLite.setLocation(city + ", " + region + ", " + country)) { - notification.showNotification(xi18n("Successfully set your location")) + skyMapLite.notification.showNotification(xi18n("Successfully set your location")) } else { - notification.showNotification(xi18n("Could not set your location")) + skyMapLite.notification.showNotification(xi18n("Could not set your location")) } addAutomatically = false @@ -157,14 +157,14 @@ errorDesc = xi18n("Unknown error occurred. Please contact the application developer.") } - notification.showNotification(errorDesc) + skyMapLite.notification.showNotification(errorDesc) positionSource.stop() error = true locationLoading.close() } onUpdateTimeout: { - notification.showNotification(xi18n("Timeout occurred. Try again.")) + skyMapLite.notification.showNotification(xi18n("Timeout occurred. Try again.")) locationLoading.close() } @@ -179,7 +179,7 @@ onPositionChanged: { if(isLoaded) { - notification.showNotification(xi18n("Found your longitude and altitude")) + skyMapLite.notification.showNotification(xi18n("Found your longitude and altitude")) var lat = positionSource.position.coordinate.latitude var lng = positionSource.position.coordinate.longitude latField.text = lat @@ -364,7 +364,7 @@ loadingText = fetchingCoordinatesLoading if(!positionSource.valid) { positionSource.stop() - notification.showNotification(xi18("Positioning is not available on your device")) + skyMapLite.notification.showNotification(xi18("Positioning is not available on your device")) } } @@ -382,27 +382,27 @@ text: editMode ? xi18n("Save") : xi18n("Add") onClicked: { if(cityField.text == "") { - notification.showNotification(xi18n("Please, fill in the city")) + skyMapLite.notification.showNotification(xi18n("Please, fill in the city")) return } else if(countryField.text == "") { - notification.showNotification(xi18n("Please, fill in the country")) + skyMapLite.notification.showNotification(xi18n("Please, fill in the country")) return } else if(latField.text == "") { - notification.showNotification(xi18n("Please, fill in the latitude")) + skyMapLite.notification.showNotification(xi18n("Please, fill in the latitude")) return } else if(longField.text == "") { - notification.showNotification(xi18n("Please, fill in the longitude")) + skyMapLite.notification.showNotification(xi18n("Please, fill in the longitude")) return } if(!LocationDialogLite.checkLongLat(longField.text, latField.text)) { - notification.showNotification(xi18n("Either the longitude or the latitude values are not valid")) + skyMapLite.notification.showNotification(xi18n("Either the longitude or the latitude values are not valid")) return } if(fieldsChanged) { if(LocationDialogLite.isDuplicate(cityField.text, provinceField.text, countryField.text)) { - notification.showNotification(xi18n("This location already exists. Change either the city, the province or the country")) + skyMapLite.notification.showNotification(xi18n("This location already exists. Change either the city, the province or the country")) return } } @@ -418,16 +418,16 @@ if(!LocationDialogLite.addCity(cityField.text, provinceField.text, countryField.text, latField.text, longField.text, comboBoxTZ.currentText, comboBoxDST.currentText)) { - notification.showNotification(xi18n("Failed to add location")) + skyMapLite.notification.showNotification(xi18n("Failed to add location")) return } else { - notification.showNotification(xi18n("Added new location - %1", fullName)) + skyMapLite.notification.showNotification(xi18n("Added new location - %1", fullName)) } } else { if(!LocationDialogLite.editCity(geoName, cityField.text, provinceField.text, countryField.text, latField.text, longField.text, comboBoxTZ.currentText, comboBoxDST.currentText)) { - notification.showNotification(xi18n("Failed to edit city")) + skyMapLite.notification.showNotification(xi18n("Failed to edit city")) return } } diff --git a/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml b/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml --- a/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml +++ b/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml @@ -65,9 +65,9 @@ text: xi18n("Set as my location") onTriggered: { if(LocationDialogLite.setLocation(locName)) { - notification.showNotification(xi18n("Set %1 as the current location", locName)) + skyMapLite.notification.showNotification(xi18n("Set %1 as the current location", locName)) } else { - notification.showNotification(xi18n("Could not set as the current location", locName)) + skyMapLite.notification.showNotification(xi18n("Could not set as the current location", locName)) } locationDialog.filterCities() } @@ -89,7 +89,7 @@ text: xi18n("Delete") onTriggered: { LocationDialogLite.deleteCity(locName) - notification.showNotification(xi18n("Deleted location %1", locName)) + skyMapLite.notification.showNotification(xi18n("Deleted location %1", locName)) locationDialog.filterCities() } } diff --git a/kstars/kstarslite/qml/images/CMakeLists.txt b/kstars/kstarslite/qml/images/CMakeLists.txt --- a/kstars/kstarslite/qml/images/CMakeLists.txt +++ b/kstars/kstarslite/qml/images/CMakeLists.txt @@ -155,5 +155,13 @@ lock-open.png lock-open@2x.png lock-open@3x.png - lock-open@4x.png + lock-open@4x.png + telescope-down.png + telescope-down@2x.png + telescope-up.png + telescope-up@2x.png + telescope-left.png + telescope-left@2x.png + telescope-right.png + telescope-right@2x.png DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/images ) diff --git a/kstars/kstarslite/qml/images/telescope-down.png b/kstars/kstarslite/qml/images/telescope-down.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-down@2x.png b/kstars/kstarslite/qml/images/telescope-down@2x.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-left.png b/kstars/kstarslite/qml/images/telescope-left.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-left@2x.png b/kstars/kstarslite/qml/images/telescope-left@2x.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-right.png b/kstars/kstarslite/qml/images/telescope-right.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-right@2x.png b/kstars/kstarslite/qml/images/telescope-right@2x.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-up.png b/kstars/kstarslite/qml/images/telescope-up.png new file mode 100644 diff --git a/kstars/kstarslite/qml/images/telescope-up@2x.png b/kstars/kstarslite/qml/images/telescope-up@2x.png new file mode 100644 diff --git a/kstars/kstarslite/qml/indi/INDIControlPanel.qml b/kstars/kstarslite/qml/indi/INDIControlPanel.qml --- a/kstars/kstarslite/qml/indi/INDIControlPanel.qml +++ b/kstars/kstarslite/qml/indi/INDIControlPanel.qml @@ -45,7 +45,7 @@ stackView.pop(indiPage) } devicesModel.clear() - notification.showNotification("Disconnected from the server") + skyMapLite.notification.showNotification("Disconnected from the server") } } @@ -220,9 +220,9 @@ onClicked: { if (!indiPage.connected) { if(ClientManagerLite.setHost(ipHost.text, parseInt(portHost.text))) { - notification.showNotification(xi18n("Successfully connected to the server")) + skyMapLite.notification.showNotification(xi18n("Successfully connected to the server")) } else { - notification.showNotification(xi18n("Could not connect to the server")) + skyMapLite.notification.showNotification(xi18n("Could not connect to the server")) } } else { @@ -260,7 +260,7 @@ ListModel { id: devicesModel - } + } Connections { target: ClientManagerLite @@ -279,7 +279,7 @@ } } onNewINDIMessage: { - notification.showNotification(message) + skyMapLite.notification.showNotification(message) } } } diff --git a/kstars/kstarslite/qml/indi/modules/MotionControl.qml b/kstars/kstarslite/qml/indi/modules/MotionControl.qml --- a/kstars/kstarslite/qml/indi/modules/MotionControl.qml +++ b/kstars/kstarslite/qml/indi/modules/MotionControl.qml @@ -27,20 +27,16 @@ enabled: buttonsEnabled property string deviceName - property var telescope: ClientManagerLite.getTelescope(deviceName) - property bool buttonsEnabled: telescope.isConnected() + property var telescope: ClientManagerLite.getTelescope() + property bool buttonsEnabled: ClientManagerLite.getTelescope().isConnected() Connections { target: ClientManagerLite onDeviceConnected: { - if(motionCColumn.deviceName == deviceName) { - buttonsEnabled = isConnected - } + buttonsEnabled = ClientManagerLite.getTelescope().isConnected() } onTelescopeAdded: { - if(newTelescope.getDeviceName() === motionCColumn.deviceName) { - telescope = newTelescope - } + telescope = newTelescope } } diff --git a/kstars/kstarslite/qml/main.qml b/kstars/kstarslite/qml/main.qml --- a/kstars/kstarslite/qml/main.qml +++ b/kstars/kstarslite/qml/main.qml @@ -118,18 +118,6 @@ initialItem: initPage } - PassiveNotification { - z: 2 - id: notification - - Connections { - target: KStarsLite - onNotificationMessage: { - notification.showNotification(msg) - } - } - } - Units { id: units } diff --git a/kstars/kstarslite/qml/modules/BottomMenu.qml b/kstars/kstarslite/qml/modules/BottomMenu.qml --- a/kstars/kstarslite/qml/modules/BottomMenu.qml +++ b/kstars/kstarslite/qml/modules/BottomMenu.qml @@ -13,15 +13,19 @@ import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Universal 2.0 - import QtQuick.Window 2.2 + +import TelescopeLiteEnums 1.0 import "../constants" 1.0 import "helpers" ColumnLayout { id: bottomMenu objectName: "bottomMenu" property int padding: 10 + property bool telescope: false + property int slewCount: 1 + property alias sliderValue: slider.value property double openOffset: bottomMenu.height - bottomBar.background.radius //Hide bottom round corners property double closedOffset: arrowUp.height + padding @@ -126,6 +130,40 @@ } } + RowLayout { + anchors { + bottom: bottomBar.top + horizontalCenter: parent.horizontalCenter + } + visible: bottomMenu.telescope + + Slider { + id: slider + value: 0 + stepSize: 1 + from: 1 + to: bottomMenu.slewCount-1 + wheelEnabled: false + snapMode: Slider.SnapOnRelease + + onValueChanged: { + slewLabel.text = ClientManagerLite.getTelescope().getSlewRateLabels()[slider.value] + } + + onPressedChanged: { + if (slider.pressed) return + + ClientManagerLite.getTelescope().setSlewRate(slider.value) + } + } + + KSLabel { + id: slewLabel + width: 100 + text: "" + } + } + Pane { id: bottomBar anchors.horizontalCenter: parent.horizontalCenter @@ -165,6 +203,30 @@ right: parent.right } + BottomMenuButton { + id: telescopeLeft + iconSrc: "../../images/telescope-left.png" + visible: bottomMenu.telescope + onPressed: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_WEST, TelescopeCommand.MOTION_STOP) + } + } + + BottomMenuButton { + id: telescopeDown1 + iconSrc: "../../images/telescope-down.png" + visible: bottomMenu.telescope && menuGrid.rows == 1 + onPressed: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_STOP) + } + } + BottomMenuButton { id: goBackwards iconSrc: "../../images/media-skip-backward.png" @@ -223,39 +285,64 @@ RowLayout { anchors.right: parent.right - BottomMenuButton { - onClicked: { - stackView.push(timePage) + + BottomMenuButton { + onClicked: { + stackView.push(timePage) + } + visible: isWindowWidthSmall + + iconSrc: "../../images/appointment-new.png" } - visible: isWindowWidthSmall - iconSrc: "../../images/appointment-new.png" - } + Rectangle { + id: separatorSearchSmall + height: decreaseUnitLandscape.height*0.75 + color: Num.sysPalette.shadow + width: 1 + visible: isWindowWidthSmall + } - Rectangle { - id: separatorSearchSmall - height: decreaseUnitLandscape.height*0.75 - color: Num.sysPalette.shadow - width: 1 - visible: isWindowWidthSmall - } + BottomMenuButton { + onClicked: { + stackView.push(findDialog) + } + visible: isWindowWidthSmall - BottomMenuButton { - onClicked: { - stackView.push(findDialog) + iconSrc: "../../images/edit-find.png" } - visible: isWindowWidthSmall - iconSrc: "../../images/edit-find.png" - } + BottomMenuButton { + id: telescopeRight1 + iconSrc: "../../images/telescope-right.png" + visible: bottomMenu.telescope && menuGrid.rows == 2 + onPressed: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_STOP) + } + } } } RowLayout { id: secondRow Layout.fillHeight: true Layout.fillWidth: true + BottomMenuButton { + id: telescopeDown2 + iconSrc: "../../images/telescope-down.png" + visible: bottomMenu.telescope && menuGrid.rows == 2 + onPressed: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_SOUTH, TelescopeCommand.MOTION_STOP) + } + } + BottomMenuButton { onClicked: { timeSpinBox.decreaseTimeUnit() @@ -321,6 +408,30 @@ iconSrc: "../../images/edit-find.png" } + + BottomMenuButton { + id: telescopeUp + iconSrc: "../../images/telescope-up.png" + visible: bottomMenu.telescope + onPressed: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveNS(TelescopeNS.MOTION_NORTH, TelescopeCommand.MOTION_STOP) + } + } + + BottomMenuButton { + id: telescopeRight2 + iconSrc: "../../images/telescope-right.png" + visible: bottomMenu.telescope && menuGrid.rows == 1 + onPressed: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_START) + } + onClicked: { + ClientManagerLite.getTelescope().moveWE(TelescopeNS.MOTION_EAST, TelescopeCommand.MOTION_STOP) + } + } } } } diff --git a/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml b/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml --- a/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml +++ b/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml @@ -10,12 +10,15 @@ import QtQuick 2.6 import QtQuick.Controls 2.0 + import "../constants" 1.0 +import "helpers" import "tutorial" Item { id: skyMapLiteItem visible: isLoaded + property alias notification: notification Rectangle { id: skyMapLiteWrapper @@ -150,6 +153,24 @@ } } + PassiveNotification { + z: 2 + height: 10 + id: notification + visible: true + anchors { + bottom: bottomMenu.top + horizontalCenter: parent.horizontalCenter + } + + Connections { + target: KStarsLite + onNotificationMessage: { + skyMapLite.notification.showNotification(msg) + } + } + } + BottomMenu { id: bottomMenu } diff --git a/kstars/kstarslite/qml/modules/TimePage.qml b/kstars/kstarslite/qml/modules/TimePage.qml --- a/kstars/kstarslite/qml/modules/TimePage.qml +++ b/kstars/kstarslite/qml/modules/TimePage.qml @@ -546,7 +546,7 @@ onClicked: { var date = new Date(userYear, userMonth, userDay, userHour, userMinutes) KStarsLite.slotSetTime(date) - notification.showNotification("Setting time to " + date) + skyMapLite.notification.showNotification("Setting time to " + date) stackView.pop() } } @@ -561,7 +561,7 @@ onClicked: { var date = new Date(userYear, userMonth, userDay, userHour, userMinutes) KStarsLite.slotSetTime(date) - notification.showNotification("Setting time to " + date) + skyMapLite.notification.showNotification("Setting time to " + date) stackView.pop() } } diff --git a/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml b/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml --- a/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml +++ b/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml @@ -32,15 +32,15 @@ if(isLoaded) { //Disable while loading if(toggled) { if(titlePlural) { - notification.showNotification(xi18n("%1 are toggled on", title)) + skyMapLite.notification.showNotification(xi18n("%1 are toggled on", title)) } else { - notification.showNotification(xi18n("%1 is toggled on", title)) + skyMapLite.notification.showNotification(xi18n("%1 is toggled on", title)) } } else { if(titlePlural) { - notification.showNotification(xi18n("%1 are toggled off", title)) + skyMapLite.notification.showNotification(xi18n("%1 are toggled off", title)) } else { - notification.showNotification(xi18n("%1 is toggled off", title)) + skyMapLite.notification.showNotification(xi18n("%1 is toggled off", title)) } } } diff --git a/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml b/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml --- a/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml +++ b/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml @@ -84,7 +84,7 @@ var item = colorsModel.get(colorsList.currentIndex) KStarsLite.loadColorScheme(formatColorScheme(item.scheme)); - notification.showNotification("Set color scheme to " + item.name) + skyMapLite.notification.showNotification("Set color scheme to " + item.name) colorSchemeChanged() close() diff --git a/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml b/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml --- a/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml +++ b/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml @@ -57,7 +57,7 @@ onClicked: { var item = projModel.get(projList.currentIndex) KStarsLite.setProjection(item.proj) - notification.showNotification("Set projection system to " + skyMapLite.notification.showNotification("Set projection system to " + item.name) close() }