Kstars

pwizfovconfig.cpp
1/*
2 SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "pwizfovconfig.h"
8#include <KLocalizedString>
9
11{
12 setupUi(this);
13 setupWidgets();
14
15 connect(addLegendBox, SIGNAL(toggled(bool)), this, SLOT(slotUpdateLegendFields(bool)));
16}
17
18Legend::LEGEND_TYPE PWizFovConfigUI::getLegendType()
19{
20 switch (typeCombo->currentIndex())
21 {
22 case 0: // Scale with magnitudes chart
23 {
24 return Legend::LT_SCALE_MAGNITUDES;
25 }
26
27 case 1: // Only scale
28 {
29 return Legend::LT_SCALE_ONLY;
30 }
31
32 case 2: // Only magnitudes chart
33 {
34 return Legend::LT_MAGNITUDES_ONLY;
35 }
36
37 default:
38 {
39 return Legend::LT_FULL;
40 }
41 }
42}
43
44void PWizFovConfigUI::slotUpdateLegendFields(bool enabled)
45{
46 useAlphaBlendBox->setEnabled(enabled);
47 typeCombo->setEnabled(enabled);
48 orientationCombo->setEnabled(enabled);
49 positionCombo->setEnabled(enabled);
50}
51
52void PWizFovConfigUI::setupWidgets()
53{
54 QStringList types;
55 types << i18n("Scale with magnitudes chart") << i18n("Only scale") << i18n("Only magnitudes chart");
56 typeCombo->addItems(types);
57
58 orientationCombo->addItem(i18n("Horizontal"));
59 orientationCombo->addItem(i18n("Vertical"));
60
61 QStringList positions;
62 positions << i18n("Upper left corner") << i18n("Upper right corner") << i18n("Lower left corner")
63 << i18n("Lower right corner");
64 positionCombo->addItems(positions);
65
66 useAlphaBlendBox->setEnabled(false);
67 typeCombo->setEnabled(false);
68 orientationCombo->setEnabled(false);
69 positionCombo->setEnabled(false);
70}
Legend::LEGEND_TYPE getLegendType()
Get selected legend type.
PWizFovConfigUI(QWidget *parent=nullptr)
Constructor.
QString i18n(const char *text, const TYPE &arg...)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setupUi(QWidget *widget)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.