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()
#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);
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -529,11 +529,26 @@ 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())
{
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
QPointer<telescopeWizardProcess> twiz = new telescopeWizardProcess(this);
......@@ -546,11 +561,26 @@ 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())
{
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();
#endif
......@@ -560,11 +590,26 @@ 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())
{
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
DriverManager::Instance()->raise();
......@@ -580,11 +625,26 @@ 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())
{
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
ekosManager()->raise();
......
......@@ -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)
......
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