Kstars

obslistpopupmenu.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Prakash Mohan <[email protected]>
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 
14 ObsListPopupMenu::ObsListPopupMenu() : QMenu(nullptr)
15 {
16 }
17 
18 void 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 
35  addSeparator();
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 
45  addSeparator();
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  addAction(i18n("Eyepiece view"), ksdata->observingList(),
52  SLOT(slotEyepieceView())); // Insert item for showing eyepiece view
53  }
54 
55  //Insert item for opening the Altitude vs time dialog
56  addAction(i18n("Altitude vs. Time"), ksdata->observingList(), SLOT(slotAVT()));
57 
58  addSeparator();
59 
60  //Insert item for downloading different images
61  if (!multiSelection)
62  {
63  if (ksdata->observingList()->currentObject() != nullptr &&
64  !ksdata->observingList()->currentObject()->isSolarSystem())
65  {
66  addAction(i18n("Show SDSS image"), ksdata->observingList(), SLOT(slotGetImage()));
67  addAction(i18n("Show DSS image"), ksdata->observingList(), SLOT(slotDSS()));
68  addAction(i18n("Customized DSS download"), ksdata->observingList(), SLOT(slotCustomDSS()));
69  }
70  addAction(i18n("Show images from web "), ksdata->observingList(), SLOT(slotSearchImage()));
71  addSeparator();
72  }
73 
74  //Insert item for Removing the object(s)
75  if (!sessionView)
76  addAction(i18n("Remove from WishList"), ksdata->observingList(), SLOT(slotRemoveSelectedObjects()));
77  else
78  addAction(i18n("Remove from Session Plan"), ksdata->observingList(), SLOT(slotRemoveSelectedObjects()));
79 }
QAction * addSeparator()
void initPopupMenu(bool sessionView, bool multiSelection, bool showScope)
Initialize the popup menus.
QAction * addAction(const QString &text)
QString i18n(const char *text, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void clear()
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:13:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.