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
132void KSPopupMenu::createEmptyMenu(SkyPoint *nullObj)
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..."), ks->map(),
457 SLOT(slotAddFlag()));
458 }
459
460 else if (flags.size() == 1)
461 {
462 // There is only one flag around clicked SkyObject
463 addAction(QIcon::fromTheme("document-edit"), i18n("Edit Flag"), this,
464 SLOT(slotEditFlag()));
465 addAction(QIcon::fromTheme("delete"), i18n("Delete Flag"), this,
466 SLOT(slotDeleteFlag()));
467
468 m_CurrentFlagIdx = flags.first();
469 }
470
471 else
472 {
473 // There are more than one flags around clicked SkyObject - we need to create submenus
474 QMenu *editMenu = new QMenu(i18n("Edit Flag..."), KStars::Instance());
475 editMenu->setIcon(QIcon::fromTheme("document-edit"));
476 QMenu *deleteMenu = new QMenu(i18n("Delete Flag..."), KStars::Instance());
477 deleteMenu->setIcon(QIcon::fromTheme("delete"));
478
479 connect(editMenu, SIGNAL(triggered(QAction *)), this,
480 SLOT(slotEditFlag(QAction *)));
481 connect(deleteMenu, SIGNAL(triggered(QAction *)), this,
482 SLOT(slotDeleteFlag(QAction *)));
483
484 if (m_EditActionMapping)
485 {
486 delete m_EditActionMapping;
487 }
488
489 if (m_DeleteActionMapping)
490 {
491 delete m_DeleteActionMapping;
492 }
493
494 m_EditActionMapping = new QHash<QAction *, int>;
495 m_DeleteActionMapping = new QHash<QAction *, int>;
496
497 foreach (int idx, flags)
498 {
499 QIcon flagIcon(
500 QPixmap::fromImage(ks->data()->skyComposite()->flags()->image(idx)));
501
502 QString flagLabel = ks->data()->skyComposite()->flags()->label(idx);
503 if (flagLabel.size() > 35)
504 {
505 flagLabel = flagLabel.left(35);
506 flagLabel.append("...");
507 }
508
509 QAction *editAction = new QAction(flagIcon, flagLabel, ks);
510 editAction->setIconVisibleInMenu(true);
511 editMenu->addAction(editAction);
512 m_EditActionMapping->insert(editAction, idx);
513
514 QAction *deleteAction = new QAction(flagIcon, flagLabel, ks);
515 deleteAction->setIconVisibleInMenu(true);
516 deleteMenu->addAction(deleteAction);
517 m_DeleteActionMapping->insert(deleteAction, idx);
518 }
519
520 addMenu(editMenu);
521 addMenu(deleteMenu);
522 }
523}
524
526{
527 KStars *ks = KStars::Instance();
528
529 const auto &user_data = KStarsData::Instance()->getUserData(obj->name());
530 const auto &image_list = user_data.images();
531 const auto &website_list = user_data.websites();
532 for (const auto &res : std::list <
533 std::tuple<QString, SkyObjectUserdata::LinkList, SkyObjectUserdata::Type >>
534{
535 { i18n("Image Resources"), image_list, SkyObjectUserdata::Type::image },
536 { i18n("Web Links"), website_list, SkyObjectUserdata::Type::website }
537 })
538 {
539 const auto &title = std::get<0>(res);
540 const auto &list = std::get<1>(res);
541 const auto &type = std::get<2>(res);
542
543 if (!list.empty())
544 {
545 QMenu *LinkSubMenu = new QMenu();
546 LinkSubMenu->setTitle(title);
547 for (const auto &entry : list)
548 {
549 QString t = QString(entry.title);
550 QAction *action;
551 if (type == SkyObjectUserdata::Type::website)
552 action = LinkSubMenu->addAction(
553 i18nc("Image/info menu item (should be translated)",
554 t.toLocal8Bit()),
555 ks->map(), SLOT(slotInfo()));
556 else
557 action = LinkSubMenu->addAction(
558 i18nc("Image/info menu item (should be translated)",
559 t.toLocal8Bit()),
560 ks->map(), SLOT(slotImage()));
561
562 action->setData(entry.url);
563 }
564 addMenu(LinkSubMenu);
565 }
566 }
567
568 // Look for a custom object
569 {
570 auto *object = dynamic_cast<CatalogObject *>(obj);
571 if (object)
572 {
573 CatalogsDB::DBManager manager{ CatalogsDB::dso_db_path() };
574
575 if (object->getCatalog().mut &&
576 manager.get_object(object->getObjectId()).first)
577 {
578 addAction(i18n("Remove From Local Catalog"), ks->map(),
579 SLOT(slotRemoveCustomObject()));
580 }
581 }
582 }
583
584 if (showDSS)
585 {
586 addAction(i18nc("Sloan Digital Sky Survey", "Show SDSS Image"), ks->map(),
587 SLOT(slotSDSS()));
588 addAction(i18nc("Digitized Sky Survey", "Show DSS Image"), ks->map(),
589 SLOT(slotDSS()));
590 }
591
592 if (showDSS)
593 addSeparator();
594}
595
596void KSPopupMenu::addINDI()
597{
598#ifdef HAVE_INDI
599 if (INDIListener::Instance()->size() == 0)
600 return;
601
602 for (auto &oneDevice : INDIListener::devices())
603 {
604 if (!(oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
605 continue;
606
607
608 auto mount = oneDevice->getMount();
609 if (!mount)
610 continue;
611
612 QMenu *mountMenu = new QMenu(mount->getDeviceName());
613 mountMenu->setIcon(QIcon::fromTheme("kstars"));
614 addMenu(mountMenu);
615
616 if (mount->canGoto() || mount->canSync())
617 {
618 if (mount->canGoto())
619 {
620 QAction *a = mountMenu->addAction(QIcon::fromTheme("object-rotate-right"),
621 i18nc("Move mount to target", "Goto"));
622 a->setEnabled(!mount->isParked());
624 [mount] { mount->Slew(SkyMap::Instance()->clickedPoint()); });
625 }
626 if (mount->canSync())
627 {
628 QAction *a =
629 mountMenu->addAction(QIcon::fromTheme("media-record"),
630 i18nc("Synchronize mount to target", "Sync"));
631 a->setEnabled(!mount->isParked());
633 [mount] { mount->Sync(SkyMap::Instance()->clickedPoint()); });
634 }
635
636 mountMenu->addSeparator();
637 }
638
639 if (mount->canAbort())
640 {
641 QAction *a =
642 mountMenu->addAction(QIcon::fromTheme("process-stop"), i18n("Abort"));
643 a->setEnabled(!mount->isParked());
644 connect(a, &QAction::triggered, [mount] { mount->abort(); });
645 mountMenu->addSeparator();
646 }
647
648 if (mount->canPark())
649 {
650 QAction *park =
651 mountMenu->addAction(QIcon::fromTheme("flag-red"), i18n("Park"));
652 park->setEnabled(!mount->isParked());
653 connect(park, &QAction::triggered, [mount] { mount->park(); });
654
655 QAction *unpark =
656 mountMenu->addAction(QIcon::fromTheme("flag-green"), i18n("UnPark"));
657 unpark->setEnabled(mount->isParked());
658 connect(unpark, &QAction::triggered, [mount] { mount->unpark(); });
659
660 mountMenu->addSeparator();
661 }
662
663 const SkyObject *clickedObject = KStars::Instance()->map()->clickedObject();
664 if (clickedObject && clickedObject->type() == SkyObject::SATELLITE &&
665 (mount->canTrackSatellite()))
666 {
667 const Satellite *sat = dynamic_cast<const Satellite *>(clickedObject);
668 const KStarsDateTime currentTime = KStarsData::Instance()->ut();
669 const KStarsDateTime currentTimePlusOne = currentTime.addSecs(60);
670 QAction *a =
671 mountMenu->addAction(QIcon::fromTheme("arrow"), i18n("Track satellite"));
672 a->setEnabled(!mount->isParked());
674 [mount, sat, currentTime, currentTimePlusOne]
675 {
676 mount->setSatelliteTLEandTrack(sat->tle(), currentTime,
677 currentTimePlusOne);
678 });
679 mountMenu->addSeparator();
680 }
681
682 if (mount->canCustomPark())
683 {
684 QAction *a = mountMenu->addAction(QIcon::fromTheme("go-jump-declaration"),
685 i18n("Goto && Set As Parking Position"));
686 a->setEnabled(!mount->isParked());
688 [mount] { mount->setCustomParking(); });
689 }
690
691 QAction *a =
692 mountMenu->addAction(QIcon::fromTheme("edit-find"), i18n("Find Telescope"));
694 [mount] { mount->find(); });
695 }
696#endif
697}
698
699void KSPopupMenu::addFancyLabel(const QString &name, int deltaFontSize)
700{
701 if (name.isEmpty())
702 return;
703 QLabel *label = new QLabel("<b>" + name + "</b>", this);
704 label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
705 if (deltaFontSize != 0)
706 {
707 QFont font = label->font();
708 font.setPointSize(font.pointSize() + deltaFontSize);
709 label->setFont(font);
710 }
711 QWidgetAction *act = new QWidgetAction(this);
712 act->setDefaultWidget(label);
713 addAction(act);
714}
715
716void KSPopupMenu::slotViewInWI()
717{
718 if (!KStars::Instance()->map()->clickedObject())
719 return;
720 if (!KStars::Instance()->isWIVisible())
722 KStars::Instance()->wiView()->inspectSkyObject(
723 KStars::Instance()->map()->clickedObject());
724}
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:827
void slotEditFlag(int flagIdx)
Open Flag Manager window with selected flag focused and ready to edit.
Definition skymap.cpp:785
void slotDeleteFlag(int flagIdx)
Delete selected flag.
Definition skymap.cpp:794
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
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
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 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.