kstars.cpp 20.8 KB
Newer Older
Chris Howells's avatar
adding  
Chris Howells committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/***************************************************************************
                          kstars.cpp  -  K Desktop Planetarium
                             -------------------
    begin                : Mon Feb  5 01:11:45 PST 2001
    copyright            : (C) 2001 by Jason Harris
    email                : jharris@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

18
#include "kstars.h"
Chris Howells's avatar
adding  
Chris Howells committed
19

20
#include <QApplication>
21
#include <QDockWidget>
22
#include <QDebug>
23 24
#include <QStatusBar>
#include <QIcon>
25
#include <QMenu>
26

27 28 29 30
#ifdef Q_OS_WIN
#include <QProcess>
#endif

31 32 33 34
#include <KLocalizedString>
#include <KActionCollection>
#include <KToolBar>
#include <KSharedConfig>
Chris Howells's avatar
adding  
Chris Howells committed
35

36
#include "Options.h"
37 38
#include "kstarsdata.h"
#include "kstarssplash.h"
39
#include "kactionmenu.h"
40
#include "skymap.h"
41
#include "ksutils.h"
Chris Howells's avatar
adding  
Chris Howells committed
42
#include "simclock.h"
43
#include "fov.h"
44
#include "dialogs/finddialog.h"
45
#include "dialogs/exportimagedialog.h"
46
#include "observinglist.h"
47
//#include "whatsinteresting/wiview.h"
Chris Howells's avatar
adding  
Chris Howells committed
48

49 50
// For profiling only
#include "auxiliary/dms.h"
51
#include "skyobjects/skypoint.h"
52

53 54
#include "kstarsadaptor.h"

55
#include <config-kstars.h>
Jasem Mutlaq's avatar
Jasem Mutlaq committed
56
#include <version.h>
57

Jasem Mutlaq's avatar
Jasem Mutlaq committed
58
#ifdef HAVE_INDI
Jasem Mutlaq's avatar
Jasem Mutlaq committed
59
#include "indi/drivermanager.h"
60
#include "indi/guimanager.h"
61
#include "ekos/ekosmanager.h"
62
#endif
63

64 65 66 67
#ifdef HAVE_CFITSIO
#include "fitsviewer/fitsviewer.h"
#endif

68
KStars * KStars::pinstance = 0;
69

Rafal Kulaga's avatar
Rafal Kulaga committed
70
KStars::KStars( bool doSplash, bool clockrun, const QString &startdate )
71
    : KXmlGuiWindow(), colorActionMenu(0), fovActionMenu(0), m_KStarsData(0), m_SkyMap(0), m_TimeStepBox(0),
72
      m_ExportImageDialog(0),  m_PrintingWizard(0), m_FindDialog(0), m_AstroCalc(0), m_AltVsTime(0), m_SkyCalendar(0), m_ScriptBuilder(0),
Akarsh Simha's avatar
Akarsh Simha committed
73
      m_PlanetViewer(0), m_WUTDialog(0), /*m_JMoonTool(0),*/ m_MoonPhaseTool(0), m_FlagManager(0), m_HorizonManager(0), m_EyepieceView(0),
74
      m_addDSODialog(0), m_WIView(0), m_ObsConditions(0), m_wiDock(0), DialogIsObsolete(false), StartClockRunning( clockrun ), StartDateString( startdate )
Chris Howells's avatar
adding  
Chris Howells committed
75
{
76 77
    setWindowTitle(i18n("KStars"));

78

Robert Lancaster's avatar
Robert Lancaster committed
79 80 81
    //On OS X, need to launch kdeinit5 so you can get KLauncher and KIOSlave so you can download new data.
    //Note:  You need to make sure the environment variables for KStars are set correctly to get this running properly.
#ifdef Q_OS_OSX
82
    QProcess * klauncher = new QProcess(this);
Robert Lancaster's avatar
Robert Lancaster committed
83 84 85
    klauncher->start("kdeinit5");
#endif

86 87


88
    // Initialize logging settings
89 90
    if (Options::disableLogging())
        KSUtils::Logging::Disable();
91 92
    else if (Options::logToFile())
        KSUtils::Logging::UseFile();
93 94
    else
        KSUtils::Logging::UseDefault();
95

Jasem Mutlaq's avatar
Jasem Mutlaq committed
96 97
    qDebug() << "Welcome to KStars" << KSTARS_VERSION;

Akarsh Simha's avatar
Akarsh Simha committed
98 99
    new KstarsAdaptor(this); // NOTE the weird case convention, which cannot be changed as the file is generated by the moc.

100 101 102
    QDBusConnection::sessionBus().registerObject("/KStars",  this);
    QDBusConnection::sessionBus().registerService("org.kde.kstars");

103
#ifdef HAVE_CFITSIO
104
    m_GenericFITSViewer.clear();
105
#endif
106

107
#ifdef HAVE_INDI
108
    m_EkosManager.clear();
109
#endif
110

111 112 113
    // Set pinstance to yourself
    pinstance = this;

114 115
    connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( slotAboutToQuit() ) );

