1 /*
2 SPDX-FileCopyrightText: 2019 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #include "opsastap.h"
8
9 #include "align.h"
10 #include "fov.h"
11 #include "kstars.h"
12 #include "ksnotification.h"
13 #include "Options.h"
14
15 #include <KConfigDialog>
16 #include <QProcess>
17
18 namespace Ekos
19 {
OpsASTAP(Align * parent)20 OpsASTAP::OpsASTAP(Align *parent) : QWidget(KStars::Instance())
21 {
22 setupUi(this);
23
24 alignModule = parent;
25
26 //Get a pointer to the KConfigDialog
27 m_ConfigDialog = KConfigDialog::exists("alignsettings");
28
29 connect(m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(slotApply()));
30 connect(m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(slotApply()));
31 connect(selectASTAPExecB, &QPushButton::clicked, this, &OpsASTAP::slotSelectExecutable);
32 }
33
slotApply()34 void OpsASTAP::slotApply()
35 {
36 emit settingsUpdated();
37 }
38
slotSelectExecutable()39 void OpsASTAP::slotSelectExecutable()
40 {
41 QUrl executable = QFileDialog::getOpenFileUrl(this, i18nc("@title:window", "Select ASTAP executable"), QUrl(), "(astap astap.exe)");
42 if (executable.isEmpty())
43 return;
44
45 kcfg_ASTAPExecutable->setText(executable.toLocalFile());
46 }
47
48 }
49