Kstars

obslistpopupmenu.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Prakash Mohan <prakash.mohan@kdemail.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "obslistpopupmenu.h"
8
9#include "config-kstars.h"
10#include "kstars.h"
11#include "kstarsdata.h"
12#include "observinglist.h"
13
14ObsListPopupMenu::ObsListPopupMenu() : QMenu(nullptr)
15{
16}
17
18void ObsListPopupMenu::initPopupMenu(bool sessionView, bool multiSelection, bool showScope)
19{
20 KStarsData *ksdata = KStarsData::Instance();
21
22 clear();
23
24 //Insert item for adding the object to the session view
25 if (!sessionView)
26 {
27 addAction(i18n("Add to session plan"), ksdata->observingList(), SLOT(slotAddToSession()));
28 addAction(i18n("Add objects visible tonight to session plan"), ksdata->observingList(),
29 SLOT(slotAddVisibleObj()));
30#ifdef HAVE_INDI
31 addAction(i18n("Add to Ekos Scheduler"), ksdata->observingList(), SLOT(slotAddToEkosScheduler()));
32#endif
33 }
34
36
37 if (!multiSelection)
38 addAction(i18n("Center"), ksdata->observingList(),
39 SLOT(slotCenterObject())); //Insert item for centering on object
40
41 if (!multiSelection && showScope) // Insert item for slewing telescope
42 addAction(i18nc("Show the selected object in the telescope", "Scope"), ksdata->observingList(),
43 SLOT(slotSlewToObject()));
44
46
47 if (!multiSelection)
48 {
49 addAction(i18nc("Show Detailed Information Dialog", "Details"), ksdata->observingList(),
50 SLOT(slotDetails())); // Insert item for showing details dialog
51 }
52
53 //Insert item for opening the Altitude vs time dialog
54 addAction(i18n("Altitude vs. Time"), ksdata->observingList(), SLOT(slotAVT()));
55
57
58 //Insert item for downloading different images
59 if (!multiSelection)
60 {
61 if (ksdata->observingList()->currentObject() != nullptr &&
62 !ksdata->observingList()->currentObject()->isSolarSystem())
63 {
64 addAction(i18n("Show SDSS image"), ksdata->observingList(), SLOT(slotGetImage()));
65 addAction(i18n("Show DSS image"), ksdata->observingList(), SLOT(slotDSS()));
66 addAction(i18n("Customized DSS download"), ksdata->observingList(), SLOT(slotCustomDSS()));
67 }
68 addAction(i18n("Show images from web "), ksdata->observingList(), SLOT(slotSearchImage()));
70 }
71
72 //Insert item for Removing the object(s)
73 if (!sessionView)
74 addAction(i18n("Remove from WishList"), ksdata->observingList(), SLOT(slotRemoveSelectedObjects()));
75 else
76 addAction(i18n("Remove from Session Plan"), ksdata->observingList(), SLOT(slotRemoveSelectedObjects()));
77}
KStarsData is the backbone of KStars.
Definition kstarsdata.h:72
void initPopupMenu(bool sessionView, bool multiSelection, bool showScope)
Initialize the popup menus.
SkyObject * currentObject() const
bool isSolarSystem() const
Definition skyobject.h:217
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
QAction * addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut)
QAction * addSeparator()
void clear()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.