116 117 118 119
    //Initialize QActionGroups
    projectionGroup = new QActionGroup( this );
    cschemeGroup    = new QActionGroup( this );

120 121
    m_KStarsData = KStarsData::Create();
    Q_ASSERT( m_KStarsData );
122
    //Set Geographic Location from Options
123
    m_KStarsData->setLocationFromOptions();
124 125

    //Initialize Time and Date
126 127 128 129 130 131 132 133
    if (StartDateString.isEmpty() == false)
    {
        KStarsDateTime startDate = KStarsDateTime::fromString( StartDateString );
        if (startDate.isValid() )
            data()->changeDateTime( data()->geo()->LTtoUT( startDate ) );
        else
            data()->changeDateTime( KStarsDateTime::currentDateTimeUtc() );
    }
134 135
    // JM 2016-11-15: Not need to set it again as it was initialized in the ctor of SimClock
    /*
136
    else
137
        data()->changeDateTime( KStarsDateTime::currentDateTimeUtc() );
138
    */
139

140 141 142
    // Initialize clock. If --paused is not in the comand line, look in options
    if ( clockrun )
        StartClockRunning =  Options::runClock();
143 144 145 146 147 148
    // If we are starting paused, we need to change datetime in data
    if (StartClockRunning == false)
    {
        qDebug() << "KStars is started in paused state.";
        data()->changeDateTime( KStarsDateTime::currentDateTimeUtc() );
    }
149

150
    // Setup splash screen
151 152 153
    KStarsSplash * splash = 0;
    if ( doSplash )
    {
154
        splash = new KStarsSplash(0);
155
        connect( m_KStarsData, SIGNAL( progressText(QString) ), splash, SLOT( setMessage(QString) ));
156
        splash->show();
157 158 159
    }
    else
    {
160
        connect( m_KStarsData, SIGNAL( progressText(QString) ), m_KStarsData, SLOT( slotConsoleMessage(QString) ) );
161 162 163
    }

    //set up Dark color scheme for application windows
164 165 166
    DarkPalette = QPalette(QColor("black"), QColor("black"));
    DarkPalette.setColor( QPalette::Inactive, QPalette::WindowText, QColor( "red" ) );
    DarkPalette.setColor( QPalette::Normal, QPalette::WindowText, QColor( "red" ) );
167 168 169 170
    DarkPalette.setColor( QPalette::Normal, QPalette::Base, QColor( "black" ) );
    DarkPalette.setColor( QPalette::Normal, QPalette::Text, QColor( 238, 0, 0 ) );
    DarkPalette.setColor( QPalette::Normal, QPalette::Highlight, QColor( 238, 0, 0 ) );
    DarkPalette.setColor( QPalette::Normal, QPalette::HighlightedText, QColor( "black" ) );
171
    DarkPalette.setColor( QPalette::Inactive, QPalette::Text, QColor( 238, 0, 0 ) );
172
    DarkPalette.setColor( QPalette::Inactive, QPalette::Base, QColor( 30, 10, 10 ) );
173 174 175
    //store original color scheme
    OriginalPalette = QApplication::palette();

176
    //Initialize data.  When initialization is complete, it will run dataInitFinished()
177
    if( !m_KStarsData->initialize() )
178
        return;
179
    delete splash;
180
    datainitFinished();
181

Jasem Mutlaq's avatar
Jasem Mutlaq committed
182
#if ( __GLIBC__ >= 2 &&__GLIBC_MINOR__ >= 1  && !defined(__UCLIBC__) )
183
    qDebug() << "glibc >= 2.1 detected.  Using GNU extension sincos()";
