opsekos.cpp 2.84 KB
Newer Older
1
2
3
4
5
6
7
/*  INDI Options
    Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)

    This application 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.
8

9
10
 */

Jasem Mutlaq's avatar
Jasem Mutlaq committed
11
#include <QPushButton>
Jasem Mutlaq's avatar
Jasem Mutlaq committed
12
#include <QFileDialog>
13
14
15
16
#include <QCheckBox>
#include <QStringList>
#include <QComboBox>

Jasem Mutlaq's avatar
Jasem Mutlaq committed
17
#include <KConfigDialog>
18

Jasem Mutlaq's avatar
Jasem Mutlaq committed
19
20
#include "opsekos.h"
#include "Options.h"
21
#include "kstarsdata.h"
22
#include "ekosmanager.h"
23
#include "guide/guide.h"
24
#include "fov.h"
25

26
OpsEkos::OpsEkos()
27
        : QTabWidget( KStars::Instance() )
28
29
{
    setupUi(this);
30

31
32
33
    //Get a pointer to the KConfigDialog
    m_ConfigDialog = KConfigDialog::exists( "settings" );

Robert Lancaster's avatar
Robert Lancaster committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifdef Q_OS_OSX
connect(solverInternal, SIGNAL(clicked()), this, SLOT(toggleSolverInternal()));
solverInternal->setToolTip(i18n("Internal or External Plate Solver."));

connect(configInternal, SIGNAL(clicked()), this, SLOT(toggleConfigInternal()));
configInternal->setToolTip(i18n("Internal or External Astrometry.cfg."));

connect(wcsInternal, SIGNAL(clicked()), this, SLOT(toggleWCSInternal()));
wcsInternal->setToolTip(i18n("Internal or External WCS Info."));
#else
solverInternal->setVisible(false);
configInternal->setVisible(false);
wcsInternal->setVisible(false);
#endif

Jasem Mutlaq's avatar
Jasem Mutlaq committed
49
50
51
    connect( m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), SLOT( slotApply() ) );
    connect( m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL( clicked() ), SLOT( slotApply() ) );
    connect( m_ConfigDialog->button(QDialogButtonBox::Cancel), SIGNAL( clicked() ), SLOT( slotCancel() ) );
52
53
54
55
56
}


OpsEkos::~OpsEkos() {}

Robert Lancaster's avatar
Robert Lancaster committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
void OpsEkos::toggleSolverInternal()
{
    kcfg_astrometrySolver->setEnabled(!solverInternal->isChecked());
    if(solverInternal->isChecked())
        kcfg_astrometrySolver->setText("*Internal Solver*");
    else
        kcfg_astrometrySolver->setText("/usr/local/bin/solve-field");
}

void OpsEkos::toggleConfigInternal()
{
    kcfg_astrometryConfFile->setEnabled(!configInternal->isChecked());
    if(configInternal->isChecked())
        kcfg_astrometryConfFile->setText("*Internal astrometry.cfg*");
    else
        kcfg_astrometryConfFile->setText("/etc/astrometry.cfg");
}

void OpsEkos::toggleWCSInternal()
{
    kcfg_astrometryWCSInfo->setEnabled(!wcsInternal->isChecked());
    if(wcsInternal->isChecked())
        kcfg_astrometryWCSInfo->setText("*Internal wcsinfo*");
    else
        kcfg_astrometryWCSInfo->setText("/usr/local/bin/wcsinfo");
}

84
85
void OpsEkos::slotApply()
{
86
    EkosManager *ekosManager = KStars::Instance()->ekosManager();
87

88
    if (ekosManager)
89
    {
90
91
92
93
        Ekos::Align *alignModule = ekosManager->alignModule();

        if (alignModule && alignModule->fov())
            alignModule->fov()->setImageDisplay(kcfg_SolverWCS->isChecked());
94
    }
95
96
}