summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lancaster <rlancaste@gmail.com>2016-10-05 05:55:42 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-05 05:55:42 (GMT)
commite78a098148ae1cdf061cc213adc68503c6f72e7f (patch)
tree1b949c172fadfa884ed1f47ad7110b7f9a09f535
parent68523926371d99c8427654fff1dcf12b0a5cf263 (diff)
Various fixes for OSX and icons
-rw-r--r--kstars/ekos/ekosmanager.cpp4
-rw-r--r--kstars/ekos/offlineastrometryparser.cpp29
-rw-r--r--kstars/fitsviewer/fitsviewer.cpp2
-rw-r--r--kstars/indi/guimanager.cpp2
4 files changed, 21 insertions, 16 deletions
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index f5c7782..cba605e 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -54,7 +54,7 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
new EkosAdaptor(this);
QDBusConnection::sessionBus().registerObject("/KStars/Ekos", this);
- setWindowIcon(QIcon::fromTheme("kstars_ekos", QIcon(":/icons/ekos.png")));
+ setWindowIcon(QIcon::fromTheme("kstars_ekos", QIcon(":/icons/breeze/default/kstars_ekos.svg")));
nDevices=0;
nConnectedDevices=0;
@@ -128,7 +128,7 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
// Set Profile icons
addProfileB->setIcon(QIcon::fromTheme("list-add", QIcon(":/icons/breeze/default/list-add.svg")));
- editProfileB->setIcon(QIcon::fromTheme("document-edit", QIcon(":/icons/indi.png")));
+ editProfileB->setIcon(QIcon::fromTheme("document-edit", QIcon(":/icons/kstars_ekos/document-edit.svg")));
deleteProfileB->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/breeze/default/list-remove.svg")));
// Load all drivers
diff --git a/kstars/ekos/offlineastrometryparser.cpp b/kstars/ekos/offlineastrometryparser.cpp
index 9a978ea..55d9338 100644
--- a/kstars/ekos/offlineastrometryparser.cpp
+++ b/kstars/ekos/offlineastrometryparser.cpp
@@ -152,21 +152,17 @@ bool OfflineAstrometryParser::getAstrometryDataDir(QString &dataDir)
QTextStream in(&confFile);
QString line;
- QStringList confOptions;
while ( !in.atEnd() )
{
line = in.readLine();
- if (line.startsWith("#"))
+ if (line.isEmpty() || line.startsWith("#"))
continue;
- confOptions = line.split(" ");
- if (confOptions.size() == 2)
+ line = line.trimmed();
+ if (line.startsWith("add_path"))
{
- if (confOptions[0] == "add_path")
- {
- dataDir = confOptions[1];
- return true;
- }
+ dataDir = line.mid(9).trimmed();
+ return true;
}
}
@@ -178,8 +174,16 @@ bool OfflineAstrometryParser::startSovler(const QString &filename, const QStrin
{
INDI_UNUSED(generated);
+ #ifdef Q_OS_OSX
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ QStringList envlist = env.toStringList();
+ envlist.replaceInStrings(QRegularExpression("^(?i)PATH=(.*)"), "PATH=/usr/local/bin:\\1");
+ solver.setEnvironment(envlist);
+ #endif
+
QStringList solverArgs = args;
- solverArgs << "-W" << "/tmp/solution.wcs" << filename;
+ QString solutionFile = QStandardPaths::TempLocation + "/solution.wcs";
+ solverArgs << "-W" << solutionFile << filename;
connect(&solver, SIGNAL(finished(int)), this, SLOT(solverComplete(int)));
connect(&solver, SIGNAL(readyReadStandardOutput()), this, SLOT(logSolver()));
@@ -215,7 +219,8 @@ void OfflineAstrometryParser::solverComplete(int exist_status)
solver.disconnect();
// TODO use QTemporaryFile later
- QFileInfo solution("/tmp/solution.wcs");
+ QString solutionFile = QStandardPaths::TempLocation + "/solution.wcs";
+ QFileInfo solution(solutionFile);
if (exist_status != 0 || solution.exists() == false)
{
@@ -227,7 +232,7 @@ void OfflineAstrometryParser::solverComplete(int exist_status)
connect(&wcsinfo, SIGNAL(finished(int)), this, SLOT(wcsinfoComplete(int)));
- wcsinfo.start(Options::astrometryWCSInfo(), QStringList("/tmp/solution.wcs"));
+ wcsinfo.start(Options::astrometryWCSInfo(), QStringList(solutionFile));
}
void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
diff --git a/kstars/fitsviewer/fitsviewer.cpp b/kstars/fitsviewer/fitsviewer.cpp
index 07adc94..ec74f78 100644
--- a/kstars/fitsviewer/fitsviewer.cpp
+++ b/kstars/fitsviewer/fitsviewer.cpp
@@ -77,7 +77,7 @@ FITSViewer::FITSViewer (QWidget *parent)
fitsTab->setTabsClosable(true);
- setWindowIcon(QIcon::fromTheme("kstars_fitsviewer", QIcon(":/icons/fitsviewer.png")));
+ setWindowIcon(QIcon::fromTheme("kstars_fitsviewer", QIcon(":/icons/breeze/default/kstars_fitsviewer.svg")));
setCentralWidget(fitsTab);
diff --git a/kstars/indi/guimanager.cpp b/kstars/indi/guimanager.cpp
index cdee8c9..7d912e4 100644
--- a/kstars/indi/guimanager.cpp
+++ b/kstars/indi/guimanager.cpp
@@ -64,7 +64,7 @@ GUIManager::GUIManager(QWidget *parent) : QWidget(parent, Qt::Window)
mainLayout->addWidget(mainTabWidget);
- setWindowIcon(QIcon::fromTheme("kstars_indi", QIcon(":/icons/indi.png")));
+ setWindowIcon(QIcon::fromTheme("kstars_indi", QIcon(":/icons/breeze/default/kstars_indi.svg")));
setWindowTitle(i18n("INDI Control Panel"));
setAttribute(Qt::WA_ShowModal, false);