Jason Harris's avatar
Jason Harris committed
184
#else
185
    qDebug() << "Did not find glibc >= 2.1.  Will use ANSI-compliant sin()/cos() functions.";
Jason Harris's avatar
Jason Harris committed
186
#endif
Chris Howells's avatar
adding  
Chris Howells committed
187 188
}

189 190
KStars * KStars::createInstance( bool doSplash, bool clockrun, const QString &startdate )
{
191
    delete pinstance;
192 193 194
    // pinstance is set directly in constructor.
    new KStars( doSplash, clockrun, startdate );
    Q_ASSERT( pinstance && "pinstance must be non NULL");
195 196 197
    return pinstance;
}

Chris Howells's avatar
adding  
Chris Howells committed
198 199
KStars::~KStars()
{
200 201
    Q_ASSERT( pinstance );

202 203 204
    delete m_KStarsData;
    pinstance = 0;

205
#ifdef HAVE_INDI
206
    delete m_EkosManager;
207
    GUIManager::Instance()->close();
208
#endif
Jasem Mutlaq's avatar
Jasem Mutlaq committed
209

210 211
    QSqlDatabase::removeDatabase("userdb");
    QSqlDatabase::removeDatabase("skydb");
212

213 214 215 216
#ifdef PROFILE_COORDINATE_CONVERSION
    qDebug() << "Spent " << SkyPoint::cpuTime_EqToHz << " seconds in " << SkyPoint::eqToHzCalls << " calls to SkyPoint::EquatorialToHorizontal, for an average of " << 1000.*( SkyPoint::cpuTime_EqToHz / SkyPoint::eqToHzCalls ) << " ms per call";
#endif

217 218 219
#ifdef COUNT_DMS_SINCOS_CALLS
    qDebug() << "Constructed " << dms::dms_constructor_calls << " dms objects, of which " << dms::dms_with_sincos_called << " had trigonometric functions called on them = " << ( float( dms::dms_with_sincos_called ) / float( dms::dms_constructor_calls ) ) * 100. << "%";
    qDebug() << "Of the " << dms::trig_function_calls << " calls to sin/cos/sincos on dms objects, " << dms::redundant_trig_function_calls << " were redundant = " << ( ( float( dms::redundant_trig_function_calls ) / float( dms::trig_function_calls ) ) * 100. ) << "%";
220
    qDebug() << "We had " << CachingDms::cachingdms_bad_uses << " bad uses of CachingDms in all, compared to " << CachingDms::cachingdms_constructor_calls << " constructed CachingDms objects = " << ( float( CachingDms::cachingdms_bad_uses ) / float( CachingDms::cachingdms_constructor_calls ) ) * 100. << "% bad uses";
221 222
#endif

223 224 225 226 227
    /* BUG 366596: Some KDE applications processes remain as background (zombie) processes after closing
     * No solution to this bug so far using Qt 5.8 as of 2016-11-24
     * Therefore, the only way to solve this on Windows is to explicitly kill kstars.exe
     * Hopefully we do not need this hack once the above bug is resolved.
     */
228
#ifdef Q_OS_WIN
229
    QProcess::execute("taskkill /im kstars.exe /f");
230
#endif
231 232
}

233 234 235 236
void KStars::clearCachedFindDialog()
{
    if ( m_FindDialog  )    // dialog is cached
    {
237
        /** Delete findDialog only if it is not opened */
238 239
        if ( m_FindDialog->isHidden() )
        {
240 241
            delete m_FindDialog;
            m_FindDialog = 0;
242 243 244 245 246
            DialogIsObsolete = false;
        }
        else
            DialogIsObsolete = true;  // dialog was opened so it could not deleted
    }
Chris Howells's avatar
adding  
Chris Howells committed
247 248
}

