11#include "imageexporter.h"
12#include "kstarsdata.h"
13#include "kstars_debug.h"
14#include "ksnotification.h"
18#include "texturemanager.h"
19#include "dialogs/exportimagedialog.h"
20#include "dialogs/finddialog.h"
21#include "dialogs/focusdialog.h"
22#include "dialogs/fovdialog.h"
23#include "dialogs/viewsdialog.h"
24#include "dialogs/locationdialog.h"
25#include "dialogs/timedialog.h"
26#include "dialogs/catalogsdbui.h"
27#include "oal/execute.h"
28#include "oal/equipmentwriter.h"
29#include "oal/observeradd.h"
30#include "options/opsadvanced.h"
31#include "options/opscatalog.h"
32#include "options/opscolors.h"
33#include "options/opsguides.h"
34#include "options/opsterrain.h"
35#include "options/opsimageoverlay.h"
36#include "options/opsdeveloper.h"
37#include "options/opssatellites.h"
38#include "options/opssolarsystem.h"
39#include "options/opssupernovae.h"
40#include "printing/printingwizard.h"
41#include "projections/projector.h"
42#include "skycomponents/asteroidscomponent.h"
43#include "skycomponents/cometscomponent.h"
44#include "skycomponents/satellitescomponent.h"
45#include "skycomponents/skymapcomposite.h"
46#include "skycomponents/solarsystemcomposite.h"
47#include "skycomponents/supernovaecomponent.h"
48#include "skycomponents/catalogscomponent.h"
49#include "skycomponents/mosaiccomponent.h"
50#include "skycomponents/imageoverlaycomponent.h"
52#include "skyobjects/mosaictiles.h"
53#include "indi/indidome.h"
55#include "tools/altvstime.h"
56#include "tools/astrocalc.h"
57#include "tools/eyepiecefield.h"
58#include "tools/flagmanager.h"
59#include "tools/horizonmanager.h"
60#include "tools/observinglist.h"
61#include "tools/planetviewer.h"
62#include "tools/jmoontool.h"
63#include "tools/scriptbuilder.h"
64#include "tools/skycalendar.h"
65#include "tools/wutdialog.h"
66#include "tools/polarishourangle.h"
67#include "tools/whatsinteresting/wiequipsettings.h"
68#include "tools/whatsinteresting/wilpsettings.h"
69#include "tools/whatsinteresting/wiview.h"
70#include "hips/hipsmanager.h"
71#include "catalogsdb.h"
73#include <basedevice.h>
75#include "indi/opsindi.h"
76#include "indi/drivermanager.h"
77#include "indi/guimanager.h"
78#include "indi/indilistener.h"
82#include "fitsviewer/fitsviewer.h"
83#include "fitsviewer/opsfits.h"
85#include "ekos/manager.h"
86#include "ekos/scheduler/framingassistantui.h"
87#include "ekos/scheduler/scheduler.h"
88#include "ekos/scheduler/schedulermodulestate.h"
89#include "ekos/opsekos.h"
90#include "ekos/mount/mount.h"
94#include "xplanet/opsxplanet.h"
96#ifdef HAVE_NOTIFYCONFIG
97#include <KNotifyConfigWidget>
99#include <KActionCollection>
100#include <KActionMenu>
102#include <KToggleAction>
103#include <kns3/downloaddialog.h>
105#include <QQuickWindow>
116void KStars::slotViewToolBar()
126 opcatalog->kcfg_ShowStars->setChecked(a->
isChecked());
134 opcatalog->kcfg_ShowDeepSky->setChecked(a->
isChecked());
139 Options::setShowSolarSystem(a->
isChecked());
142 opsolsys->kcfg_ShowSolarSystem->setChecked(a->
isChecked());
150 opguides->kcfg_ShowCLines->setChecked(a->
isChecked());
158 opguides->kcfg_ShowCNames->setChecked(a->
isChecked());
166 opguides->kcfg_ShowCBounds->setChecked(a->
isChecked());
171 Options::setShowConstellationArt(a->
isChecked());
174 opguides->kcfg_ShowConstellationArt->setChecked(a->
isChecked());
179 Options::setShowMilkyWay(a->
isChecked());
182 opguides->kcfg_ShowMilkyWay->setChecked(a->
isChecked());
190 Options::setAutoSelectGrid(
false);
191 Options::setShowEquatorialGrid(a->
isChecked());
194 opguides->kcfg_ShowEquatorialGrid->setChecked(a->
isChecked());
195 opguides->kcfg_AutoSelectGrid->setChecked(
false);
200 Options::setAutoSelectGrid(
false);
201 Options::setShowHorizontalGrid(a->
isChecked());
204 opguides->kcfg_ShowHorizontalGrid->setChecked(a->
isChecked());
205 opguides->kcfg_AutoSelectGrid->setChecked(
false);
211 if (!a->
isChecked() && Options::useRefraction())
213 QString caption =
i18n(
"Refraction effects disabled");
214 QString message =
i18n(
"When the horizon is switched off, refraction effects "
215 "are temporarily disabled.");
221 opguides->kcfg_ShowGround->setChecked(a->
isChecked());
229 opguides->kcfg_ShowFlags->setChecked(a->
isChecked());
234 Options::setShowSatellites(a->
isChecked());
237 opssatellites->kcfg_ShowSatellites->setChecked(a->
isChecked());
242 Options::setShowSupernovae(a->
isChecked());
245 opssupernovae->kcfg_ShowSupernovae->setChecked(a->
isChecked());
257void KStars::slotINDIToolBar()
266 GUIManager::Instance()->raise();
267 GUIManager::Instance()->activateWindow();
268 GUIManager::Instance()->showNormal();
271 GUIManager::Instance()->hide();
277 Ekos::Manager::Instance()->raise();
278 Ekos::Manager::Instance()->activateWindow();
279 Ekos::Manager::Instance()->showNormal();
282 Ekos::Manager::Instance()->hide();
288 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
293 KSNotification::error(
i18n(
"Mount %1 is offline. Please connect and retry again.",
oneDevice->getDeviceName()));
304 mount->centerUnlock();
308 KSNotification::sorry(
i18n(
"No connected mounts found."));
323 if (view->tabs().empty() ==
false)
326 view->activateWindow();
343 Ekos::Manager::Instance()->mountModule()->toggleMountToolBox();
349 Options::setShowSensorFOV(a->
isChecked());
350 for (
auto &
oneFOV :
data()->getTransientFOVs())
352 if (
oneFOV->objectName() ==
"sensor_fov")
359 Options::setShowMosaicPanel(a->
isChecked());
362 auto scheduler = Ekos::Manager::Instance()->schedulerModule();
368 Ekos::FramingAssistantUI *
assistant =
new Ekos::FramingAssistantUI();
384 for (
auto &a : telescopeGroup->
actions())
396 for (
auto &a : domeGroup->
actions())
405void KStars::slotCalculator()
417 Options::setRunStartupWizard(
false);
419 updateLocationFromWizard(*(wizard->geo()));
423void KStars::updateLocationFromWizard(
const GeoLocation &geo)
432 data()->isTimeRunningForward());
445 if (!Options::isTracking() && Options::useAltAz())
455void KStars::slotDownload()
457 KSNotification::event(
459 i18n(
"Due to a known issue in the kde frameworks, "
460 "updating already downloaded items is currently not possible. <br> "
461 "Please uninstall and reinstall them to update."));
464 auto dlg = std::make_unique<KNS3::DownloadDialog>(
":/kconfig/kstars.knsrc",
this);
477 if (entry.category() !=
"dso")
479 const auto id = entry.id().
toInt();
481 if (entry.status() == KNS3::Entry::Installed)
482 for (
const QString &name : entry.installedFiles())
486 const auto meta{ CatalogsDB::read_catalog_meta_from_file(name) };
492 i18n(
"The catalog \"%1\" is corrupt.", entry.name()));
496 if (
meta.second.id !=
id)
500 i18n(
"The catalog \"%1\" is corrupt.<br>Expected id=%2 but "
502 entry.name(),
id,
meta.second.id));
506 const auto success{ manager.import_catalog(name,
true) };
510 i18n(
"Could not import the catalog \"%1\"<br>%2",
511 entry.name(), success.second));
515 if (entry.status() == KNS3::Entry::Deleted)
517 manager.remove_catalog(
id);
528void KStars::slotAVT()
535void KStars::slotWUT()
564 dialog->
addPage(m_WISettings,
i18n(
"Light Pollution Settings"));
565 dialog->
addPage(m_WIEquipmentSettings,
566 i18n(
"Equipment Settings - Equipment Type and Parameters"));
568 if (m_WIEquipmentSettings)
579 m_WIView =
new WIView(
nullptr);
581 m_wiDock->
setStyleSheet(
"QDockWidget::title{background-color:black;}");
590 SLOT(setChecked(
bool)));
599void KStars::slotCalendar()
603 m_SkyCalendar->
show();
606void KStars::slotGlossary()
617void KStars::slotScriptBuilder()
619 if (!m_ScriptBuilder)
621 m_ScriptBuilder->
show();
624void KStars::slotSolarSystem()
628 m_PlanetViewer->
show();
631void KStars::slotJMoonTool()
638void KStars::slotMoonPhaseTool()
649 m_FlagManager->
show();
653void KStars::slotTelescopeWizard()
661 if (Options::indiServerIsInternal())
675 KSNotification::error(
i18n(
"Unable to find INDI server. Please make sure the package that provides "
676 "the 'indiserver' binary is installed."));
689void KStars::slotINDIPanel()
697 if (Options::indiServerIsInternal())
711 KSNotification::error(
i18n(
712 "Unable to find INDI server. Please make sure the package that provides "
713 "the 'indiserver' binary is installed."));
718 GUIManager::Instance()->updateStatus(
true);
722void KStars::slotINDIDriver()
729 i18n(
"INDI Device Manager should only be used by advanced technical users. "
730 "It cannot be used with Ekos. Do you still want to open INDI device "
740 if (Options::indiServerIsInternal())
754 KSNotification::error(
i18n(
755 "Unable to find INDI server. Please make sure the package that provides "
756 "the 'indiserver' binary is installed."));
762 DriverManager::Instance()->raise();
763 DriverManager::Instance()->activateWindow();
764 DriverManager::Instance()->showNormal();
769void KStars::slotEkos()
779 if (Options::indiServerIsInternal())
793 KSNotification::error(
i18n(
794 "Unable to find INDI server. Please make sure the package that provides "
795 "the 'indiserver' binary is installed."));
801 if (Ekos::Manager::Instance()->
isVisible() &&
804 Ekos::Manager::Instance()->hide();
808 Ekos::Manager::Instance()->raise();
809 Ekos::Manager::Instance()->activateWindow();
810 Ekos::Manager::Instance()->showNormal();
817void KStars::slotINDITelescopeTrack()
820 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
825 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
829 if (!mount ||
mount->isConnected() ==
false)
846 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
851 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
855 if (!mount ||
mount->isConnected() ==
false)
872void KStars::slotINDITelescopeSlewMousePointer()
875 slotINDITelescopeSlew(
false);
882 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
887 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
891 if (!mount ||
mount->isConnected() ==
false)
909void KStars::slotINDITelescopeSyncMousePointer()
912 slotINDITelescopeSync(
false);
916void KStars::slotINDITelescopeAbort()
919 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
924 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
928 if (!mount ||
mount->isConnected() ==
false)
937void KStars::slotINDITelescopePark()
940 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
945 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
949 if (!mount ||
mount->isConnected() ==
false ||
mount->canPark() ==
false)
958void KStars::slotINDITelescopeUnpark()
961 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
966 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE))
970 if (!mount ||
mount->isConnected() ==
false ||
mount->canPark() ==
false)
979void KStars::slotINDIDomePark()
982 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
987 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::DOME_INTERFACE))
991 if (!dome || dome->isConnected() ==
false)
1002void KStars::slotINDIDomeUnpark()
1005 if (m_KStarsData ==
nullptr || INDIListener::Instance() ==
nullptr)
1010 if (!(
oneDevice->getDriverInterface() & INDI::BaseDevice::DOME_INTERFACE))
1014 if (!dome || dome->isConnected() ==
false)
1016 if (dome->canPark())
1042 data()->isTimeRunningForward());
1055 if (!Options::isTracking() && Options::useAltAz())
1058 data()->geo()->lat());
1069void KStars::slotViewOps()
1074 auto ops = prepareOps();
1078 ops->activateWindow();
1084 if (
nullptr != dialog)
1088 dialog =
new KConfigDialog(
this,
"settings", Options::self());
1092 dialog->
resize(800, 600);
1113 page = dialog->
addPage(opcatalog,
i18n(
"Catalogs"),
"kstars_catalog");
1116 page = dialog->
addPage(opsolsys,
i18n(
"Solar System"),
"kstars_solarsystem");
1119 page = dialog->
addPage(opssatellites,
i18n(
"Satellites"),
"kstars_satellites");
1122 page = dialog->
addPage(opssupernovae,
i18n(
"Supernovae"),
"kstars_supernovae");
1125 page = dialog->
addPage(opguides,
i18n(
"Guides"),
"kstars_guides");
1128 page = dialog->
addPage(opterrain,
i18n(
"Terrain"),
"kstars_terrain");
1131 page = dialog->
addPage(opsImageOverlay,
i18n(
"Image Overlays"),
"kstars_imageoverlay");
1133 KStarsData::Instance()->skyComposite()->imageOverlay()->setWidgets(
1134 opsImageOverlay->table(), opsImageOverlay->statusDisplay(), opsImageOverlay->solvePushButton(),
1135 opsImageOverlay->tableTitleBox(), opsImageOverlay->solverProfile());
1137 page = dialog->
addPage(opcolors,
i18n(
"Colors"),
"kstars_colors");
1142 page = dialog->
addPage(opsfits,
i18n(
"FITS"),
"kstars_fitsviewer");
1148 page = dialog->
addPage(opsindi,
i18n(
"INDI"),
"kstars_indi");
1154 if (Ekos::Manager::Instance())
1155 Ekos::Manager::Instance()->setOptionsWidget(
ekosOption, opsekos);
1160 opsxplanet =
new OpsXplanet(
this);
1161 page = dialog->
addPage(opsxplanet,
i18n(
"Xplanet"),
"kstars_xplanet");
1164 page = dialog->
addPage(opadvanced,
i18n(
"Advanced"),
"kstars_advanced");
1167 page = dialog->
addPage(opsdeveloper,
i18n(
"Developer"),
"kstars_developer");
1174 KStars::Instance()->appHelpActivated();
1183 opterrain->syncOptions();
1185 ->setText(Options::showTerrain() ?
i18n(
"Hide Terrain") :
i18n(
"Show Terrain"));
1187 opsImageOverlay->syncOptions();
1189 ->setText(Options::showImageOverlays() ?
i18n(
"Hide Image Overlays") :
i18n(
"Show Image Overlays"));
1194 Options::self()->save();
1204 Options::self()->save();
1210void KStars::slotSetTime()
1218 if (Options::useAltAz())
1220 if (
map()->focusObject())
1223 data()->geo()->lat());
1249 if (Options::useAltAz())
1251 if (
map()->focusObject())
1254 data()->geo()->lat());
1272void KStars::slotFind()
1277 (targetObject = FindDialog::Instance()->targetObject()))
1289void KStars::slotOpenFITS()
1297void KStars::slotBlink()
1305void KStars::slotExportImage()
1314 "Images (*.png *.jpeg *.gif *.bmp *.svg)");
1327 i18n(
"A file named \"%1\" already exists. Overwrite it?",
fileURL.fileName()),
1339 if (!m_ExportImageDialog)
1343 KStarsData::Instance()->imageExporter());
1347 m_ExportImageDialog->setOutputUrl(
fileURL.toLocalFile());
1351 m_ExportImageDialog->
show();
1354void KStars::slotRunScript()
1359 i18nc(
"Filter by file type: KStars Scripts.",
"KStars Scripts (*.kstars)"));
1365 if (
fileURL.isLocalFile() ==
false)
1367 KSNotification::sorry(
i18n(
"Executing remote scripts is not supported."));
1371 f.setFileName(
fileURL.toLocalFile());
1375 QString message =
i18n(
"Could not open file %1", f.fileName());
1376 KSNotification::sorry(message,
i18n(
"Could Not Open File"));
1387 if (line.
at(0) !=
'#' && line.
left(9) !=
"dbus-send")
1400 "The selected script contains unrecognized elements, "
1401 "indicating that it was not created using the KStars script builder. "
1402 "This script may not function properly, and it may even contain "
1404 "Would you like to execute it anyway?"),
1419 p.
start(f.fileName(), arguments);
1425 qApp->processEvents();
1434void KStars::slotPrint()
1439 if (
data()->colorScheme()->colorNamed(
"SkyColor") !=
QColor(255, 255, 255))
1442 i18n(
"You can save printer ink by using the \"Star Chart\" "
1443 "color scheme, which uses a white background. Would you like to "
1444 "temporarily switch to the Star Chart color scheme for printing?");
1446 int answer = KMessageBox::questionYesNoCancel(
1447 nullptr, message,
i18n(
"Switch to Star Chart Colors?"),
1453 if (
answer == KMessageBox::Yes)
1460void KStars::slotPrintingWizard()
1462 if (m_PrintingWizard)
1464 delete m_PrintingWizard;
1468 m_PrintingWizard->
show();
1471void KStars::slotToggleTimer()
1473 if (
data()->clock()->isActive())
1480 if (
fabs(
data()->clock()->scale()) > Options::slewTimeScale())
1483 if (
data()->clock()->isManualMode())
1488 Options::setRunClock(
data()->clock()->isActive());
1491void KStars::slotStepForward()
1493 if (
data()->clock()->isActive())
1499void KStars::slotStepBackward()
1501 if (
data()->clock()->isActive())
1508void KStars::slotPointFocus()
1511 map()->stopTracking();
1515 Options::useRefraction());
1528 if (Options::isTracking())
1530 Options::setIsTracking(
false);
1533 ->action(
"track_object")
1537 if (planet &&
data()->temporaryTrail)
1540 data()->temporaryTrail =
false;
1553 Options::setIsTracking(
true);
1556 ->action(
"track_object")
1563void KStars::slotManualFocus()
1582 if (Options::useAltAz() &&
realAlt > 89.0)
1586 data()->geo()->lat());
1588 if (!Options::useAltAz() &&
realDec > 89.0)
1597 if (Options::isTracking())
1610 if (Options::useAltAz())
1623 if (Options::useAltAz() &&
realAlt > 89.0)
1625 if (!Options::useAltAz() &&
realDec > 89.0)
1630 map()->stopTracking();
1638 actionCollection()->action(
"zoom_out")->setEnabled(Options::zoomFactor() > MINZOOM);
1639 actionCollection()->action(
"zoom_in")->setEnabled(Options::zoomFactor() < MAXZOOM);
1645 ki18nc(
"approximate field of view",
"Approximate FOV: %1 degrees");
1650 ki18nc(
"approximate field of view",
"Approximate FOV: %1 arcminutes");
1656 ki18nc(
"approximate field of view",
"Approximate FOV: %1 arcseconds");
1672 i18nc(
"The user should enter an angle for the field-of-view of the display",
1673 "Enter Desired Field-of-View Angle"),
1683void KStars::slotCoordSys()
1685 if (Options::useAltAz())
1687 Options::setUseAltAz(
false);
1688 if (Options::useRefraction())
1690 if (
map()->focusObject())
1697 data()->geo()->lat());
1701 ->action(
"coordsys")
1702 ->setText(
i18n(
"Switch to Horizontal View (Horizontal &Coordinates)"));
1704 ->action(
"up_orientation")
1705 ->setText(
i18nc(
"Orientation of the sky map",
"North &Up"));
1707 ->action(
"down_orientation")
1708 ->setText(
i18nc(
"Orientation of the sky map",
"North &Down"));
1709 erectObserverCorrectionGroup->
setEnabled(
false);
1713 Options::setUseAltAz(
true);
1714 if (Options::useRefraction())
1720 ->action(
"coordsys")
1721 ->setText(
i18n(
"Switch to Star Globe View (Equatorial &Coordinates)"));
1723 ->action(
"up_orientation")
1724 ->setText(
i18nc(
"Orientation of the sky map",
"Zenith &Up"));
1726 ->action(
"down_orientation")
1727 ->setText(
i18nc(
"Orientation of the sky map",
"Zenith &Down"));
1728 erectObserverCorrectionGroup->
setEnabled(
true);
1734void KStars::slotSkyMapOrientation()
1738 Options::setSkyRotation(0.0);
1742 Options::setSkyRotation(180.0);
1746 Options::setErectObserverCorrection(
1753void KStars::slotMapProjection()
1756 Options::setProjection(Projector::Lambert);
1758 Options::setProjection(Projector::AzimuthalEquidistant);
1760 Options::setProjection(Projector::Orthographic);
1762 Options::setProjection(Projector::Equirectangular);
1764 Options::setProjection(Projector::Stereographic);
1766 Options::setProjection(Projector::Gnomonic);
1769 qCDebug(
KSTARS) <<
"Projection system: " << Options::projection();
1775void KStars::slotColorScheme()
1780void KStars::slotTargetSymbol(
bool flag)
1797 Options::setFOVNames(names);
1817 Options::setUseAltAz(!view->useAltAz);
1820 Options::setMirrorSkyMap(view->mirror);
1821 actionCollection()->action(
"mirror_skymap")->setChecked(Options::mirrorSkyMap());
1824 double viewAngle = view->viewAngle;
1825 if (view->erectObserver && view->useAltAz)
1845 if (!std::isnan(view->fov))
1849 repopulateOrientation();
1850 qCDebug(
KSTARS) <<
"Alt/Az: " << Options::useAltAz()
1851 <<
"Mirror: " << Options::mirrorSkyMap()
1852 <<
"Rotation: " << Options::skyRotation()
1853 <<
"Erect Obs: " << Options::erectObserverCorrection()
1854 <<
"FOV: " << view->fov;
1859void KStars::slotHIPSSource()
1862 Q_ASSERT(selectedAction !=
nullptr);
1869 HIPSManager::Instance()->setCurrentSource(
"None");
1876void KStars::slotEditViews()
1887void KStars::slotFOVEdit()
1898void KStars::slotObsList()
1900 m_KStarsData->observingList()->
show();
1903void KStars::slotEquipmentWriter()
1911void KStars::slotObserverManager()
1918void KStars::slotHorizonManager()
1920 if (!m_HorizonManager)
1927 m_HorizonManager->
show();
1932 if (!m_EyepieceView)
1937 const FOV *fov =
nullptr;
1938 if (!
data()->getAvailableFOVs().isEmpty())
1944 foreach (f,
data()->getAvailableFOVs())
1950 this,
i18n(
"Eyepiece View: Choose a field-of-view"),
1958void KStars::slotExecute()
1960 KStarsData::Instance()->executeSession()->init();
1961 KStarsData::Instance()->executeSession()->show();
1964void KStars::slotPolarisHourAngle()
1971void KStars::slotTipOfDay()
1977void KStars::slotFullScreen()
1992void KStars::slotTerrain()
1994 Options::setShowTerrain(!Options::showTerrain());
1996 ->setText(Options::showTerrain() ?
i18n(
"Hide Terrain") :
i18n(
"Show Terrain"));
1997 opterrain->syncOptions();
2002void KStars::slotImageOverlays()
2004 Options::setShowImageOverlays(!Options::showImageOverlays());
2006 ->setText(Options::showImageOverlays() ?
i18n(
"Hide Image Overlays") :
i18n(
"Show Image Overlays"));
2007 opsImageOverlay->syncOptions();
2015 if (
map()->focusObject() &&
map()->focusObject()->isSolarSystem() &&
2016 data()->temporaryTrail)
2027void KStars::slotShowGUIItem(
bool show)
2032 Options::setShowStatusBar(
show);
2038 Options::setShowAltAzField(
show);
2044 Options::setShowRADecField(
show);
2050 Options::setShowJ2000RADecField(
show);
2059 kta->setObjectName(filename);
2060 kta->setActionGroup(cschemeGroup);
2065 if (actionName.
mid(3) ==
2066 cg.readEntry(
"ColorSchemeFile",
"moonless-night.colors").remove(
".colors"))
2068 kta->setChecked(
true);
2078 qCDebug(
KSTARS) <<
"removing " << actionName;
2082void KStars::slotAboutToQuit()
2084 if (m_SkyMap ==
nullptr)
2088 DriverManager::Instance()->disconnectClients();
2089 INDIListener::Instance()->disconnect();
2090 GUIManager::Instance()->disconnect();
2099 Options::setWindowWidth(
width());
2100 Options::setWindowHeight(
height());
2111 quit->start(
"killall kdeinit5");
2112 quit->waitForFinished(1000);
2113 quit->start(
"killall klauncher");
2114 quit->waitForFinished(1000);
2115 quit->start(
"killall kioslave");
2116 quit->waitForFinished(1000);
2117 quit->start(
"killall kio_http_cache_cleaner");
2118 quit->waitForFinished(1000);
2125 if (Options::showAltAzField())
2128 if (Options::useAltAz())
2136 if (Options::showRADecField())
2139 lastUpdate.setDJD(KStarsData::Instance()->updateNum()->getJD());
2142 .
arg(p->
ra().toHMSString(), p->
dec().toDMSString(
true),
2148 if (Options::showJ2000RADecField())
2154 .
arg(
p0.ra().toHMSString(),
2155 p0.dec().toDMSString(
true));
2163 data()->
skyComposite()->solarSystemComposite()->cometsComponent()->updateDataFile(
2169 data()->
skyComposite()->solarSystemComposite()->asteroidsComponent()->updateDataFile(
2173void KStars::slotUpdateSupernovae()
2178void KStars::slotUpdateSatellites()
2183void KStars::slotConfigureNotifications()
2185#ifdef HAVE_NOTIFYCONFIG
2191 auto *ui =
new CatalogsDBUI{
this, CatalogsDB::dso_db_path() };
2195 KStars::Instance()->data()->skyComposite()->catalogsComponent()->dropCache();
This is the base class for the KStars astronomical calculator.
A simple UI to manage downloaded and custom Catalogs.
Manages the catalog database and provides an interface to provide an interface to query and modify th...
void saveToConfig()
Save color-scheme data to the Config object.
Renders the view through the eyepiece of various telescope types.
void showEyepieceField(SkyPoint *sp, FOV const *const fov=nullptr, const QString &imagePath=QString())
Show the eyepiece field dialog.
FOVDialog is dialog to select a Field-of-View indicator (or create a new one)
static bool save()
Write list of FOVs to "fov.dat".
A simple class encapsulating a Field-of-View symbol.
Flag manager Dialog box to add and remove flags.
A small dialog for setting the focus coordinates manually.
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
Manages adding/removing and editing regions and points associated with user-customized artificial hor...
INDIListener is responsible for creating ISD::GDInterface generic devices as new devices arrive from ...
static bool showDialog(const QString &name)
KPageWidgetItem * addPage(QWidget *page, const QString &itemName, const QString &pixmapName=QString(), const QString &header=QString(), bool manage=true)
static KConfigDialog * exists(const QString &name)
QPushButton * button(QDialogButtonBox::StandardButton which) const
void setIcon(const QIcon &icon)
A subclass of TrailObject that provides additional information needed for most solar system objects.
The Startup Wizard will be automatically opened when KStars runs for the first time.
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
void setNextDSTChange(const KStarsDateTime &dt)
Set the NextDSTChange member.
void setLocation(const GeoLocation &l)
Set the GeoLocation according to the argument.
void changeDateTime(const KStarsDateTime &newDate)
Change the current simulation date/time to the KStarsDateTime argument.
void setFullTimeUpdate()
The Sky is updated more frequently than the moon, which is updated more frequently than the planets.
ColorScheme * colorScheme()
void syncLST()
Sync the LST with the simulation clock.
void syncFOV()
Synchronize list of visible FOVs and list of selected FOVs in Options.
Q_INVOKABLE SimClock * clock()
void add_color_scheme(const QString &filename, const QString &name)
Register a color scheme with filename and name.
SkyMapComposite * skyComposite()
void setSnapNextFocus(bool b=true)
Disable or re-enable the slewing animation for the next Focus change.
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
static KStarsDateTime currentDateTimeUtc()
void slotSetZoom()
action slot: Allow user to specify a field-of-view angle for the display window in degrees,...
void repopulateViews()
Load Views and repopulate menu.
void applyConfig(bool doApplyFocus=true)
Apply config options throughout the program.
static KStars * Instance()
void slotEyepieceView(SkyPoint *sp, const QString &imagePath=QString())
Show the eyepiece view tool.
void slotToggleWIView()
action slot: toggle What's Interesting window
void slotDSOCatalogGUI()
Show the DSO Catalog Management GUI.
void syncOps()
Sync Options to GUI, if any.
void slotApplyWIConfigChanges()
Apply new settings for WI.
void slotWizard()
action slot: open KStars startup wizard
void slotTrack()
action slot: Toggle whether kstars is tracking current position
void addColorMenuItem(QString name, const QString &actionName)
Add an item to the color-scheme action manu.
KStarsData * data() const
void slotGeoLocator()
action slot: open dialog for selecting a new geographic location
void slotSetDomeEnabled(bool enable)
slotSetDomeEnabled call when dome comes online or goes offline.
Q_SCRIPTABLE Q_NOREPLY void writeConfig()
DBUS interface function.
void slotFlagManager()
action slot: open Flag Manager
void slotSetTelescopeEnabled(bool enable)
slotSetTelescopeEnabled call when telescope comes online or goes offline.
Q_SCRIPTABLE Q_NOREPLY void loadColorScheme(const QString &name)
DBUS interface function.
void slotWISettings()
action slot: open What's Interesting settings window
Q_SCRIPTABLE Q_NOREPLY void printImage(bool usePrintDialog, bool useChartColors)
DBUS interface function.
void slotClearAllTrails()
Remove all trails which may have been added to solar system bodies.
void removeColorMenuItem(const QString &actionName)
Remove an item from the color-scheme action manu.
void updateTime(const bool automaticDSTchange=true)
Update time-dependent data and (possibly) repaint the sky map.
static bool Closing
Set to true when the application is being closed.
void slotShowPositionBar(SkyPoint *)
Display position in the status bar.
void slotSetTimeToNow()
action slot: sync kstars clock to system time
void slotApplyConfigChanges()
Apply new settings and redraw skymap.
void slotZoomChanged()
Called when zoom level is changed.
virtual KActionCollection * actionCollection() const
virtual QAction * action(const QDomElement &element) const
Dialog for changing the geographic location of the observer.
Dialog to add new observers.
The Advanced Tab of the Options window.
The Catalog page for the Options window.
The Colors page allows the user to adjust all of the colors used to display the night sky.
The Developer Tab of the Options window.
Enables the user to set remote connection devices and options in addition to online and offline astro...
The FITS Tab of the Options window.
The guide page enables to user to select to turn on and off guide overlays such as constellation line...
Enables the user to change several INDI options including default ports for common devices,...
The terrain page enables to user to manage the options for image overlays.
The Satellites Tab of the Options window.
The Solar System page for the Options window.
The Supernovae Tab of the Options window.
The terrain page enables to user to manage the options for the terrain overlay.
Display an overhead view of the solar system.
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
void updateTLEs()
Download new TLE files.
A GUI tool for building behavioral DBus scripts for KStars.
void setManualMode(bool on=true)
Sets Manual Mode on/off according to the bool argument.
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS function to start the SimClock.
Q_SCRIPTABLE Q_NOREPLY void stop()
DBUS function to stop the SimClock.
void manualTick(bool force=false, bool backward=false)
Equivalent of tick() for manual mode.
Draws Rise/Set/Transit curves for major solar system planets for any calendar year.
static bool save()
Commit the list of views to the database.
static std::optional< SkyMapView > viewNamed(const QString &name)
Get the view with the given name.
void setZoomFactor(double factor)
@ Set zoom factor.
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
void setupProjector()
Call to set up the projector before a draw cycle.
void setClickedPoint(const SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
const Projector * projector() const
Get the current projector.
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
SkyPoint * mousePoint()
Retrieve the mouse pointer position.
void setFocusAltAz(const dms &alt, const dms &az)
sets the focus point of the sky map, using its alt/az coordinates
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
void forceUpdateNow()
Convenience function; simply calls forceUpdate(true).
void setDestinationAltAz(const dms &alt, const dms &az, bool altIsRefracted)
sets the destination point of the sky map, using its alt/az coordinates.
void setFocus(SkyPoint *f)
sets the central focus point of the sky map.
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
void slotCenter()
Center the display at the point ClickedPoint.
void setFocusPoint(SkyPoint *f)
set the FocusPoint; the position that is to be the next Destination.
SkyObject * focusObject() const
Retrieve the object which is centered in the sky map.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
The sky coordinates of a point in the sky.
const CachingDms & dec() const
void setDec(dms d)
Sets Dec, the current Declination.
const CachingDms & ra() const
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
void setAlt(dms alt)
Sets Alt, the Altitude.
void HorizontalToEquatorial(const dms *LST, const dms *lat)
Determine the (RA, Dec) coordinates of the SkyPoint from its (Altitude, Azimuth) coordinates,...
SkyPoint catalogueCoord(long double jdf)
Computes the J2000.0 catalogue coordinates for this SkyPoint using the epoch removing aberration,...
void slotTriggerDataFileUpdate()
This initiates updating of the data file.
static void discoverTextureDirs()
Clear the cache and discover the directories to load textures from.
KStarsDateTime nextDSTChange() const
void reset_with_ltime(KStarsDateTime <ime, const double TZoffset, const bool time_runs_forward, const bool automaticDSTchange=false)
Recalculate next dst change and if DST is active by a given local time with timezone offset and time ...
void clearTrail()
clear the Trail
void addToTrail(const QString &label=QString())
adds a point to the planet's trail
static void clearTrailsExcept(SkyObject *o)
Remove trail for all objects but one which is passed as parameter.
ViewsDialog is dialog to select a Sky Map View (or create a new one)
User interface for "Equipment Type and Parameters" page in WI settings dialog.
void populateScopeListWidget()
Populates scope list widget in UI with list of telescopes from KStars userdb.
void setAperture()
Set aperture to use.
User interface for "Light Pollution Settings" page in WI settings dialog This class deals with light ...
Manages the QML user interface for What's Interesting.
void onReloadIconClicked()
public slot - Reload list of visible sky-objects.
void updateObservingConditions()
What's up tonight dialog is a window which lists all sky objects that will be visible during the next...
An angle, stored as degrees, but expressible in many ways.
const dms reduce() const
return the equivalent angle between 0 and 360 degrees.
const QString toDMSString(const bool forceSign=false, const bool machineReadable=false, const bool highPrecision=false) const
static constexpr double DegToRad
DegToRad is a const static member equal to the number of radians in one degree (dms::PI/180....
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT SimpleJob * mount(bool ro, const QByteArray &fstype, const QString &dev, const QString &point, JobFlags flags=DefaultFlags)
GeoCoordinates geo(const QVariant &location)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
QString name(StandardShortcut id)
bool isChecked() const const
QList< QAction * > actions() const const
QString applicationDirPath()
void finished(int result)
QString path() const const
bool exists() const const
QUrl getOpenFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, Options options, const QStringList &supportedSchemes)
QUrl getSaveFileUrl(QWidget *parent, const QString &caption, const QUrl &dir, const QString &filter, QString *selectedFilter, Options options, const QStringList &supportedSchemes)
QIcon fromTheme(const QString &name)
void setText(const QString &)
void append(QList< T > &&value)
void removeAt(qsizetype i)
void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget)
QStatusBar * statusBar() const const
StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
QObject * sender() const const
void setObjectName(QAnyStringView name)
void start(OpenMode mode)
QProcess::ProcessState state() const const
bool waitForFinished(int msecs)
bool waitForStarted(int msecs)
QString findExecutable(const QString &executableName, const QStringList &paths)
void showMessage(const QString &message, int timeout)
QString arg(Args &&... args) const const
const QChar at(qsizetype position) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
int toInt(bool *ok, int base) const const
qsizetype indexOf(const QRegularExpression &re, qsizetype from) const const