summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lancaster <rlancaste@gmail.com>2016-11-08 05:58:54 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-08 05:58:54 (GMT)
commit1934a83957815df635d428294eadce809d113753 (patch)
tree7ec5413560614da45020cd2e5aaa72339bcccf28
parentca6c401863b95a2d1577d37fb54679f72ecc73f7 (diff)
OSX and XPlanet fixes
-rw-r--r--kstars/auxiliary/ksutils.cpp4
-rw-r--r--kstars/auxiliary/ksutils.h4
-rw-r--r--kstars/fitsviewer/fitsdata.cpp2
-rw-r--r--kstars/kspopupmenu.cpp10
-rw-r--r--kstars/skymap.cpp16
-rw-r--r--kstars/skymap.h4
6 files changed, 28 insertions, 12 deletions
diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp
index f06e3a1..e8e1d76 100644
--- a/kstars/auxiliary/ksutils.cpp
+++ b/kstars/auxiliary/ksutils.cpp
@@ -27,6 +27,10 @@
#include <QUrl>
#include <QStandardPaths>
+#ifndef KSTARS_LITE
+#include <KMessageBox>
+#endif
+
#include <cmath>
#include "auxiliary/kspaths.h"
diff --git a/kstars/auxiliary/ksutils.h b/kstars/auxiliary/ksutils.h
index 95b3172..66428e9 100644
--- a/kstars/auxiliary/ksutils.h
+++ b/kstars/auxiliary/ksutils.h
@@ -225,8 +225,8 @@ namespace KSUtils {
};
#ifdef Q_OS_OSX
- static void copyDataFolderFromAppBundleIfNeeded();
- static bool copyRecursively(QString sourceFolder, QString destFolder);
+ void copyDataFolderFromAppBundleIfNeeded();
+ bool copyRecursively(QString sourceFolder, QString destFolder);
#endif
}
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 0ee4d4d..96b3a76 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -3569,7 +3569,7 @@ QImage FITSData::FITSToImage(const QString &filename)
}
else
{
- double val=0,rval=0,gval=0,bval=0;
+ double rval=0,gval=0,bval=0;
QRgb value;
/* Fill in pixel values using indexed map, linear scale */
for (int j = 0; j < h; j++)
diff --git a/kstars/kspopupmenu.cpp b/kstars/kspopupmenu.cpp
index e4105f1..20b243c 100644
--- a/kstars/kspopupmenu.cpp
+++ b/kstars/kspopupmenu.cpp
@@ -342,11 +342,11 @@ void KSPopupMenu::initPopupMenu( SkyObject *obj, QString name, QString type, QSt
addSeparator();
#ifdef HAVE_XPLANET
if ( obj->isSolarSystem() && obj->type() != SkyObject::COMET ) { // FIXME: We now have asteroids -- so should this not be isMajorPlanet() || Pluto?
- QMenu *xplanetSubmenu = new QMenu();
- xplanetSubmenu->setTitle( i18n( "Print Xplanet view" ) );
- xplanetSubmenu->addAction( i18n( "To screen" ), map, SLOT( slotXplanetToScreen() ) );
- xplanetSubmenu->addAction( i18n( "To file..." ), map, SLOT( slotXplanetToFile() ) );
- addMenu( xplanetSubmenu );
+ //QMenu *xplanetSubmenu = new QMenu();
+ //xplanetSubmenu->setTitle( i18n( "Print Xplanet view" ) );
+ addAction( i18n( "View in XPlanet" ), map, SLOT( slotXplanetToWindow() ) );
+ //xplanetSubmenu->addAction( i18n( "To file..." ), map, SLOT( slotXplanetToFile() ) );
+ //addMenu( xplanetSubmenu );
}
#endif
addSeparator();
diff --git a/kstars/skymap.cpp b/kstars/skymap.cpp
index ac42297..aef1232 100644
--- a/kstars/skymap.cpp
+++ b/kstars/skymap.cpp
@@ -45,6 +45,7 @@
#include "Options.h"
#include "kstars.h"
+#include "kspaths.h"
#include "kstarsdata.h"
#include "ksutils.h"
#include "ksdssdownloader.h"
@@ -1206,10 +1207,21 @@ void SkyMap::startXplanet( const QString & outputFile ) {
// Run xplanet
//qDebug() << "Run:" << xplanetProc->program().join(" ");
xplanetProc->start(Options::xplanetPath(), 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();
+ }
}
-void SkyMap::slotXplanetToScreen() {
- startXplanet();
+void SkyMap::slotXplanetToWindow() {
+ QDir writableDir;
+ QString xPlanetDirPath=KSPaths::writableLocation(QStandardPaths::GenericDataLocation) + "xplanet";
+ writableDir.mkpath(xPlanetDirPath);
+ QString xPlanetPath=xPlanetDirPath + QDir::separator() + clickedObject()->name() + ".png";
+ startXplanet(xPlanetPath);
}
void SkyMap::slotXplanetToFile() {
diff --git a/kstars/skymap.h b/kstars/skymap.h
index 6d8d677..d346042 100644
--- a/kstars/skymap.h
+++ b/kstars/skymap.h
@@ -437,8 +437,8 @@ public slots:
#endif
#ifdef HAVE_XPLANET
- /** Run Xplanet to print a view on the screen*/
- void slotXplanetToScreen();
+ /** Run Xplanet to print a view in a Window*/
+ void slotXplanetToWindow();
/** Run Xplanet to print a view in a file */
void slotXplanetToFile();