249 250 251 252
void KStars::applyConfig( bool doApplyFocus )
{
    if ( Options::isTracking() )
    {
253
        actionCollection()->action("track_object")->setText( i18n( "Stop &Tracking" ) );
254
        actionCollection()->action("track_object")->setIcon( QIcon::fromTheme("document-encrypt", QIcon(":/icons/breeze/default/document-encrypt.svg")) );
255 256
    }

257
    actionCollection()->action("coordsys")->setText(
258
        Options::useAltAz() ? i18n("Switch to star globe view (Equatorial &Coordinates)"): i18n("Switch to horizonal view (Horizontal &Coordinates)") );
259

260 261 262 263 264 265
    actionCollection()->action("show_time_box"        )->setChecked( Options::showTimeBox() );
    actionCollection()->action("show_location_box"    )->setChecked( Options::showGeoBox() );
    actionCollection()->action("show_focus_box"       )->setChecked( Options::showFocusBox() );
    actionCollection()->action("show_statusBar"       )->setChecked( Options::showStatusBar() );
    actionCollection()->action("show_sbAzAlt"         )->setChecked( Options::showAltAzField() );
    actionCollection()->action("show_sbRADec"         )->setChecked( Options::showRADecField() );
266
    actionCollection()->action("show_sbJ2000RADec"    )->setChecked( Options::showJ2000RADecField() );
267 268 269 270
    actionCollection()->action("show_stars"           )->setChecked( Options::showStars() );
    actionCollection()->action("show_deepsky"         )->setChecked( Options::showDeepSky() );
    actionCollection()->action("show_planets"         )->setChecked( Options::showSolarSystem() );
    actionCollection()->action("show_clines"          )->setChecked( Options::showCLines() );
271
    actionCollection()->action("show_constellationart")->setChecked( Options::showConstellationArt() );
272 273 274 275 276 277 278
    actionCollection()->action("show_cnames"          )->setChecked( Options::showCNames() );
    actionCollection()->action("show_cbounds"         )->setChecked( Options::showCBounds() );
    actionCollection()->action("show_mw"              )->setChecked( Options::showMilkyWay() );
    actionCollection()->action("show_equatorial_grid" )->setChecked( Options::showEquatorialGrid() );
    actionCollection()->action("show_horizontal_grid" )->setChecked( Options::showHorizontalGrid() );
    actionCollection()->action("show_horizon"         )->setChecked( Options::showGround() );
    actionCollection()->action("show_flags"           )->setChecked( Options::showFlags() );
279
    actionCollection()->action("show_supernovae"      )->setChecked( Options::showSupernovae() );
280
    actionCollection()->action("show_satellites"      )->setChecked( Options::showSatellites() );
281
    statusBar()->setVisible( Options::showStatusBar() );
282 283

    //color scheme
284
    m_KStarsData->colorScheme()->loadFromConfig();
285
    QApplication::setPalette( Options::darkAppColors() ? DarkPalette : OriginalPalette );
286

Robert Lancaster's avatar
Robert Lancaster committed
287 288 289
    //Note:  This uses style sheets to set the dark colors, this should be cross platform.  Palettes have a different behavior on OS X and Windows as opposed to Linux.
    //It might be a good idea to use stylesheets in the future instead of palettes but this will work for now for OS X.
    //This is also in KStarsDbus.cpp.  If you change it, change it in BOTH places.
290
#ifdef Q_OS_OSX
Robert Lancaster's avatar
Robert Lancaster committed
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
    if(Options::darkAppColors())
        qApp->setStyleSheet("QWidget { background-color: black; color:red; selection-background-color:rgb(30,30,30);selection-color:white}" \
                            "QToolBar { border:none }" \
                            "QTabBar::tab:selected { background-color:rgb(50,50,50) }" \
                            "QTabBar::tab:!selected { background-color:rgb(30,30,30) }" \
                            "QPushButton { background-color:rgb(50,50,50);border-width:1px; border-style:solid;border-color:black}" \
                            "QPushButton::disabled { background-color:rgb(10,10,10);border-width:1px; border-style:solid;border-color:black }" \
                            "QToolButton:Checked { background-color:rgb(30,30,30); border:none }" \
                            "QComboBox { background-color:rgb(30,30,30); }" \
                            "QComboBox::disabled { background-color:rgb(10,10,10) }" \
                            "QScrollBar::handle { background: rgb(30,30,30) }" \
                            "QSpinBox { border-width: 1px; border-style:solid; border-color:rgb(30,30,30) }" \
                            "QDoubleSpinBox { border-width:1px; border-style:solid; border-color:rgb(30,30,30) }" \
                            "QLineEdit { border-width: 1px; border-style: solid; border-color:rgb(30,30,30) }" \
                            "QCheckBox::indicator:unchecked { background-color:rgb(30,30,30);border-width:1px; border-style:solid;border-color:black }" \
                            "QCheckBox::indicator:checked { background-color:red;border-width:1px; border-style:solid;border-color:black }" \
                            "QRadioButton::indicator:unchecked { background-color:rgb(30,30,30) }" \
                            "QRadioButton::indicator:checked { background-color:red }" \
                            "QRoundProgressBar { alternate-background-color:black }" \
                            "QDateTimeEdit {background-color:rgb(30,30,30); border-width: 1px; border-style:solid; border-color:rgb(30,30,30) }" \
                            "QHeaderView { color:red;background-color:black }" \
                            "QHeaderView::Section { background-color:rgb(30,30,30) }" \
                            "QTableCornerButton::section{ background-color:rgb(30,30,30) }" \
                            "");
    else
        qApp->setStyleSheet("QRoundProgressBar { background-color: rgb(208,208,208) }" \
                            "");
318
#endif
Robert Lancaster's avatar
Robert Lancaster committed
319 320


321
    //Set toolbar options from config file
322 323
    toolBar("kstarsToolBar")->applySettings( KSharedConfig::openConfig()->group( "MainToolBar" ) );
    toolBar( "viewToolBar" )->applySettings( KSharedConfig::openConfig()->group( "ViewToolBar" ) );
324 325 326 327 328

    //Geographic location
    data()->setLocationFromOptions();

    //Focus
329 330 331 332 333
    if ( doApplyFocus )
    {
        SkyObject * fo = data()->objectNamed( Options::focusObject() );
        if ( fo && fo != map()->focusObject() )
        {
Jason Harris's avatar
Jason Harris committed
334 335
            map()->setClickedObject( fo );
            map()->setClickedPoint( fo );
336 337
            map()->slotCenter();
        }
338

339 340
        if ( ! fo )
        {
Jason Harris's avatar
Jason Harris committed
341
            SkyPoint fp( Options::focusRA(), Options::focusDec() );
342 343
            if ( fp.ra().Degrees() != map()->focus()->ra().Degrees() || fp.dec().Degrees() != map()->focus()->dec().Degrees() )
            {
Jason Harris's avatar
Jason Harris committed
344 345 346 347
                map()->setClickedPoint( &fp );
                map()->slotCenter();
            }
        }
348
    }
Jason Harris's avatar
Jason Harris committed
349 350
}

