Commit 6a03e99e authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Moving EkosManager to KStarsData.

parent 3df75645
......@@ -33,14 +33,16 @@
#define MAX_REMOTE_INDI_TIMEOUT 15000
#define MAX_LOCAL_INDI_TIMEOUT 5000
EkosManager::EkosManager(QWidget *parent)
: QDialog(parent)
EkosManager::EkosManager()
: QDialog(KStars::Instance())
{
setupUi(this);
new EkosAdaptor(this);
QDBusConnection::sessionBus().registerObject("/KStars/Ekos", this);
setWindowIcon(QIcon::fromTheme("kstars_ekos"));
nDevices=0;
useGuideHead =false;
useST4 =false;
......
......@@ -41,7 +41,7 @@ class EkosManager : public QDialog, public Ui::EkosManager
Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos")
public:
EkosManager(QWidget *parent);
EkosManager();
~EkosManager();
void appendLogText(const QString &);
......
......@@ -18,11 +18,11 @@
#include "opsekos.h"
#include "Options.h"
#include "kstars.h"
#include "kstarsdata.h"
#include "ekosmanager.h"
OpsEkos::OpsEkos( KStars *_ks )
: QFrame( _ks )
OpsEkos::OpsEkos()
: QFrame( KStars::Instance() )
{
setupUi(this);
......@@ -40,7 +40,7 @@ OpsEkos::~OpsEkos() {}
void OpsEkos::slotApply()
{
EkosManager *ekosManager = KStars::Instance()->ekosManager();
EkosManager *ekosManager = KStarsData::Instance()->ekosManager();
if (ekosManager)
ekosManager->refreshRemoteDrivers();
......
......@@ -12,7 +12,6 @@
#include "ui_opsekos.h"
class KStars;
class KConfigDialog;
/**
......@@ -28,7 +27,7 @@ class OpsEkos : public QFrame, public Ui::OpsEkos
Q_OBJECT
public:
explicit OpsEkos( KStars *_ks );
explicit OpsEkos();
~OpsEkos();
private slots:
......
......@@ -13,6 +13,7 @@ hi22-actions-kstars_planets.png
hi22-actions-kstars_satellites.png
hi22-actions-kstars_stars.png
hi22-actions-kstars_supernovae.png
hi22-actions-kstars_ekos.png
hi32-actions-kstars_clines.png
hi32-actions-kstars_cnames.png
hi32-actions-kstars_deepsky.png
......@@ -25,6 +26,7 @@ hi32-actions-kstars_planets.png
hi32-actions-kstars_satellites.png
hi32-actions-kstars_stars.png
hi32-actions-kstars_supernovae.png
hi32-actions-kstars_ekos.png
hi48-actions-kstars_clines.png
hi48-actions-kstars_cnames.png
hi48-actions-kstars_deepsky.png
......@@ -37,6 +39,7 @@ hi48-actions-kstars_planets.png
hi48-actions-kstars_satellites.png
hi48-actions-kstars_stars.png
hi48-actions-kstars_supernovae.png
hi48-actions-kstars_ekos.png
hi64-actions-kstars_advanced.png
hi64-actions-kstars_catalog.png
hi64-actions-kstars_cbound.png
......@@ -56,5 +59,6 @@ hi64-actions-kstars_solarsystem.png
hi64-actions-kstars_stars.png
hi64-actions-kstars_supernovae.png
hi64-actions-kstars_xplanet.png
hi64-actions-kstars_ekos.png
DESTINATION
${ICON_INSTALL_DIR})
......@@ -28,7 +28,7 @@
#include "streamwg.h"
#include "indiccd.h"
#include "guimanager.h"
#include "kstars.h"
#include "kstarsdata.h"
#include <ekos/ekosmanager.h>
......@@ -1164,7 +1164,7 @@ void CCD::processBLOB(IBLOB* bp)
if ((targetChip->isBatchMode() && targetChip->getCaptureMode() == FITS_NORMAL) || Options::showFITS() == false)
KStars::Instance()->statusBar()->showMessage( xi18n("%1 file saved to %2", QString(fmt).toUpper(), filename ), 0);
if (Options::playFITSAlarm() && KStars::Instance()->ekosManager())
if (Options::playFITSAlarm() && KStarsData::Instance()->ekosManager())
KSNotify::play(KSNotify::NOTIFY_FILE_RECEIVED);
if (targetChip->showFITS() == false && targetChip->getCaptureMode() == FITS_NORMAL)
......
......@@ -23,8 +23,8 @@
#include "kstars.h"
OpsINDI::OpsINDI( KStars *_ks )
: QFrame( _ks )
OpsINDI::OpsINDI()
: QFrame(KStars::Instance())
{
setupUi(this);
......
......@@ -27,7 +27,7 @@ class OpsINDI : public QFrame, public Ui::OpsINDI
Q_OBJECT
public:
OpsINDI( KStars *_ks );
OpsINDI();
~OpsINDI();
private slots:
......
......@@ -57,7 +57,7 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate )
imgExportDialog(0), imageExporter(0), m_execute(0),
m_altVsTime(0), m_WUTDialog(0), m_WIView(0), m_ObsConditions(0), m_wiDock(0), m_skyCalender(0),
m_scriptBuilder(0), m_planetViewer(0), m_JMoonTool(0), m_moonPhaseTool(0), m_flagManager(0), astrocalc(0), m_printingWizard(0),
m_ekosManager(0), DialogIsObsolete(false), StartClockRunning( clockrun ),
DialogIsObsolete(false), StartClockRunning( clockrun ),
StartDateString( startdate )
{
new KstarsAdaptor(this);
......
......@@ -37,7 +37,6 @@ class FindDialog;
class TimeStepBox;
class ImageExporter;
class AltVsTime;
class WUTDialog;
class WIView;
......@@ -67,7 +66,7 @@ class OpsColors;
class OpsAdvanced;
class OpsINDI;
class OpsEkos;
class EkosManager;
#ifdef HAVE_XPLANET
class OpsXplanet;
#endif
......@@ -122,9 +121,7 @@ public:
inline KStarsData* data() const { return kstarsData; }
/** @return pointer to SkyMap object which is the sky display widget. */
inline SkyMap* map() const { return skymap; }
inline EkosManager *ekosManager() const { return m_ekosManager; }
inline SkyMap* map() const { return skymap; }
inline FlagManager* flagManager() const { return m_flagManager; }
......@@ -632,8 +629,7 @@ private:
MoonPhaseTool *m_moonPhaseTool;
FlagManager *m_flagManager;
AstroCalc *astrocalc;
PrintingWizard *m_printingWizard;
EkosManager *m_ekosManager;
PrintingWizard *m_printingWizard;
QActionGroup *projectionGroup, *cschemeGroup;
......
......@@ -495,8 +495,7 @@ void KStars::slotEkos()
return;
}
if (m_ekosManager == NULL)
m_ekosManager = new EkosManager(this);
EkosManager *m_ekosManager = KStarsData::Instance()->ekosManager();
m_ekosManager->show();
m_ekosManager->raise();
......@@ -571,12 +570,12 @@ void KStars::slotViewOps() {
dialog->addPage(opcolors, xi18n("Colors"), "kstars_colors");
#ifdef HAVE_INDI
opsindi = new OpsINDI (this);
opsindi = new OpsINDI();
dialog->addPage(opsindi, xi18n("INDI"), "kstars");
#ifdef HAVE_CFITSIO
opsekos = new OpsEkos(this);
dialog->addPage(opsekos, xi18n("Ekos"), "kstars");
opsekos = new OpsEkos();
dialog->addPage(opsekos, xi18n("Ekos"), "kstars_ekos");
#endif
#endif
......
......@@ -44,6 +44,10 @@
#include <config-kstars.h>
#include "dialogs/detaildialog.h"
#ifdef HAVE_INDI
#include "ekos/ekosmanager.h"
#endif
namespace {
// Report fatal error during data loading to user
......@@ -110,6 +114,10 @@ KStarsData::KStarsData() :
// at startup times run forward
setTimeDirection( 0.0 );
#ifdef HAVE_INDI
m_ekosManager = NULL;
#endif
}
KStarsData::~KStarsData() {
......@@ -117,6 +125,11 @@ KStarsData::~KStarsData() {
//delete locale;
delete m_logObject;
delete m_observingList;
#ifdef HAVE_INDI
delete m_ekosManager;
#endif
qDeleteAll( geoList );
qDeleteAll( ADVtreeList );
......@@ -170,6 +183,9 @@ bool KStarsData::initialize() {
//Initialize Observing List
m_observingList = new ObservingList();
#ifdef HAVE_INDI
m_ekosManager = new EkosManager();
#endif
readUserLog();
......
......@@ -49,6 +49,7 @@ class SkyMap;
class SkyMapComposite;
class SkyObject;
class FOV;
class EkosManager;
class TimeZoneRule;
struct ADVTreeData;
......@@ -215,6 +216,9 @@ public:
QList<ADVTreeData*> avdTree() { return ADVtreeList; }
inline ObservingList* observingList() const { return m_observingList; }
#ifdef HAVE_INDI
inline EkosManager *ekosManager() const { return m_ekosManager; }
#endif
/*@short Increments the updateID, forcing a recomputation of star positions as well */
unsigned int incUpdateID();
......@@ -336,6 +340,9 @@ private:
ColorScheme CScheme;
OAL::Log *m_logObject;
ObservingList *m_observingList;
#ifdef HAVE_INDI
EkosManager *m_ekosManager;
#endif
bool TimeRunsForward, temporaryTrail;
// FIXME: Used in SkyMap only. Check!
......
......@@ -586,9 +586,6 @@ void KStars::datainitFinished() {
m_equipmentWriter = new EquipmentWriter();
m_observerAdd = new ObserverAdd;
#ifdef HAVE_INDI
m_ekosManager = new EkosManager(this);
#endif
//Do not start the clock if "--paused" specified on the cmd line
if ( StartClockRunning )
......
......@@ -187,7 +187,7 @@ void SkyMapDrawAbstract::drawSolverFOV(QPainter &psky)
#ifdef HAVE_INDI
Ekos::Align *align = KStars::Instance()->ekosManager()->alignModule();
Ekos::Align *align = KStarsData::Instance()->ekosManager()->alignModule();
if (align)
{
FOV * fov = align->fov();
......
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