Kstars

pwizfovsh.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 "pwizfovsh.h"
8
9#include "kstars.h"
10#include "kstarsdata.h"
11#include "pwizobjectselection.h"
12#include "printingwizard.h"
13#include "dialogs/finddialog.h"
14#include "dialogs/detaildialog.h"
15
16#include <QPointer>
17
18PWizFovShUI::PWizFovShUI(PrintingWizard *wizard, QWidget *parent) : QFrame(parent), m_ParentWizard(wizard)
19{
20 setupUi(this);
21
22 setupWidgets();
23 setupConnections();
24}
25
27{
28 m_ParentWizard->setShBeginObject(obj);
29 objInfoLabel->setText(PWizObjectSelectionUI::objectInfoString(obj));
30 objInfoLabel->setVisible(true);
31 detailsButton->setVisible(true);
32 captureButton->setEnabled(true);
33}
34
35void PWizFovShUI::slotSelectFromList()
36{
37 if (FindDialog::Instance()->exec() == QDialog::Accepted)
38 {
39 SkyObject *obj = FindDialog::Instance()->targetObject();
40 if (obj)
41 {
42 setBeginObject(obj);
43 }
44 }
45}
46
47void PWizFovShUI::slotPointObject()
48{
49 m_ParentWizard->beginShBeginPointing();
50}
51
52void PWizFovShUI::slotDetails()
53{
54 if (m_ParentWizard->getShBeginObject())
55 {
56 QPointer<DetailDialog> detailDlg(new DetailDialog(m_ParentWizard->getShBeginObject(),
57 KStars::Instance()->data()->ut(),
58 KStars::Instance()->data()->geo(), this));
59 detailDlg->exec();
60 delete detailDlg;
61 }
62}
63
64void PWizFovShUI::slotBeginCapture()
65{
66 m_ParentWizard->beginShFovCapture();
67}
68
69void PWizFovShUI::setupWidgets()
70{
71 QStringList fovNames;
72 foreach (FOV *fov, KStarsData::Instance()->getAvailableFOVs())
73 {
74 fovNames.append(fov->name());
75 }
76 fovCombo->addItems(fovNames);
77
78 objInfoLabel->setVisible(false);
79 detailsButton->setVisible(false);
80 captureButton->setEnabled(false);
81}
82
83void PWizFovShUI::setupConnections()
84{
85 connect(selectFromListButton, SIGNAL(clicked()), this, SLOT(slotSelectFromList()));
86 connect(pointButton, SIGNAL(clicked()), this, SLOT(slotPointObject()));
87 connect(captureButton, SIGNAL(clicked()), this, SLOT(slotBeginCapture()));
88 connect(detailsButton, SIGNAL(clicked()), this, SLOT(slotDetails()));
89}
DetailDialog is a window showing detailed information for a selected object.
A simple class encapsulating a Field-of-View symbol.
Definition fov.h:28
SkyObject * targetObject()
Definition finddialog.h:53
const KStarsDateTime & ut() const
Definition kstarsdata.h:159
GeoLocation * geo()
Definition kstarsdata.h:232
static KStars * Instance()
Definition kstars.h:121
KStarsData * data() const
Definition kstars.h:133
void setBeginObject(SkyObject *obj)
Set object at which star hopper will begin.
Definition pwizfovsh.cpp:26
PWizFovShUI(PrintingWizard *wizard, QWidget *parent=nullptr)
Constructor.
Definition pwizfovsh.cpp:18
static QString objectInfoString(SkyObject *obj)
Static function: get QString with basic information about SkyObject.
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
SkyObject * getShBeginObject()
Get object at which star hopping will begin.
void setShBeginObject(SkyObject *obj)
Set SkyObject at which star hopper will begin.
void beginShBeginPointing()
Enter star hopping begin pointing mode.
void beginShFovCapture()
Capture FOV snapshots using star hopper-based method.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
void append(QList< T > &&value)
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 Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.