351 352
void KStars::showImgExportDialog()
{
353 354
    if(m_ExportImageDialog)
        m_ExportImageDialog->show();
355 356
}

357 358 359 360 361 362
void KStars::syncFOVActions()
{
    foreach(QAction * action, fovActionMenu->menu()->actions())
    {
        if(action->text().isEmpty())
        {
363 364 365
            continue;
        }

366 367
        if(Options::fOVNames().contains(action->text().remove(0, 1)))
        {
368
            action->setChecked(true);
369 370 371
        }
        else
        {
372 373 374 375 376 377 378
            action->setChecked(false);
        }
    }
}

void KStars::hideAllFovExceptFirst()
{
379 380 381
    // When there is only one visible FOV symbol, we don't need to do anything
    // Also, don't do anything if there are no available FOV symbols.
    if(data()->visibleFOVs.size() == 1 ||
382 383
            data()->availFOVs.size() == 0)
    {
384
        return;
385 386 387
    }
    else
    {
388
        // If there are no visible FOVs, select first available
389 390
        if(data()->visibleFOVs.size() == 0)
        {
391
            Q_ASSERT( !data()->availFOVs.isEmpty() );
392
            Options::setFOVNames(QStringList(data()->availFOVs.first()->name()));
393 394 395
        }
        else
        {
396 397 398 399
            Options::setFOVNames(QStringList(data()->visibleFOVs.first()->name()));
        }

        // Sync FOV and update skymap
400 401
        data()->syncFOV();
        syncFOVActions();
402
        map()->update(); // SkyMap::forceUpdate() is not required, as FOVs are drawn as overlays
403 404 405 406 407
    }
}

void KStars::selectNextFov()
{
408 409 410 411 412 413

    if( data()->getVisibleFOVs().isEmpty() )
        return;

    Q_ASSERT( ! data()->getAvailableFOVs().isEmpty() ); // The available FOVs had better not be empty if the visible ones are not.

414
    FOV * currentFov = data()->getVisibleFOVs().first();
415 416
    int currentIdx = data()->availFOVs.indexOf(currentFov);

417
    // If current FOV is not the available FOV list or there is only 1 FOV available, then return
418 419
    if(currentIdx == -1 || data()->availFOVs.size() < 2)
    {
420 421 422
        return;
    }

423
    QStringList nextFovName;
424 425
    if(currentIdx == data()->availFOVs.size() - 1)
    {
426
        nextFovName << data()->availFOVs.first()->name();
427 428 429
    }
    else
    {
430 431 432 433 434 435 436 437 438 439 440
        nextFovName << data()->availFOVs.at(currentIdx + 1)->name();
    }

    Options::setFOVNames(nextFovName);
    data()->syncFOV();
    syncFOVActions();
    map()->update();
}

