Commit 87e676a6 authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

OSX bundle fixes

parent 65d0badc
...@@ -34,12 +34,24 @@ OpsEkos::OpsEkos() ...@@ -34,12 +34,24 @@ OpsEkos::OpsEkos()
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
connect(solverInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal())); connect(solverInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal()));
solverInternal->setToolTip(i18n("Internal or External Plate Solver.")); 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())); connect(configInternal, SIGNAL(clicked()), this, SLOT(toggleConfigInternal()));
configInternal->setToolTip(i18n("Internal or External Astrometry.cfg.")); 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())); connect(wcsInternal, SIGNAL(clicked()), this, SLOT(toggleWCSInternal()));
wcsInternal->setToolTip(i18n("Internal or External WCS Info.")); wcsInternal->setToolTip(i18n("Internal or External WCS Info."));
if(Options::wcsIsInternal()){
wcsInternal->setChecked(true);
kcfg_astrometryWCSInfo->setEnabled(false);
}
#else #else
solverInternal->setVisible(false); solverInternal->setVisible(false);
configInternal->setVisible(false); configInternal->setVisible(false);
......
...@@ -86,7 +86,7 @@ void DeviceManager::startServer() ...@@ -86,7 +86,7 @@ void DeviceManager::startServer()
return; return;
} }
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
if(Options::indiServer()=="*Internal INDI Server*") if(Options::indiServerIsInternal())
*serverProcess << QCoreApplication::applicationDirPath()+"/indi/indiserver"; *serverProcess << QCoreApplication::applicationDirPath()+"/indi/indiserver";
else else
#endif #endif
......
...@@ -953,7 +953,7 @@ bool DriverManager::readXMLDrivers() ...@@ -953,7 +953,7 @@ bool DriverManager::readXMLDrivers()
QString driversDir=Options::indiDriversDir(); QString driversDir=Options::indiDriversDir();
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
if(driversDir=="*Internal INDI Drivers*") if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi"; driversDir=QCoreApplication::applicationDirPath()+"/indi";
#endif #endif
......
...@@ -499,7 +499,7 @@ bool INDIDriver::readXMLDrivers() ...@@ -499,7 +499,7 @@ bool INDIDriver::readXMLDrivers()
QString driversDir=Options::indiDriversDir(); QString driversDir=Options::indiDriversDir();
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
if(driversDir=="*Internal INDI Drivers*") if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi"; driversDir=QCoreApplication::applicationDirPath()+"/indi";
#endif #endif
......
...@@ -50,6 +50,16 @@ OpsINDI::OpsINDI() ...@@ -50,6 +50,16 @@ OpsINDI::OpsINDI()
indiInternal->setToolTip(i18n("Internal or External INDI Server.")); indiInternal->setToolTip(i18n("Internal or External INDI Server."));
connect(driversInternal, SIGNAL(clicked()), this, SLOT(toggleDriversInternal())); connect(driversInternal, SIGNAL(clicked()), this, SLOT(toggleDriversInternal()));
driversInternal->setToolTip(i18n("Internal or External INDI Drivers.")); 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 #else
indiInternal->setVisible(false); indiInternal->setVisible(false);
driversInternal->setVisible(false); driversInternal->setVisible(false);
......
...@@ -75,10 +75,10 @@ bool ServerManager::start() ...@@ -75,10 +75,10 @@ bool ServerManager::start()
serverProcess = new QProcess(this); serverProcess = new QProcess(this);
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
QString driversDir=Options::indiDriversDir(); QString driversDir=Options::indiDriversDir();
if(driversDir=="*Internal INDI Drivers*") if(Options::indiDriversAreInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi"; driversDir=QCoreApplication::applicationDirPath()+"/indi";
QString indiServerDir=Options::indiServer(); QString indiServerDir=Options::indiServer();
if(indiServerDir=="*Internal INDI Server*") if(Options::indiServerIsInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi"; indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10) else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10); indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
...@@ -117,7 +117,7 @@ bool ServerManager::start() ...@@ -117,7 +117,7 @@ bool ServerManager::start()
serverProcess->setReadChannel(QProcess::StandardError); serverProcess->setReadChannel(QProcess::StandardError);
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
if(Options::indiServer()=="*Internal INDI Server*") if(Options::indiServerIsInternal())
serverProcess->start(QCoreApplication::applicationDirPath()+"/indi/indiserver", args); serverProcess->start(QCoreApplication::applicationDirPath()+"/indi/indiserver", args);
else else
#endif #endif
...@@ -174,9 +174,9 @@ bool ServerManager::startDriver(DriverInfo *dv) ...@@ -174,9 +174,9 @@ bool ServerManager::startDriver(DriverInfo *dv)
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
if(driversDir=="*Internal INDI Drivers*") if(Options::indiServerIsInternal())
driversDir=QCoreApplication::applicationDirPath()+"/indi"; driversDir=QCoreApplication::applicationDirPath()+"/indi";
if(indiServerDir=="*Internal INDI Server*") if(Options::indiDriversAreInternal())
indiServerDir=QCoreApplication::applicationDirPath()+"/indi"; indiServerDir=QCoreApplication::applicationDirPath()+"/indi";
else if(indiServerDir.length()>10) else if(indiServerDir.length()>10)
indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10); indiServerDir=Options::indiServer().mid(0,Options::indiServer().length()-10);
......
...@@ -529,10 +529,25 @@ void KStars::slotTelescopeWizard() ...@@ -529,10 +529,25 @@ void KStars::slotTelescopeWizard()
{ {
#ifdef HAVE_INDI #ifdef HAVE_INDI
#ifndef Q_OS_WIN #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()) 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.")); if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
return; KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
return;
}
} }
#endif #endif
...@@ -546,10 +561,25 @@ void KStars::slotINDIPanel() ...@@ -546,10 +561,25 @@ void KStars::slotINDIPanel()
{ {
#ifdef HAVE_INDI #ifdef HAVE_INDI
#ifndef Q_OS_WIN #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()) 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.")); if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
return; KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
return;
}
} }
#endif #endif
GUIManager::Instance()->updateStatus(); GUIManager::Instance()->updateStatus();
...@@ -560,10 +590,25 @@ void KStars::slotINDIDriver() ...@@ -560,10 +590,25 @@ void KStars::slotINDIDriver()
{ {
#ifdef HAVE_INDI #ifdef HAVE_INDI
#ifndef Q_OS_WIN #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()) 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.")); if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
return; KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
return;
}
} }
#endif #endif
...@@ -580,10 +625,25 @@ void KStars::slotEkos() ...@@ -580,10 +625,25 @@ void KStars::slotEkos()
#ifdef HAVE_INDI #ifdef HAVE_INDI
#ifndef Q_OS_WIN #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()) 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.")); if(QStandardPaths::findExecutable("indiserver",paths).isEmpty()){
return; KMessageBox::error(NULL, i18n("Unable to find INDI server. Please make sure the package that provides the 'indiserver' binary is installed."));
return;
}
} }
#endif #endif
......
...@@ -50,7 +50,11 @@ void ConstellationArtComponent::deleteData() ...@@ -50,7 +50,11 @@ void ConstellationArtComponent::deleteData()
void ConstellationArtComponent::loadData(){ void ConstellationArtComponent::loadData(){
if(m_ConstList.isEmpty()) { if(m_ConstList.isEmpty()) {
QSqlDatabase skydb = QSqlDatabase::addDatabase("QSQLITE", "skycultures"); 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"); QString dbfile = KSPaths::locate(QStandardPaths::GenericDataLocation, "skycultures.sqlite");
#endif
skydb.setDatabaseName(dbfile); skydb.setDatabaseName(dbfile);
if (skydb.open() == false) if (skydb.open() == false)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment