Kstars

opsekos.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "opsekos.h"
8
9#include "manager.h"
10#include "kstars.h"
11#include "kstarsdata.h"
12#include "Options.h"
13
14#include <KConfigDialog>
15#include <QFileDialog>
16
17OpsEkos::OpsEkos() : QTabWidget(KStars::Instance())
18{
19 setupUi(this);
20
21 //Get a pointer to the KConfigDialog
22 m_ConfigDialog = KConfigDialog::exists("settings");
23
24 connect(kcfg_EkosTopIcons, &QRadioButton::toggled, this, [this]()
25 {
26 if (Options::ekosTopIcons() != kcfg_EkosTopIcons->isChecked())
27 KSNotification::info(i18n("You must restart KStars for this change to take effect."));
28 });
29
30 if (Options::analyzeAlternativeImageDirectory().size() == 0)
31 Options::setAnalyzeAlternativeImageDirectory(QDir::homePath());
32
33 kcfg_AnalyzeAlternativeDirectoryName->setText(Options::analyzeAlternativeImageDirectory());
34
35 connect(analyzeAlternativeDirectoryB, &QPushButton::clicked, [this] ()
36 {
38 this, i18n("Set an alternate base directory for Analyze's captured images"),
41 if (dir.size() > 0)
42 {
43 Options::setAnalyzeAlternativeImageDirectory(dir);
44 kcfg_AnalyzeAlternativeDirectoryName->setText(Options::analyzeAlternativeImageDirectory());
45 }
46 });
47 connect(kcfg_AnalyzeAlternativeDirectoryName, &QLineEdit::editingFinished, [this] ()
48 {
49 const QString &text = kcfg_AnalyzeAlternativeDirectoryName->text();
50
51 QFileInfo newdir(text);
52 if (text.size() > 0 && newdir.exists() && newdir.isDir())
53 Options::setAnalyzeAlternativeImageDirectory(text);
54 else
55 kcfg_AnalyzeAlternativeDirectoryName->setText(Options::analyzeAlternativeImageDirectory());
56 });
57}
static KConfigDialog * exists(const QString &name)
This is the main window for KStars.
Definition kstars.h:89
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT QString dir(const QString &fileClass)
void clicked(bool checked)
void toggled(bool checked)
QString homePath()
QString getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, Options options)
void editingFinished()
qsizetype size() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.