File indexing completed on 2024-04-28 15:09:03

0001 /*
0002     SPDX-FileCopyrightText: 2019 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "opsastap.h"
0008 
0009 #include "align.h"
0010 #include "fov.h"
0011 #include "kstars.h"
0012 #include "ksnotification.h"
0013 #include "Options.h"
0014 
0015 #include <KConfigDialog>
0016 #include <QProcess>
0017 
0018 namespace Ekos
0019 {
0020 OpsASTAP::OpsASTAP(Align *parent) : QWidget(KStars::Instance())
0021 {
0022     setupUi(this);
0023 
0024     alignModule = parent;
0025 
0026     //Get a pointer to the KConfigDialog
0027     m_ConfigDialog = KConfigDialog::exists("alignsettings");
0028 
0029     connect(m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(slotApply()));
0030     connect(m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(slotApply()));
0031     connect(selectASTAPExecB, &QPushButton::clicked, this, &OpsASTAP::slotSelectExecutable);
0032 }
0033 
0034 void OpsASTAP::slotApply()
0035 {
0036     emit settingsUpdated();
0037 }
0038 
0039 void OpsASTAP::slotSelectExecutable()
0040 {
0041     QUrl executable = QFileDialog::getOpenFileUrl(this, i18nc("@title:window", "Select ASTAP executable"), QUrl(),
0042                       "(astap astap.exe)");
0043     if (executable.isEmpty())
0044         return;
0045 
0046     kcfg_ASTAPExecutable->setText(executable.toLocalFile());
0047 }
0048 
0049 }