summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lancaster <rlancaste@gmail.com>2016-11-03 08:52:18 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-03 08:52:18 (GMT)
commit87e676a61853d60a85dd4a92cadd80b56c7f11d0 (patch)
treeb4ebd0171f548e0f6c4927c42a6ce01381117a1d
parent65d0badca750abcdb352a6703d89a4935c59b7fd (diff)
OSX bundle fixes
-rw-r--r--kstars/ekos/opsekos.cpp12
-rw-r--r--kstars/indi/devicemanager.cpp2
-rw-r--r--kstars/indi/drivermanager.cpp2
-rw-r--r--kstars/indi/indidriver.cpp2
-rw-r--r--kstars/indi/opsindi.cpp10
-rw-r--r--kstars/indi/servermanager.cpp10
-rw-r--r--kstars/kstarsactions.cpp76
-rw-r--r--kstars/skycomponents/constellationartcomponent.cpp4
8 files changed, 102 insertions, 16 deletions
diff --git a/kstars/ekos/opsekos.cpp b/kstars/ekos/opsekos.cpp
index 9e0dd8e..d63a115 100644
--- a/kstars/ekos/opsekos.cpp
+++ b/kstars/ekos/opsekos.cpp
@@ -34,12 +34,24 @@ OpsEkos::OpsEkos()
#ifdef Q_OS_OSX
connect(solverInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal()));
solverInternal->setToolTip(i18n("Internal or External Plate Solver."));
+if(Options::astrometrySolverIsInternal()){
+ solverInternal->setChecked(true);
+ kcfg_astrometrySolver->setEnabled(false);
+}
connect(configInternal, SIGNAL(clicked()), this, SLOT(toggleConfigInternal()));
configInternal->setToolTip(i18n("Internal or External Astrometry.cfg."));
+if(Options::astrometryConfFileIsInternal()){
+ configInternal->setChecked(true);
+ kcfg_astrometryConfFile->setEnabled(false);
+}
connect(wcsInternal, SIGNAL(clicked()), this, SLOT(toggleWCSInternal()));
wcsInternal->setToolTip(i18n("Internal or External WCS Info."));
+if(Options::wcsIsInternal()){
+ wcsInternal->setChecked(true);
+ kcfg_astrometryWCSInfo->setEnabled(false);
+}
#else
solverInternal->setVisible(false);
configInternal->setVisible(false);
diff --git a/kstars/indi/devicemanager.cpp b/kstars/indi/devicemanager.cpp
index 2ac90b5..d7ad148 100644
--- a/kstars/indi/devicemanager.cpp
+++ b/kstars/indi/devicemanager.cpp
@@ -86,7 +86,7 @@ void DeviceManager::startServer()
return;
}
#ifdef Q_OS_OSX
- if(Options::indiServer()=="*Internal INDI Server*")
+ if(Options::indiServerIsInternal())
*serverProcess << QCoreApplication::applicationDirPath()+"/indi/indiserver";
else
#endif
diff --git a/kstars/indi/drivermanager.cpp b/kstars/indi/drivermanager.cpp
index 9d8a768..a7030de 100644
--- a/kstars/indi/drivermanager.cpp
+++ b/kstars/indi/drivermanager.cpp
@@ -953,7 +953,7 @@ bool DriverManager::readXMLDrivers()
QString driversDir=Options::indiDriversDir();
#ifdef Q_OS_OSX
- if(driversDir=="*Internal INDI Drivers*")
+ if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi";
#endif
diff --git a/kstars/indi/indidriver.cpp b/kstars/indi/indidriver.cpp
index ae7da0f..cda61e4 100644
--- a/kstars/indi/indidriver.cpp
+++ b/kstars/indi/indidriver.cpp
@@ -499,7 +499,7 @@ bool INDIDriver::readXMLDrivers()
QString driversDir=Options::indiDriversDir();
#ifdef Q_OS_OSX
- if(driversDir=="*Internal INDI Drivers*")
+ if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi";
#endif
diff --git a/kstars/indi/opsindi.cpp b/kstars/indi/opsindi.cpp
index 823a968..15e3845 100644
--- a/kstars/indi/opsindi.cpp
+++ b/kstars/indi/opsindi.cpp
@@ -50,6 +50,16 @@ OpsINDI::OpsINDI()
indiInternal->setToolTip(i18n("Internal or External INDI Server."));
connect(driversInternal, SIGNAL(clicked()), this, SLOT(toggleDriversInternal()));
driversInternal->setToolTip(i18n("Internal or External INDI Drivers."));
+
+ if(Options::indiServerIsInternal()){
+ indiInternal->setChecked(true);
+ kcfg_indiServer->setEnabled(false);
+ }
+ if(Options::indiDriversAreInternal()){
+ driversInternal->setChecked(true);
+ kcfg_indiDriversDir->setEnabled(false);
+ }
+
#else
indiInternal->setVisible(false);
driversInternal->setVisible(false);
diff --git a/kstars/indi/servermanager.cpp b/kstars/indi/servermanager.cpp
index 1a1826e..c9da9c6 100644
--- a/kstars/indi/servermanager.cpp
+++ b/kstars/indi/servermanager.cpp
@@ -75,10 +75,10 @@ bool ServerManager::start()
serverProcess = new QProcess(this);
#ifdef Q_OS_OSX
QString driversDir=Options::indiDriversDir();
- if(driversDir=="*Internal INDI Drivers*")
+ if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi";
QString indiServerDir=Options::indiServer();
- if(indiServerDir=="*Internal INDI Server*")
+ if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
@@ -117,7 +117,7 @@ bool ServerManager::start()
serverProcess->setReadChannel(QProcess::StandardError);
#ifdef Q_OS_OSX
- if(Options::indiServer()=="*Internal INDI Server*")
+ if(Options::indiServerIsInternal())
serverProcess->start(QCoreApplication::applicationDirPath()+"/indi/indiserver", args);
else
#endif
@@ -174,9 +174,9 @@ bool ServerManager::startDriver(DriverInfo *dv)
#ifdef Q_OS_OSX
- if(driversDir=="*Internal INDI Drivers*")
+ if(Options::indiServerIsInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi";
- if(indiServerDir=="*Internal INDI Server*")
+ if(Options::indiDriversAreInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
diff --git a/kstars/kstarsactions.cpp b/kstars/kstarsactions.cpp
index 1c2fef3..3c69387 100644
--- a/kstars/kstarsactions.cpp
+++ b/kstars/kstarsactions.cpp
@@ -529,10 +529,25 @@ void KStars::slotTelescopeWizard()
{
#ifdef HAVE_INDI
#ifndef Q_OS_WIN
+
+ QString indiServerDir=Options::indiServer();
+
+ #ifdef Q_OS_OSX
+ if(Options::indiServerIsInternal())
+ indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
+ else if(indiServerDir.length()>10)
+ indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
+ #endif
+
+ QStringList paths;
+ paths << "/usr/bin" << "/usr/local/bin" << indiServerDir;
+
if (QStandardPaths::findExecutable("indiserver").isEmpty())
{
- KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
- return;
+ if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
+ KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
+ return;
+ }
}
#endif
@@ -546,10 +561,25 @@ void KStars::slotINDIPanel()
{
#ifdef HAVE_INDI
#ifndef Q_OS_WIN
+
+ QString indiServerDir=Options::indiServer();
+
+ #ifdef Q_OS_OSX
+ if(Options::indiServerIsInternal())
+ indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
+ else if(indiServerDir.length()>10)
+ indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
+ #endif
+
+ QStringList paths;
+ paths << "/usr/bin" << "/usr/local/bin" << indiServerDir;
+
if (QStandardPaths::findExecutable("indiserver").isEmpty())
{
- KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
- return;
+ if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
+ KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
+ return;
+ }
}
#endif
GUIManager::Instance()->updateStatus();
@@ -560,10 +590,25 @@ void KStars::slotINDIDriver()
{
#ifdef HAVE_INDI
#ifndef Q_OS_WIN
+
+ QString indiServerDir=Options::indiServer();
+
+ #ifdef Q_OS_OSX
+ if(Options::indiServerIsInternal())
+ indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
+ else if(indiServerDir.length()>10)
+ indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
+ #endif
+
+ QStringList paths;
+ paths << "/usr/bin" << "/usr/local/bin" << indiServerDir;
+
if (QStandardPaths::findExecutable("indiserver").isEmpty())
{
- KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
- return;
+ if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
+ KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
+ return;
+ }
}
#endif
@@ -580,10 +625,25 @@ void KStars::slotEkos()
#ifdef HAVE_INDI
#ifndef Q_OS_WIN
+
+ QString indiServerDir=Options::indiServer();
+
+ #ifdef Q_OS_OSX
+ if(Options::indiServerIsInternal())
+ indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
+ else if(indiServerDir.length()>10)
+ indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
+ #endif
+
+ QStringList paths;
+ paths << "/usr/bin" << "/usr/local/bin" << indiServerDir;
+
if (QStandardPaths::findExecutable("indiserver").isEmpty())
{
- KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
- return;
+ if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
+ KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
+ return;
+ }
}
#endif
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index 5635e0b..93fadc9 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -50,7 +50,11 @@ void ConstellationArtComponent::deleteData()
void ConstellationArtComponent::loadData(){
if(m_ConstList.isEmpty()) {
QSqlDatabase skydb = QSqlDatabase::addDatabase("QSQLITE", "skycultures");
+ #ifdef Q_OS_OSX
+ QString dbfile = KSPaths::locate(QStandardPaths::GenericDataLocation, "/skycultures/skycultures.sqlite");
+ #else
QString dbfile = KSPaths::locate(QStandardPaths::GenericDataLocation, "skycultures.sqlite");
+ #endif
skydb.setDatabaseName(dbfile);
if (skydb.open() == false)