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

0001 /*
0002     SPDX-FileCopyrightText: 2003 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "opsdither.h"
0008 
0009 #include "Options.h"
0010 #include "kstars.h"
0011 #include "auxiliary/ksnotification.h"
0012 
0013 #include <KConfigDialog>
0014 
0015 #include <QCheckBox>
0016 #include <QComboBox>
0017 #include <QFileDialog>
0018 #include <QPushButton>
0019 #include <QStringList>
0020 
0021 namespace Ekos
0022 {
0023 OpsDither::OpsDither() : QFrame(KStars::Instance())
0024 {
0025     setupUi(this);
0026 
0027     //Get a pointer to the KConfigDialog
0028     m_ConfigDialog = KConfigDialog::exists("guidesettings");
0029 
0030     connect(kcfg_DitherNoGuiding, &QCheckBox::toggled, this, [&](bool checked)
0031     {
0032         if (checked && kcfg_DitherEnabled->isChecked())
0033         {
0034             KSNotification::error("Guided dithering cannot be used along with non-guided dithering.");
0035             kcfg_DitherEnabled->setChecked(false);
0036         }
0037     });
0038 
0039     connect(kcfg_DitherEnabled, &QCheckBox::toggled, this, [&](bool checked)
0040     {
0041         if (checked && kcfg_DitherNoGuiding->isChecked())
0042         {
0043             KSNotification::error("Guided dithering cannot be used along with non-guided dithering.");
0044             kcfg_DitherNoGuiding->setChecked(false);
0045         }
0046     });
0047 
0048     connect(kcfg_DitherWithOnePulse, &QCheckBox::toggled, this, [&](bool checked)
0049     {
0050         kcfg_DitherMaxIterations->setEnabled(!checked);
0051     });
0052 
0053     connect(m_ConfigDialog, SIGNAL(settingsChanged(QString)), this, SIGNAL(settingsUpdated()));
0054 
0055 }
0056 
0057 }