summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lancaster <rlancaste@gmail.com>2016-11-13 05:38:46 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-13 05:38:46 (GMT)
commiteb2453ac7954c5c0a8da5749591f2d37faf497e9 (patch)
tree3634b1de53fc8f0ebc48ee40aa3b57b90a4877bc
parent5b4cc61cfce1cdce9ecd863ebda662446ba06afc (diff)
XPlanet Fixes and Bundle Defaults
-rw-r--r--kstars/auxiliary/ksutils.cpp5
-rw-r--r--kstars/kstars.kcfg4
-rw-r--r--kstars/skymap.cpp14
-rw-r--r--kstars/xplanet/opsxplanet.cpp20
-rw-r--r--kstars/xplanet/opsxplanet.h1
-rw-r--r--kstars/xplanet/opsxplanet.ui39
6 files changed, 68 insertions, 15 deletions
diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp
index e8e1d76..7f27e54 100644
--- a/kstars/auxiliary/ksutils.cpp
+++ b/kstars/auxiliary/ksutils.cpp
@@ -642,6 +642,11 @@ void copyDataFolderFromAppBundleIfNeeded()
if(!dataLocation.isEmpty()&&!dataSourceLocation.isEmpty()){ //If both the users data directory and the default data directory are found.
KMessageBox::sorry(0, i18n("No Data Directory in /Library/Application Support/, creating a new one"));
KSUtils::copyRecursively(dataSourceLocation, dataLocation);
+ Options::setIndiServerIsInternal(true);
+ Options::setAstrometrySolverIsInternal(true);
+ Options::setAstrometryConfFileIsInternal(true);
+ Options::setWcsIsInternal(true);
+ Options::setXplanetIsInternal(true);
} else{
KMessageBox::sorry(0, i18n("Error, no data directories found!"));
}
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 6f217e8..c28d25e 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -968,6 +968,10 @@
</entry>
</group>
<group name="Xplanet">
+ <entry name="xplanetIsInternal" type="Bool">
+ <label>Internal or External XPlanet?</label>
+ <default>false</default>
+ </entry>
<entry name="XplanetPath" type="String">
<label>Path to xplanet binary</label>
<whatsthis>Xplanet binary path</whatsthis>
diff --git a/kstars/skymap.cpp b/kstars/skymap.cpp
index aef1232..cac4072 100644
--- a/kstars/skymap.cpp
+++ b/kstars/skymap.cpp
@@ -1206,13 +1206,25 @@ void SkyMap::startXplanet( const QString & outputFile ) {
// Run xplanet
//qDebug() << "Run:" << xplanetProc->program().join(" ");
- xplanetProc->start(Options::xplanetPath(), args);
+
+ QString xPlanetLocation=Options::xplanetPath();
+
+ #ifdef Q_OS_OSX
+ if(Options::xplanetIsInternal()){
+ xPlanetLocation=QCoreApplication::applicationDirPath()+"/xplanet/bin/xplanet";
+ QString searchDir=QCoreApplication::applicationDirPath()+"/xplanet/share/xplanet/";
+ args << "-searchdir" << searchDir;
+ }
+ #endif
+ xplanetProc->start(xPlanetLocation, args);
if(xplanetProc){
xplanetProc->waitForFinished(1000);
ImageViewer *iv = new ImageViewer( QUrl::fromLocalFile(outputFile),
"XPlanet View: "+ clickedObject()->name() + ", " + data->lt().date().toString() + ", "+ data->lt().time().toString(),
this );
iv->show();
+ } else{
+ KMessageBox::sorry( this, i18n("XPlanet Program Error"));
}
}
diff --git a/kstars/xplanet/opsxplanet.cpp b/kstars/xplanet/opsxplanet.cpp
index 8adfb97..e562626 100644
--- a/kstars/xplanet/opsxplanet.cpp
+++ b/kstars/xplanet/opsxplanet.cpp
@@ -25,6 +25,17 @@ OpsXplanet::OpsXplanet( KStars *_ks )
{
setupUi( this );
+ #ifdef Q_OS_OSX
+ connect(kcfg_xplanetIsInternal, SIGNAL(clicked()), this, SLOT(toggleXPlanetInternal()));
+ kcfg_xplanetIsInternal->setToolTip(i18n("Internal or External XPlanet?"));
+
+ if(Options::xplanetIsInternal())
+ kcfg_XplanetPath->setEnabled(false);
+
+ #else
+ kcfg_xplanetIsInternal->setVisible(false);
+ #endif
+
// Init projections combobox
kcfg_XplanetProjection->addItem( i18nc("Map projection method", "No projection"), "no projection");
kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Ancient"), "ancient");
@@ -91,6 +102,15 @@ OpsXplanet::OpsXplanet( KStars *_ks )
OpsXplanet::~OpsXplanet()
{}
+void OpsXplanet::toggleXPlanetInternal()
+{
+ kcfg_XplanetPath->setEnabled(!kcfg_xplanetIsInternal->isChecked());
+ if(kcfg_xplanetIsInternal->isChecked())
+ kcfg_XplanetPath->setText("*Internal XPlanet*");
+ else
+ kcfg_XplanetPath->setText("/usr/local/bin/xplanet");
+}
+
void OpsXplanet::slotUpdateWidgets( bool on ) {
kcfg_XplanetWaitValue->setEnabled( on );
textLabelXplanetSecondes->setEnabled( on );
diff --git a/kstars/xplanet/opsxplanet.h b/kstars/xplanet/opsxplanet.h
index 9f55db9..9163a78 100644
--- a/kstars/xplanet/opsxplanet.h
+++ b/kstars/xplanet/opsxplanet.h
@@ -42,6 +42,7 @@ private slots:
void slotMarkerBoundsWidgets( bool on );
void slotProjectionWidgets( int index );
void slotBackgroundWidgets( bool on );
+ void toggleXPlanetInternal();
};
#endif // OPSGUIDES_H_
diff --git a/kstars/xplanet/opsxplanet.ui b/kstars/xplanet/opsxplanet.ui
index 421ab00..95cd45b 100644
--- a/kstars/xplanet/opsxplanet.ui
+++ b/kstars/xplanet/opsxplanet.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>561</width>
+ <width>621</width>
<height>647</height>
</rect>
</property>
@@ -136,13 +136,6 @@
</item>
</layout>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="textLabelXplanetPath">
- <property name="text">
- <string>Xplanet path:</string>
- </property>
- </widget>
- </item>
<item row="0" column="1">
<widget class="QLineEdit" name="kcfg_XplanetPath">
<property name="sizePolicy">
@@ -159,6 +152,30 @@
</property>
</widget>
</item>
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_12">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="kcfg_xplanetIsInternal">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabelXplanetPath">
+ <property name="text">
+ <string>Xplanet path:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
@@ -991,12 +1008,6 @@
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
- <customwidget>
- <class>QTabWidget</class>
- <extends>QTabWidget</extends>
- <header>ktabwidget.h</header>
- <container>1</container>
- </customwidget>
</customwidgets>
<tabstops>
<tabstop>tab</tabstop>