void KStars::selectPreviousFov()
{
441 442 443 444 445
    if( data()->getVisibleFOVs().isEmpty() )
        return;

    Q_ASSERT( ! data()->getAvailableFOVs().isEmpty() ); // The available FOVs had better not be empty if the visible ones are not.

446
    FOV * currentFov = data()->getVisibleFOVs().first();
447 448
    int currentIdx = data()->availFOVs.indexOf(currentFov);

449
    // If current FOV is not the available FOV list or there is only 1 FOV available, then return
450 451
    if(currentIdx == -1 || data()->availFOVs.size() < 2)
    {
452 453 454
        return;
    }

455
    QStringList prevFovName;
456 457
    if(currentIdx == 0)
    {
458
        prevFovName << data()->availFOVs.last()->name();
459 460 461
    }
    else
    {
462 463 464 465 466 467 468 469 470
        prevFovName << data()->availFOVs.at(currentIdx - 1)->name();
    }

    Options::setFOVNames(prevFovName);
    data()->syncFOV();
    syncFOVActions();
    map()->update();
}

471
//FIXME Port to QML2
472
//#if 0
473
void KStars::showWISettingsUI()
474
{
475
    slotWISettings();
476
}
477
//#endif
478

479 480
void KStars::updateTime( const bool automaticDSTchange )
{
481 482 483
    // Due to frequently use of this function save data and map pointers for speedup.
    // Save options and geo() to a pointer would not speedup because most of time options
    // and geo will accessed only one time.
484
    KStarsData * Data = data();
Alexey Khudyakov's avatar
Alexey Khudyakov committed
485
    // dms oldLST( Data->lst()->Degrees() );
486

487
    Data->updateTime( Data->geo(), automaticDSTchange );
488 489 490 491 492

    //We do this outside of kstarsdata just to get the coordinates
    //displayed in the infobox to update every second.
    //	if ( !Options::isTracking() && LST()->Degrees() > oldLST.Degrees() ) {
    //		int nSec = int( 3600.*( LST()->Hours() - oldLST.Hours() ) );
493
    //		Map->focus()->setRA( Map->focus()->ra().Hours() + double( nSec )/3600. );
494 495 496 497 498 499 500 501 502
    //		if ( Options::useAltAz() ) Map->focus()->EquatorialToHorizontal( LST(), geo()->lat() );
    //		Map->showFocusCoords();
    //	}

    //If time is accelerated beyond slewTimescale, then the clock's timer is stopped,
    //so that it can be ticked manually after each update, in order to make each time
    //step exactly equal to the timeScale setting.
    //Wrap the call to manualTick() in a singleshot timer so that it doesn't get called until
    //the skymap has been completely updated.
503 504
    if ( Data->clock()->isManualMode() && Data->clock()->isActive() )
    {
505 506
        QTimer::singleShot( 0, Data->clock(), SLOT( manualTick() ) );
    }
Chris Howells's avatar
adding  
Chris Howells committed
507
}
508

509 510 511
#ifdef HAVE_CFITSIO
FITSViewer * KStars::genericFITSViewer()
{
512
    if (m_GenericFITSViewer.isNull())
513
    {
514 515
        m_GenericFITSViewer = new FITSViewer(Options::independentWindowFITS() ? NULL : this);
        m_GenericFITSViewer->setAttribute(Qt::WA_DeleteOnClose);
516 517

        m_FITSViewers.append(m_GenericFITSViewer);
518 519
    }

520
    return m_GenericFITSViewer;
521 522 523
}
#endif

524
#ifdef HAVE_INDI
525
EkosManager * KStars::ekosManager()
526
{
527 528
    if (m_EkosManager.isNull())
        m_EkosManager   = new EkosManager(Options::independentWindowEkos() ? NULL : this);
529 530 531 532 533 534

    return m_EkosManager;
}


#endif