summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-29 19:24:13 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-29 19:24:13 (GMT)
commit41aa2eb88d2a550ac83b8af970d3f1882d7e7b0c (patch)
tree9481f37e7d9e57327887bc2c3c1a4f293152ed7e
parent2e6113a63d9ea43b36e4f79172c71374243e3468 (diff)
Do not enable Align module if there is no scope
-rw-r--r--kstars/ekos/ekosmanager.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index c2514da..213c0bc 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -779,7 +779,11 @@ void EkosManager::deviceConnected()
if (dev->getBaseDevice()->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE)
{
if (mountProcess)
+ {
mountProcess->setEnabled(true);
+ if (alignProcess)
+ alignProcess->setEnabled(true);
+ }
}
else if (dev->getBaseDevice()->getDriverInterface() & INDI::BaseDevice::CCD_INTERFACE)
{
@@ -788,7 +792,12 @@ void EkosManager::deviceConnected()
if (focusProcess)
focusProcess->setEnabled(true);
if (alignProcess)
- alignProcess->setEnabled(true);
+ {
+ if (mountProcess && mountProcess->isEnabled())
+ alignProcess->setEnabled(true);
+ else
+ alignProcess->setEnabled(false);
+ }
if (guideProcess)
guideProcess->setEnabled(true);
}
@@ -931,7 +940,6 @@ void EkosManager::setCCD(ISD::GDInterface *ccdDevice)
if (rc == false && primaryCCD.isEmpty() == false)
focusProcess->setCCD(primaryCCD);
-
initAlign();
alignProcess->addCCD(ccdDevice);
@@ -1273,7 +1281,7 @@ void EkosManager::processTabChange()
{
if (alignProcess->isEnabled() == false && captureProcess->isEnabled())
{
- if (managedDevices[KSTARS_CCD]->isConnected() && alignProcess->isParserOK())
+ if (managedDevices[KSTARS_CCD]->isConnected() && managedDevices.contains(KSTARS_TELESCOPE) && alignProcess->isParserOK())
alignProcess->setEnabled(true);
}
@@ -1428,6 +1436,7 @@ void EkosManager::initAlign()
return;
alignProcess = new Ekos::Align();
+ alignProcess->setEnabled(false);
int index = toolsWidget->addTab( alignProcess, QIcon(":/icons/ekos_align.png"), "");
toolsWidget->tabBar()->setTabToolTip(index, i18n("Align"));
connect(alignProcess, SIGNAL(newLog()), this, SLOT(updateLog()));