Kstars

kspopupmenu.cpp
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "kspopupmenu.h"
8
9#include "config-kstars.h"
10
11#include "kstars.h"
12#include "kstarsdata.h"
13#include "skymap.h"
14#include "skyobjects/skyobject.h"
15#include "skyobjects/starobject.h"
16#include "skyobjects/trailobject.h"
17#include "skyobjects/catalogobject.h"
18#include "skyobjects/ksmoon.h"
19#include "skyobjects/satellite.h"
20#include "skyobjects/supernova.h"
21#include "skycomponents/constellationboundarylines.h"
22#include "skycomponents/flagcomponent.h"
23#include "skycomponents/skymapcomposite.h"
24#include "skyobjectuserdata.h"
25#include "tools/whatsinteresting/wiview.h"
26#include "catalogsdb.h"
27#include "observinglist.h"
28
29#ifdef HAVE_INDI
30#include "indi/indilistener.h"
31#include "indi/guimanager.h"
32#include "indi/driverinfo.h"
33#include "indi/indistd.h"
34#include "indi/indidevice.h"
35#include "indi/indigroup.h"
36#include "indi/indiproperty.h"
37#include "indi/indielement.h"
38#include "indi/indimount.h"
39#include <basedevice.h>
40#endif
41
42#include <KLocalizedString>
43
44#include <QWidgetAction>
45
46namespace
47{
48// Convert magnitude to string representation for QLabel
49QString magToStr(double m)
50{
51 if (m > -30 && m < 90)
52 return QString("%1<sup>m</sup>").arg(m, 0, 'f', 2);
53 else
54 return QString();
55}
56
57// Return object name
58QString getObjectName(SkyObject *obj)
59{
60 // FIXME: make logic less convoluted.
61 if (obj->longname() != obj->name()) // Object has proper name
62 {
63 return obj->translatedLongName() + ", " + obj->translatedName();
64 }
65 else
66 {
67 if (!obj->translatedName2().isEmpty())
68 return obj->translatedName() + ", " + obj->translatedName2();
69 else
70 return obj->translatedName();
71 }
72}
73
74// String representation for rise/set time of object. If object
75// doesn't rise/set returns descriptive string.
76//
77// Second parameter choose between raise and set. 'true' for
78// raise, 'false' for set.
79QString riseSetTimeLabel(SkyObject *o, bool isRaise)
80{
81 KStarsData *data = KStarsData::Instance();
82 QTime t = o->riseSetTime(data->ut(), data->geo(), isRaise);
83 if (t.isValid())
84 {
85 //We can round to the nearest minute by simply adding 30 seconds to the time.
87 return isRaise ? i18n("Rise time: %1", time) :
88 i18nc("the time at which an object falls below the horizon",
89 "Set time: %1", time);
90 }
91 if (o->alt().Degrees() > 0)
92 return isRaise ? i18n("No rise time: Circumpolar") :
93 i18n("No set time: Circumpolar");
94 else
95 return isRaise ? i18n("No rise time: Never rises") :
96 i18n("No set time: Never rises");
97}
98
99// String representation for transit time for object
100QString transitTimeLabel(SkyObject *o)
101{
102 KStarsData *data = KStarsData::Instance();
103 QTime t = o->transitTime(data->ut(), data->geo());
104 if (t.isValid())
105 //We can round to the nearest minute by simply adding 30 seconds to the time.
106 return i18n("Transit time: %1",
108 else
109 return "--:--";
110}
111} // namespace
112
114 : QMenu(KStars::Instance()), m_CurrentFlagIdx(-1), m_EditActionMapping(nullptr),
115 m_DeleteActionMapping(nullptr)
116{
117}
118
120{
121 if (m_EditActionMapping)
122 {
123 delete m_EditActionMapping;
124 }
125
126 if (m_DeleteActionMapping)
127 {
128 delete m_DeleteActionMapping;
129 }
130}
131
133{
134 KStars *ks = KStars::Instance();
135 SkyObject o(SkyObject::TYPE_UNKNOWN, nullObj->ra(), nullObj->dec());
136 o.setAlt(nullObj->alt());
137 o.setAz(nullObj->az());
138 initPopupMenu(&o, i18n("Empty sky"), QString(), QString(), false, false);
139 addAction(i18nc("Sloan Digital Sky Survey", "Show SDSS Image"), ks->map(),
140 SLOT(slotSDSS()));
141 addAction(i18nc("Digitized Sky Survey", "Show DSS Image"), ks->map(),
142 SLOT(slotDSS()));
143}
144
145void KSPopupMenu::slotEditFlag()
146{
147 if (m_CurrentFlagIdx != -1)
148 {
149 KStars::Instance()->map()->slotEditFlag(m_CurrentFlagIdx);
150 }
151}
152
153void KSPopupMenu::slotDeleteFlag()
154{
155 if (m_CurrentFlagIdx != -1)
156 {
157 KStars::Instance()->map()->slotDeleteFlag(m_CurrentFlagIdx);
158 }
159}
160
161void KSPopupMenu::slotEditFlag(QAction *action)
162{
163 int idx = m_EditActionMapping->value(action, -1);
164
165 if (idx == -1)
166 {
167 return;
168 }
169
170 else
171 {
173 }
174}
175
176void KSPopupMenu::slotDeleteFlag(QAction *action)
177{
178 int idx = m_DeleteActionMapping->value(action, -1);
179
180 if (idx == -1)
181 {
182 return;
183 }
184
185 else
186 {
188 }
189}
190
192{
193 KStars *ks = KStars::Instance();
194 //Add name, rise/set time, center/track, and detail-window items
195 QString name;
196 if (star->name() != "star")
197 {
198 name = star->translatedLongName();
199 }
200 else
201 {
202 if (star->getHDIndex())
203 {
204 name = QString("HD%1").arg(QString::number(star->getHDIndex()));
205 }
206 else
207 {
208 // FIXME: this should be some catalog name too
209 name = "Star";
210 }
211 }
212 initPopupMenu(star, name, i18n("star"),
213 i18n("%1<sup>m</sup>, %2", star->mag(), star->sptype()));
214 //If the star is named, add custom items to popup menu based on object's ImageList and InfoList
215 if (star->name() != "star")
216 {
217 addLinksToMenu(star);
218 }
219 else
220 {
221 addAction(i18nc("Sloan Digital Sky Survey", "Show SDSS Image"), ks->map(),
222 SLOT(slotSDSS()));
223 addAction(i18nc("Digitized Sky Survey", "Show DSS Image"), ks->map(),
224 SLOT(slotDSS()));
225 }
226}
227
229{
230 QString name = getObjectName(obj);
231 QString typeName = obj->typeName();
232
233 QString info = QString("%1<br>Catalog: %2")
234 .arg(magToStr(obj->mag()))
235 .arg(obj->getCatalog().name);
236
237 if (obj->a() > 0)
238 {
239 float a = obj->a();
240 float b = obj->b() > 0 ? obj->b() : obj->a(); // Assume circular if a != 0 but b == 0
241 info += QString("<br>%1′×%2′").arg(a).arg(b);
242 }
243
244 initPopupMenu(obj, name, typeName, info);
245 addLinksToMenu(obj);
246}
247
249{
250 QString info = magToStr(p->mag());
251 QString type = i18n("Solar system object");
252 initPopupMenu(p, p->translatedName(), type, info);
253 addLinksToMenu(p, false); //don't offer DSS images for planets
254}
255
256void KSPopupMenu::createMoonMenu(KSMoon *moon)
257{
258 QString info = QString("%1, %2").arg(magToStr(moon->mag()), moon->phaseName());
259 initPopupMenu(moon, moon->translatedName(), QString(), info);
260 addLinksToMenu(moon, false); //don't offer DSS images for planets
261}
262
264{
265 KStars *ks = KStars::Instance();
266 QString velocity, altitude, range;
267 velocity.setNum(satellite->velocity());
268 altitude.setNum(satellite->altitude());
269 range.setNum(satellite->range());
270
271 clear();
272
273 addFancyLabel(satellite->name());
274 addFancyLabel(satellite->id());
275 addFancyLabel(i18n("satellite"));
276 addFancyLabel(KStarsData::Instance()
277 ->skyComposite()
278 ->constellationBoundary()
279 ->constellationName(satellite));
280
281 addSeparator();
282
283 addFancyLabel(i18n("Velocity: %1 km/s", velocity), -2);
284 addFancyLabel(i18n("Altitude: %1 km", altitude), -2);
285 addFancyLabel(i18n("Range: %1 km", range), -2);
286
287 addSeparator();
288
289 //Insert item for centering on object
290 addAction(QIcon::fromTheme("snap-nodes-center"), i18n("Center && Track"), ks->map(),
291 SLOT(slotCenter()));
292 //Insert item for measuring distances
293 //FIXME: add key shortcut to menu items properly!
294 addAction(QIcon::fromTheme("kruler-east"),
295 i18n("Angular Distance To... ["), ks->map(),
296 SLOT(slotBeginAngularDistance()));
297 addAction(QIcon::fromTheme("show-path-outline"),
298 i18n("Starhop from here to... "), ks->map(),
299 SLOT(slotBeginStarHop()));
300 addAction(QIcon::fromTheme("edit-copy"), i18n("Copy TLE to Clipboard"), ks->map(),
301 SLOT(slotCopyTLE()));
302
303 //Insert "Add/Remove Label" item
304 if (ks->map()->isObjectLabeled(satellite))
305 addAction(QIcon::fromTheme("list-remove"), i18n("Remove Label"), ks->map(),
306 SLOT(slotRemoveObjectLabel()));
307 else
308 addAction(QIcon::fromTheme("label"), i18n("Attach Label"), ks->map(),
309 SLOT(slotAddObjectLabel()));
310
311 addSeparator();
312 addINDI();
313}
314
316{
317 QString name = supernova->name();
318 float mag = supernova->mag();
319 float z = supernova->getRedShift();
320 QString type = supernova->getType();
321
322 QString info;
323
324 if (mag < 99)
325 info += QString("%1<sup>m</sup> ").arg(mag);
326 info += type;
327 if (z < 99)
328 info += QString(" z: %1").arg(QString::number(z, 'f', 2));
329
330 initPopupMenu(supernova, name, i18n("supernova"), info);
331}
332
333void KSPopupMenu::initPopupMenu(SkyObject *obj, const QString &name, const QString &type,
334 QString info, bool showDetails, bool showObsList,
335 bool showFlags)
336{
337 KStarsData *data = KStarsData::Instance();
338 SkyMap *map = SkyMap::Instance();
339
340 clear();
341 bool showLabel = (name != i18n("star") && !name.isEmpty());
342 QString Name = name;
343
344 if (Name.isEmpty())
345 Name = i18n("Empty sky");
346
347 addFancyLabel(Name);
348 addFancyLabel(type);
349 addFancyLabel(info);
350 addFancyLabel(KStarsData::Instance()
351 ->skyComposite()
352 ->constellationBoundary()
353 ->constellationName(obj));
354
355 //Insert Rise/Set/Transit labels
356 SkyObject *o = obj->clone();
357 addSeparator();
358 addFancyLabel(riseSetTimeLabel(o, true), -2);
359 addFancyLabel(riseSetTimeLabel(o, false), -2);
360 addFancyLabel(transitTimeLabel(o), -2);
361 addSeparator();
362 delete o;
363
364 // Show 'Select this object' item when in object pointing mode and when obj is not empty sky
365 if (map->isInObjectPointingMode() && obj->type() != 21)
366 {
367 addAction(i18n("Select this object"), map, SLOT(slotObjectSelected()));
368 }
369
370 //Insert item for centering on object
371 addAction(QIcon::fromTheme("snap-nodes-center"), i18n("Center && Track"), map,
372 SLOT(slotCenter()));
373
374 if (showFlags)
375 {
376 //Insert actions for flag operations
377 initFlagActions(obj);
378 }
379
380 //Insert item for measuring distances
381 //FIXME: add key shortcut to menu items properly!
382 addAction(QIcon::fromTheme("kruler-east"),
383 i18n("Angular Distance To... ["), map,
384 SLOT(slotBeginAngularDistance()));
385 addAction(QIcon::fromTheme("show-path-outline"),
386 i18n("Starhop from here to... "), map, SLOT(slotBeginStarHop()));
387
388 //Insert item for Showing details dialog
389 if (showDetails)
390 addAction(QIcon::fromTheme("view-list-details"),
391 i18nc("Show Detailed Information Dialog", "Details"), map,
392 SLOT(slotDetail()));
393
394 addAction(QIcon::fromTheme("edit-copy"), i18n("Copy Coordinates"), map,
395 SLOT(slotCopyCoordinates()));
396
397 //Insert "Add/Remove Label" item
398 if (showLabel)
399 {
400 if (map->isObjectLabeled(obj))
401 {
402 addAction(QIcon::fromTheme("list-remove"), i18n("Remove Label"), map,
403 SLOT(slotRemoveObjectLabel()));
404 }
405 else
406 {
407 addAction(QIcon::fromTheme("label"), i18n("Attach Label"), map,
408 SLOT(slotAddObjectLabel()));
409 }
410 }
411 // Should show observing list
412 if (showObsList)
413 {
414 if (data->observingList()->contains(obj))
415 addAction(QIcon::fromTheme("list-remove"),
416 i18n("Remove From Observing WishList"), data->observingList(),
417 SLOT(slotRemoveObject()));
418 else
419 addAction(QIcon::fromTheme("bookmarks"), i18n("Add to Observing WishList"),
420 data->observingList(), SLOT(slotAddObject()));
421 }
422 // Should we show trail actions
423 TrailObject *t = dynamic_cast<TrailObject *>(obj);
424 if (t)
425 {
426 if (t->hasTrail())
427 addAction(i18n("Remove Trail"), map, SLOT(slotRemovePlanetTrail()));
428 else
429 addAction(i18n("Add Trail"), map, SLOT(slotAddPlanetTrail()));
430 }
431
432 addSeparator();
433 if (obj->isSolarSystem() &&
434 obj->type() !=
435 SkyObject::
436 COMET) // FIXME: We now have asteroids -- so should this not be isMajorPlanet() || Pluto?
437 {
438 addAction(i18n("View in XPlanet"), map, SLOT(slotStartXplanetViewer()));
439 }
440 addSeparator();
441 addINDI();
442
443 addAction(QIcon::fromTheme("view-list-details"), i18n("View in What's Interesting"),
444 this, SLOT(slotViewInWI()));
445}
446
447void KSPopupMenu::initFlagActions(SkyObject *obj)
448{
449 KStars *ks = KStars::Instance();
450
451 QList<int> flags = ks->data()->skyComposite()->flags()->getFlagsNearPix(obj, 5);
452
453 if (flags.isEmpty())
454 {
455 // There is no flag around clicked SkyObject
456 addAction(QIcon::fromTheme("flag"), i18n("Add Flag (nearby object)..."), ks->map(),
457 SLOT(slotAddFlag()));
458 addAction(QIcon::fromTheme("flag"), i18n("Add Flag (exactly here)..."), ks->map(),
459 SLOT(slotAddFlagRaw()));
460 }
461
462 else if (flags.size() == 1)
463 {
464 // There is only one flag around clicked SkyObject
465 addAction(QIcon::fromTheme("document-edit"), i18n("Edit Flag"), this,
466 SLOT(slotEditFlag()));
467 addAction(QIcon::fromTheme("delete"), i18n("Delete Flag"), this,
468 SLOT(slotDeleteFlag()));
469
470 m_CurrentFlagIdx = flags.first();
471 }
472
473 else
474 {
475 // There are more than one flags around clicked SkyObject - we need to create submenus
476 QMenu *editMenu = new QMenu(i18n("Edit Flag..."), KStars::Instance());
477 editMenu->setIcon(QIcon::fromTheme("document-edit"));
478 QMenu *deleteMenu = new QMenu(i18n("Delete Flag..."), KStars::Instance());
479 deleteMenu->setIcon(QIcon::fromTheme("delete"));
480
481 connect(editMenu, SIGNAL(triggered(QAction *)), this,
482 SLOT(slotEditFlag(QAction *)));
483 connect(deleteMenu, SIGNAL(triggered(QAction *)), this,
484 SLOT(slotDeleteFlag(QAction *)));
485
486 if (m_EditActionMapping)
487 {
488 delete m_EditActionMapping;
489 }
490
491 if (m_DeleteActionMapping)
492 {
493 delete m_DeleteActionMapping;
494 }
495
496 m_EditActionMapping = new QHash<QAction *, int>;
497 m_DeleteActionMapping = new QHash<QAction *, int>;
498
499 foreach (int idx, flags)
500 {
501 QIcon flagIcon(
502 QPixmap::fromImage(ks->data()->skyComposite()->flags()->image(idx)));
503
504 QString flagLabel = ks->data()->skyComposite()->flags()->label(idx);
505 if (flagLabel.size() > 35)
506 {
507 flagLabel = flagLabel.left(35);
508 flagLabel.append("...");
509 }
510
511 QAction *editAction = new QAction(flagIcon, flagLabel, ks);
512 editAction->setIconVisibleInMenu(true);
513 editMenu->addAction(editAction);
514 m_EditActionMapping->insert(editAction, idx);
515
516 QAction *deleteAction = new QAction(flagIcon, flagLabel, ks);
517 deleteAction->setIconVisibleInMenu(true);
518 deleteMenu->addAction(deleteAction);
519 m_DeleteActionMapping->insert(deleteAction, idx);
520 }
521
522 addMenu(editMenu);
523 addMenu(deleteMenu);
524 }
525}
526
528{
529 KStars *ks = KStars::Instance();
530
531 const auto &user_data = KStarsData::Instance()->getUserData(obj->name());
532 const auto &image_list = user_data.images();
533 const auto &website_list = user_data.websites();
534 for (const auto &res : std::list <
535 std::tuple<QString, SkyObjectUserdata::LinkList, SkyObjectUserdata::Type >>
536{
537 { i18n("Image Resources"), image_list, SkyObjectUserdata::Type::image },
538 { i18n("Web Links"), website_list, SkyObjectUserdata::Type::website }
539 })
540 {
541 const auto &title = std::get<0>(res);
542 const auto &list = std::get<1>(res);
543 const auto &type = std::get<2>(res);
544
545 if (!list.empty())
546 {
547 QMenu *LinkSubMenu = new QMenu();
548 LinkSubMenu->setTitle(title);
549 for (const auto &entry : list)
550 {
551 QString t = QString(entry.title);
552 QAction *action;
553 if (type == SkyObjectUserdata::Type::website)
554 action = LinkSubMenu->addAction(
555 i18nc("Image/info menu item (should be translated)",
556 t.toLocal8Bit()),
557 ks->map(), SLOT(slotInfo()));
558 else
559 action = LinkSubMenu->addAction(
560 i18nc("Image/info menu item (should be translated)",
561 t.toLocal8Bit()),
562 ks->map(), SLOT(slotImage()));
563
564 action->setData(entry.url);
565 }
566 addMenu(LinkSubMenu);
567 }
568 }
569
570 // Look for a custom object
571 {
572 auto *object = dynamic_cast<CatalogObject *>(obj);
573 if (object)
574 {
575 CatalogsDB::DBManager manager{ CatalogsDB::dso_db_path() };
576
577 if (object->getCatalog().mut &&
578 manager.get_object(object->getObjectId()).first)
579 {
580 addAction(i18n("Remove From Local Catalog"), ks->map(),
581 SLOT(slotRemoveCustomObject()));
582 }
583 }
584 }
585
586 if (showDSS)
587 {
588 addAction(i18nc("Sloan Digital Sky Survey", "Show SDSS Image"), ks->map(),
589 SLOT(slotSDSS()));
590 addAction(i18nc("Digitized Sky Survey", "Show DSS Image"), ks->map(),
591 SLOT(slotDSS()));
592 }
593
594 if (showDSS)
595 addSeparator();
596}
597
598void KSPopupMenu::addINDI()
599{
600#ifdef HAVE_INDI
601 if (INDIListener::Instance()->size() == 0)
602 return;
603
604 for (auto &oneDevice : INDIListener::devices())
605 {
606 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
607 continue;
608
609
610 auto mount = oneDevice->getMount();
611 if (!mount)
612 continue;
613
614 QMenu *mountMenu = new QMenu(mount->getDeviceName());
615 mountMenu->setIcon(QIcon::fromTheme("kstars"));
616 addMenu(mountMenu);
617
618 if (mount->canGoto() || mount->canSync())
619 {
620 if (mount->canGoto())
621 {
622 QAction *a = mountMenu->addAction(QIcon::fromTheme("object-rotate-right"),
623 i18nc("Move mount to target", "Goto"));
624 a->setEnabled(!mount->isParked());
626 [mount] { mount->Slew(SkyMap::Instance()->clickedPoint()); });
627 }
628 if (mount->canSync())
629 {
630 QAction *a =
631 mountMenu->addAction(QIcon::fromTheme("media-record"),
632 i18nc("Synchronize mount to target", "Sync"));
633 a->setEnabled(!mount->isParked());
635 [mount] { mount->Sync(SkyMap::Instance()->clickedPoint()); });
636 }
637
638 mountMenu->addSeparator();
639 }
640
641 if (mount->canAbort())
642 {
643 QAction *a =
644 mountMenu->addAction(QIcon::fromTheme("process-stop"), i18n("Abort"));
645 a->setEnabled(!mount->isParked());
646 connect(a, &QAction::triggered, [mount] { mount->abort(); });
647 mountMenu->addSeparator();
648 }
649
650 if (mount->canPark())
651 {
652 QAction *park =
653 mountMenu->addAction(QIcon::fromTheme("flag-red"), i18n("Park"));
654 park->setEnabled(!mount->isParked());
655 connect(park, &QAction::triggered, [mount] { mount->park(); });
656
657 QAction *unpark =
658 mountMenu->addAction(QIcon::fromTheme("flag-green"), i18n("UnPark"));
659 unpark->setEnabled(mount->isParked());
660 connect(unpark, &QAction::triggered, [mount] { mount->unpark(); });
661
662 mountMenu->addSeparator();
663 }
664
665 const SkyObject *clickedObject = KStars::Instance()->map()->clickedObject();
666 if (clickedObject && clickedObject->type() == SkyObject::SATELLITE &&
667 (mount->canTrackSatellite()))
668 {
669 const Satellite *sat = dynamic_cast<const Satellite *>(clickedObject);
670 const KStarsDateTime currentTime = KStarsData::Instance()->ut();
671 const KStarsDateTime currentTimePlusOne = currentTime.addSecs(60);
672 QAction *a =
673 mountMenu->addAction(QIcon::fromTheme("arrow"), i18n("Track satellite"));
674 a->setEnabled(!mount->isParked());
676 [mount, sat, currentTime, currentTimePlusOne]
677 {
678 mount->setSatelliteTLEandTrack(sat->tle(), currentTime,
679 currentTimePlusOne);
680 });
681 mountMenu->addSeparator();
682 }
683
684 if (mount->canCustomPark())
685 {
686 QAction *a = mountMenu->addAction(QIcon::fromTheme("go-jump-declaration"),
687 i18n("Goto && Set As Parking Position"));
688 a->setEnabled(!mount->isParked());
690 [mount] { mount->setCustomParking(); });
691 }
692
693 QAction *a =
694 mountMenu->addAction(QIcon::fromTheme("edit-find"), i18n("Find Telescope"));
696 [mount] { mount->find(); });
697 }
698#endif
699}
700
701void KSPopupMenu::addFancyLabel(const QString &name, int deltaFontSize)
702{
703 if (name.isEmpty())
704 return;
705 QLabel *label = new QLabel("<b>" + name + "</b>", this);
706 label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
707 if (deltaFontSize != 0)
708 {
709 QFont font = label->font();
710 font.setPointSize(font.pointSize() + deltaFontSize);
711 label->setFont(font);
712 }
713 QWidgetAction *act = new QWidgetAction(this);
714 act->setDefaultWidget(label);
715 addAction(act);
716}
717
718void KSPopupMenu::slotViewInWI()
719{
720 if (!KStars::Instance()->map()->clickedObject())
721 return;
722 if (!KStars::Instance()->isWIVisible())
724 KStars::Instance()->wiView()->inspectSkyObject(
725 KStars::Instance()->map()->clickedObject());
726}
A simple container object to hold the minimum information for a Deep Sky Object to be drawn on the sk...
float a() const
const CatalogsDB::Catalog getCatalog() const
Get information about the catalog that this objects stems from.
float b() const
Manages the catalog database and provides an interface to provide an interface to query and modify th...
Definition catalogsdb.h:183
QString label(int index)
Get label.
QList< int > getFlagsNearPix(SkyPoint *point, int pixelRadius)
Get list of flag indexes near specified SkyPoint with radius specified in pixels.
QImage image(int index)
Get image.
Provides necessary information about the Moon.
Definition ksmoon.h:26
QString phaseName() const
Definition ksmoon.cpp:288
void createPlanetMenu(SkyObject *p)
Create a popup menu for a solar system body.
void createCatalogObjectMenu(CatalogObject *obj)
Create a popup menu for a deep-sky catalog object.
void createEmptyMenu(SkyPoint *nullObj)
Create a popup menu for empty sky.
void createSupernovaMenu(Supernova *supernova)
Create a popup menu for a supernova.
void createSatelliteMenu(Satellite *satellite)
Create a popup menu for a satellite.
void addLinksToMenu(SkyObject *obj, bool showDSS=true)
Add an item to the popup menu for each of the URL links associated with this object.
~KSPopupMenu() override
Destructor (empty)
void createStarMenu(StarObject *star)
Create a popup menu for a star.
KSPopupMenu()
Default constructor.
KStarsData is the backbone of KStars.
Definition kstarsdata.h:74
const SkyObjectUserdata::Data & getUserData(const QString &name)
Get a reference to the user data of an object with the name name.
const KStarsDateTime & ut() const
Definition kstarsdata.h:159
GeoLocation * geo()
Definition kstarsdata.h:232
SkyMapComposite * skyComposite()
Definition kstarsdata.h:168
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
KStarsDateTime addSecs(double s) const
This is the main window for KStars.
Definition kstars.h:89
SkyMap * map() const
Definition kstars.h:139
static KStars * Instance()
Definition kstars.h:121
void slotToggleWIView()
action slot: toggle What's Interesting window
KStarsData * data() const
Definition kstars.h:133
bool contains(const SkyObject *o, bool session=false)
Represents an artificial satellites.
Definition satellite.h:23
double range() const
QString id() const
double altitude() const
double velocity() const
QString tle() const
This is the canvas on which the sky is painted.
Definition skymap.h:54
SkyObject * clickedObject() const
Retrieve the object nearest to a mouse click event.
Definition skymap.h:244
bool isObjectLabeled(SkyObject *o)
Definition skymap.cpp:840
void slotEditFlag(int flagIdx)
Open Flag Manager window with selected flag focused and ready to edit.
Definition skymap.cpp:798
void slotDeleteFlag(int flagIdx)
Delete selected flag.
Definition skymap.cpp:807
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
virtual SkyObject * clone() const
Create copy of object.
Definition skyobject.cpp:50
QString translatedName() const
Definition skyobject.h:149
virtual QString name(void) const
Definition skyobject.h:146
QString translatedName2() const
Definition skyobject.h:160
QString translatedLongName() const
Definition skyobject.h:170
bool isSolarSystem() const
Definition skyobject.h:218
virtual QString longname(void) const
Definition skyobject.h:165
QTime transitTime(const KStarsDateTime &dt, const GeoLocation *geo) const
The same iteration technique described in riseSetTime() is used here.
QTime riseSetTime(const KStarsDateTime &dt, const GeoLocation *geo, bool rst, bool exact=true) const
Determine the time at which the point will rise or set.
Definition skyobject.cpp:93
static QString typeName(const int t)
int type(void) const
Definition skyobject.h:189
float mag() const
Definition skyobject.h:207
The sky coordinates of a point in the sky.
Definition skypoint.h:45
const CachingDms & dec() const
Definition skypoint.h:269
const CachingDms & ra() const
Definition skypoint.h:263
const dms & az() const
Definition skypoint.h:275
void setAlt(dms alt)
Sets Alt, the Altitude.
Definition skypoint.h:194
const dms & alt() const
Definition skypoint.h:281
void setAz(dms az)
Sets Az, the Azimuth.
Definition skypoint.h:230
This is a subclass of SkyObject.
Definition starobject.h:33
QString name(void) const override
If star is unnamed return "star" otherwise return the name.
Definition starobject.h:130
int getHDIndex() const
Definition starobject.h:254
QString sptype(void) const
Returns entire spectral type string.
Represents the supernova object.
Definition supernova.h:34
QString getType() const
Definition supernova.h:48
float getRedShift() const
Definition supernova.h:57
provides a SkyObject with an attachable Trail
Definition trailobject.h:22
bool hasTrail() const
Definition trailobject.h:36
const double & Degrees() const
Definition dms.h:141
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
KIOCORE_EXPORT SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
QString name(StandardAction id)
QString label(StandardShortcut id)
void setEnabled(bool)
void setIconVisibleInMenu(bool visible)
void setData(const QVariant &data)
void triggered(bool checked)
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
QIcon fromTheme(const QString &name)
bool empty() const const
T & first()
bool isEmpty() const const
qsizetype size() const const
QString toString(QDate date, FormatType format) const const
QAction * addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut)
QMenu(QWidget *parent)
QAction * addMenu(QMenu *menu)
QAction * addSeparator()
void clear()
void setIcon(const QIcon &icon)
void triggered(QAction *action)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QPixmap fromImage(QImage &&image, Qt::ImageConversionFlags flags)
QString & append(QChar ch)
QString arg(Args &&... args) const const
bool isEmpty() const const
QString left(qsizetype n) const const
QString number(double n, char format, int precision)
QString & setNum(double n, char format, int precision)
qsizetype size() const const
QByteArray toLocal8Bit() const const
AlignHCenter
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QTime addSecs(int s) const const
bool isValid(int h, int m, int s, int ms)
void setDefaultWidget(QWidget *widget)
QString name
The catalog mame.
Definition catalogsdb.h:46
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.