20 #include <QTextStream> 
   22 #include <kactioncollection.h> 
   23 #include <kactionmenu.h> 
   24 #include <kiconloader.h> 
   26 #include <kstatusbar.h> 
   28 #include <kmessagebox.h> 
   29 #include <kstandardaction.h> 
   30 #include <kstandarddirs.h> 
   31 #include <ktoggleaction.h> 
   34 #include <knewstuff3/knewstuffaction.h> 
   50 #include <config-kstars.h> 
   73     KAction* operator << (KAction* ka, QString text) {
 
   78     KAction* operator << (KAction* ka, 
const KIcon& icon) {
 
   83     KAction* operator << (KAction* ka, 
const KShortcut& sh) {
 
   92         AddToGroup(QActionGroup* g) : grp(g) {}
 
   94     KAction* operator << (KAction* ka, AddToGroup g) {
 
  102         Checked(
bool f) : flag(f) {}
 
  104     KAction* operator << (KAction* ka, Checked chk) {
 
  105         ka->setCheckable(
true);
 
  106         ka->setChecked(chk.flag);
 
  113         ToolTip(QString msg) : tip(msg) {}
 
  115     KAction* operator << (KAction* ka, 
const ToolTip& tool) {
 
  116         ka->setToolTip(tool.tip);
 
  121     KAction* newToggleAction(KActionCollection* col, QString name, QString text,
 
  122                              QObject* receiver, 
const char* member) {
 
  123         KAction* ka = col->add<KToggleAction>(name) << text;
 
  124         QObject::connect(ka, SIGNAL( toggled(
bool) ), receiver, member);
 
  129 void KStars::initActions() {
 
  130     KIconLoader::global()->addAppDir( 
"kstars" );
 
  134     ka = KNS3::standardAction(i18n(
"Download New Data..."), 
this, SLOT(slotDownload()), actionCollection(), 
"get_data")
 
  135         << KShortcut( Qt::CTRL+Qt::Key_D );
 
  136     ka->setWhatsThis(i18n(
"Downloads new data"));
 
  137     ka->setToolTip(ka->whatsThis());
 
  138     ka->setStatusTip(ka->whatsThis());
 
  140 #ifdef HAVE_CFITSIO_H 
  141     actionCollection()->addAction(
"open_file", 
this, SLOT(slotOpenFITS()) )
 
  142         << i18n(
"Open FITS...")
 
  143         << KIcon(
"document-open")
 
  144         << KShortcut( Qt::CTRL+Qt::Key_O );
 
  147     actionCollection()->addAction(
"export_image", 
this, SLOT( slotExportImage() ) )
 
  148         << i18n(
"&Save Sky Image...")
 
  149         << KIcon(
"document-export-image")
 
  150         << KShortcut( Qt::CTRL+Qt::Key_I );
 
  151     actionCollection()->addAction(
"run_script", 
this, SLOT( slotRunScript() ))
 
  152         << i18n(
"&Run Script...")
 
  153         << KIcon(
"system-run" )
 
  154         << KShortcut( Qt::CTRL+Qt::Key_R );
 
  155     actionCollection()->addAction(
"printing_wizard", 
this, SLOT(slotPrintingWizard() ) )
 
  156             << 
i18nc(
"start Printing Wizard", 
"Printing &Wizard");
 
  157     actionCollection()->addAction( KStandardAction::Print, 
"print", 
this, SLOT( slotPrint() ) );
 
  158     actionCollection()->addAction( KStandardAction::Quit,  
"quit",  
this, SLOT( close() ) );
 
  161     actionCollection()->addAction(
"time_to_now", 
this, SLOT( 
slotSetTimeToNow() ))
 
  162         << i18n(
"Set Time to &Now")
 
  163         << KShortcut( Qt::CTRL+Qt::Key_E );
 
  165     actionCollection()->addAction(
"time_dialog", 
this, SLOT( slotSetTime() ) )
 
  166         << 
i18nc(
"set Clock to New Time", 
"&Set Time..." )
 
  167         << KShortcut( Qt::CTRL+Qt::Key_S )
 
  168         << KIcon(
"view-history");
 
  170     ka = actionCollection()->add<KToggleAction>(
"clock_startstop")
 
  171         << i18n(
"Stop &Clock" )
 
  172         << KIcon(
"media-playback-pause" );
 
  173     if ( ! StartClockRunning )
 
  175     QObject::connect( ka, SIGNAL( triggered() ), 
this, SLOT( slotToggleTimer() ) );
 
  176     QObject::connect(
data()->clock(), SIGNAL(clockToggled(
bool)), ka, SLOT(setChecked(
bool)) );
 
  178     QObject::connect(
data()->clock(), SIGNAL(clockToggled(
bool)), 
this, SLOT(
updateTime()) );
 
  179     actionCollection()->addAction(
"time_step_forward", 
this, SLOT( slotStepForward() ) )
 
  180         << i18n(
"Advance one step forward in time")
 
  181         << KIcon(
"media-skip-forward" )
 
  182         << KShortcut( Qt::Key_Greater, Qt::Key_Period );
 
  183     actionCollection()->addAction(
"time_step_backward", 
this, SLOT( slotStepBackward() ) )
 
  184         << i18n(
"Advance one step backward in time")
 
  185         << KIcon(
"media-skip-backward" )
 
  186         << KShortcut( Qt::Key_Less, Qt::Key_Comma );
 
  189     actionCollection()->addAction(
"zenith", 
this, SLOT( slotPointFocus() ) )
 
  192     actionCollection()->addAction(
"north", 
this, SLOT( slotPointFocus() ) )
 
  195     actionCollection()->addAction(
"east", 
this, SLOT( slotPointFocus() ) )
 
  198     actionCollection()->addAction(
"south", 
this, SLOT( slotPointFocus() ) )
 
  201     actionCollection()->addAction(
"west", 
this, SLOT( slotPointFocus() ) )
 
  205     actionCollection()->addAction(
"find_object", 
this, SLOT( slotFind() ) )
 
  206         << i18n(
"&Find Object...")
 
  207         << KIcon(
"edit-find")
 
  208         << KShortcut( Qt::CTRL+Qt::Key_F );
 
  209     actionCollection()->addAction(
"track_object", 
this, SLOT( 
slotTrack() ) )
 
  210         << i18n(
"Engage &Tracking")
 
  211         << KIcon(
"object-locked" )
 
  212         << KShortcut( Qt::CTRL+Qt::Key_T  );
 
  213     actionCollection()->addAction(
"manual_focus", 
this, SLOT( slotManualFocus() ) )
 
  214         << i18n(
"Set Coordinates &Manually..." )
 
  215         << KShortcut( Qt::CTRL+Qt::Key_M );
 
  218     actionCollection()->addAction( KStandardAction::ZoomIn,  
"zoom_in",  
map(), SLOT( slotZoomIn() ) );
 
  219     actionCollection()->addAction( KStandardAction::ZoomOut, 
"zoom_out", 
map(), SLOT( slotZoomOut() ) );
 
  220     actionCollection()->addAction(
"zoom_default", 
map(), SLOT( slotZoomDefault() ) )
 
  221         << i18n(
"&Default Zoom")
 
  222         << KIcon(
"zoom-fit-best" )
 
  223         << KShortcut( Qt::CTRL+Qt::Key_Z );
 
  224     actionCollection()->addAction(
"zoom_set", 
this, SLOT( 
slotSetZoom() ) )
 
  225         << i18n(
"&Zoom to Angular Size..." )
 
  226         << KIcon(
"zoom-original" )
 
  227         << KShortcut( Qt::CTRL+Qt::SHIFT+Qt::Key_Z );
 
  229     actionCollection()->addAction( KStandardAction::FullScreen, 
this, SLOT( slotFullScreen() ) );
 
  231     actionCollection()->addAction(
"coordsys", 
this, SLOT( slotCoordSys() ) )
 
  232         << (
Options::useAltAz() ? i18n(
"Switch to star globe view (Equatorial &Coordinates)"): i18n(
"Switch to horizonal view (Horizontal &Coordinates)"))
 
  233         << KShortcut(
"Space" );
 
  237     actionCollection()->addAction(
"opengl", 
SkyMap::Instance(), SLOT( slotToggleGL() ) )
 
  238         << (
Options::useGL() ? i18n(
"Switch to QPainter backend"): i18n(
"Switch to OpenGL backend"));
 
  241     actionCollection()->addAction(
"project_lambert", 
this, SLOT( slotMapProjection() ) )
 
  242         << i18n(
"&Lambert Azimuthal Equal-area" )
 
  244         << AddToGroup(projectionGroup)
 
  246     actionCollection()->addAction(
"project_azequidistant", 
this, SLOT( slotMapProjection() ) )
 
  247         << i18n(
"&Azimuthal Equidistant" )
 
  249         << AddToGroup(projectionGroup)
 
  251     actionCollection()->addAction(
"project_orthographic", 
this, SLOT( slotMapProjection() ) )
 
  252         << i18n(
"&Orthographic" )
 
  254         << AddToGroup(projectionGroup)
 
  256     actionCollection()->addAction(
"project_equirectangular", 
this, SLOT( slotMapProjection() ) )
 
  257         << i18n(
"&Equirectangular" )
 
  259         << AddToGroup(projectionGroup)
 
  261     actionCollection()->addAction(
"project_stereographic", 
this, SLOT( slotMapProjection() ) )
 
  262         << i18n(
"&Stereographic" )
 
  264         << AddToGroup(projectionGroup)
 
  266     actionCollection()->addAction(
"project_gnomonic", 
this, SLOT( slotMapProjection() ) )
 
  267         << i18n(
"&Gnomonic" )
 
  269         << AddToGroup(projectionGroup)
 
  274     KAction* kaBoxes = actionCollection()->add<KToggleAction>(
"show_boxes" )
 
  275         << 
i18nc(
"Show the information boxes", 
"Show &Info Boxes")
 
  277     connect( kaBoxes, SIGNAL(toggled(
bool)), 
map(), SLOT(slotToggleInfoboxes(
bool)));
 
  280     ka = actionCollection()->add<KToggleAction>(
"show_time_box")
 
  281         << 
i18nc(
"Show time-related info box", 
"Show &Time Box");
 
  282     connect(kaBoxes, SIGNAL( toggled(
bool) ), ka,    SLOT( setEnabled(
bool) ) );
 
  283     connect(ka,      SIGNAL( toggled(
bool) ), 
map(), SLOT( slotToggleTimeBox(
bool)));
 
  287     ka = actionCollection()->add<KToggleAction>(
"show_focus_box")
 
  288         << 
i18nc(
"Show focus-related info box", 
"Show &Focus Box");
 
  289     connect(kaBoxes, SIGNAL( toggled(
bool) ), ka,    SLOT( setEnabled(
bool) ) );
 
  290     connect(ka,      SIGNAL( toggled(
bool) ), 
map(), SLOT( slotToggleFocusBox(
bool)));
 
  294     ka = actionCollection()->add<KToggleAction>(
"show_location_box")
 
  295         << 
i18nc(
"Show location-related info box", 
"Show &Location Box");
 
  296     connect(kaBoxes, SIGNAL( toggled(
bool) ), ka,    SLOT( setEnabled(
bool) ) );
 
  297     connect(ka,      SIGNAL( toggled(
bool) ), 
map(), SLOT( slotToggleGeoBox(
bool)));
 
  303     newToggleAction( actionCollection(), 
"show_mainToolBar", i18n(
"Show Main Toolbar"),
 
  304                      toolBar(
"kstarsToolBar"), SLOT(setVisible(
bool)));
 
  305     newToggleAction( actionCollection(), 
"show_viewToolBar", i18n(
"Show View Toolbar"),
 
  306                      toolBar( 
"viewToolBar" ), SLOT(setVisible(
bool)));
 
  309     newToggleAction( actionCollection(), 
"show_statusBar", i18n(
"Show Statusbar"),
 
  310                      this, SLOT(slotShowGUIItem(
bool)));
 
  311     newToggleAction( actionCollection(), 
"show_sbAzAlt",   i18n(
"Show Az/Alt Field"),
 
  312                      this, SLOT(slotShowGUIItem(
bool)));
 
  313     newToggleAction( actionCollection(), 
"show_sbRADec",   i18n(
"Show RA/Dec Field"),
 
  314                      this, SLOT(slotShowGUIItem(
bool)));
 
  317     colorActionMenu = actionCollection()->add<KActionMenu>(
"colorschemes" );
 
  318     colorActionMenu->setText( i18n(
"C&olor Schemes" ) );
 
  325     QFile file( KStandardDirs::locate(
"appdata", 
"colors.dat" ) ); 
 
  326     if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
 
  328         while ( !stream.atEnd() ) {
 
  329             QString line = stream.readLine();
 
  330             QString schemeName = line.left( line.indexOf( 
':' ) );
 
  331             QString actionname = 
"cs_" + line.mid( line.indexOf( 
':' ) +1, line.indexOf( 
'.' ) - line.indexOf( 
':' ) - 1 );
 
  332             addColorMenuItem( i18n( schemeName.toLocal8Bit() ), actionname.toLocal8Bit() );
 
  338     fovActionMenu = actionCollection()->add<KActionMenu>(
"fovsymbols" );
 
  339     fovActionMenu->setText( i18n(
"&FOV Symbols" ) );
 
  342     actionCollection()->addAction(
"geolocation", 
this, SLOT( 
slotGeoLocator() ) )
 
  343         << 
i18nc(
"Location on Earth", 
"&Geographic..." )
 
  344         << KIcon(
"applications-internet" )
 
  345         << KShortcut( Qt::CTRL+Qt::Key_G );
 
  346     actionCollection()->addAction( KStandardAction::Preferences, 
"configure", 
this, SLOT( slotViewOps() ) );
 
  347     actionCollection()->addAction(
"startwizard", 
this, SLOT( slotWizard() ) )
 
  348         << i18n(
"Startup Wizard..." )
 
  349         << KIcon(
"tools-wizard" );
 
  352     actionCollection()->addAction( 
"update_comets", 
this, SLOT( slotUpdateComets() ) )
 
  353         << i18n( 
"Update comets orbital elements" );
 
  354     actionCollection()->addAction( 
"update_asteroids", 
this, SLOT( slotUpdateAsteroids() ) )
 
  355         << i18n( 
"Update asteroids orbital elements" );
 
  356     actionCollection()->addAction(
"update_supernovae", 
this, SLOT(slotUpdateSupernovae() ) )
 
  357         << i18n( 
"Update Recent Supernovae data" );
 
  360     actionCollection()->addAction(
"astrocalculator", 
this, SLOT( slotCalculator() ) )
 
  361         << i18n(
"Calculator")
 
  362         << KIcon(
"accessories-calculator" )
 
  363         << KShortcut( Qt::CTRL+Qt::Key_C );
 
  365     actionCollection()->addAction(
"moonphasetool", 
this, SLOT( slotMoonPhaseTool() ) )
 
  366         << i18n(
"Moon Phase Calendar");
 
  368     actionCollection()->addAction(
"obslist", 
this, SLOT( slotObsList() ) )
 
  369         << i18n(
"Observation Planner")
 
  370         << KShortcut( Qt::CTRL+Qt::Key_L );
 
  372     actionCollection()->addAction(
"altitude_vs_time", 
this, SLOT( slotAVT() ) )
 
  373         << i18n(
"Altitude vs. Time")
 
  374         << KShortcut( Qt::CTRL+Qt::Key_A );
 
  375     actionCollection()->addAction(
"whats_up_tonight", 
this, SLOT( slotWUT() ) )
 
  376         << i18n(
"What's up Tonight")
 
  377         << KShortcut(Qt::CTRL+Qt::Key_U );
 
  378     actionCollection()->addAction(
"whats_interesting", 
this, SLOT( slotWISettings() ) )
 
  379         << i18n(
"What's Interesting...")
 
  380         << KShortcut(Qt::CTRL+Qt::Key_W );
 
  381     actionCollection()->addAction(
"skycalendar", 
this, SLOT( slotCalendar() ) )
 
  382         << i18n(
"Sky Calendar");
 
  386         actionCollection()->addAction(
"ekos", 
this, SLOT( slotEkos() ) )
 
  397     actionCollection()->addAction(
"scriptbuilder", 
this, SLOT( slotScriptBuilder() ) )
 
  398         << i18n(
"Script Builder")
 
  399         << KShortcut(Qt::CTRL+Qt::Key_B );
 
  400     actionCollection()->addAction(
"solarsystem", 
this, SLOT( slotSolarSystem() ) )
 
  401         << i18n(
"Solar System")
 
  402         << KShortcut(Qt::CTRL+Qt::Key_Y );
 
  403     actionCollection()->addAction(
"jmoontool", 
this, SLOT( slotJMoonTool() ) )
 
  404         << i18n(
"Jupiter's Moons")
 
  405         << KShortcut(Qt::CTRL+Qt::Key_J );
 
  406     actionCollection()->addAction(
"flagmanager", 
this, SLOT( 
slotFlagManager() ) )
 
  409     actionCollection()->addAction(
"ewriter", 
this, SLOT( slotEquipmentWriter() ) )
 
  410         << i18n(
"Define Equipment...")
 
  411         << KShortcut( Qt::CTRL+Qt::Key_0 );
 
  412     actionCollection()->addAction(
"obsadd", 
this, SLOT( slotObserverAdd() ) )
 
  413         << i18n( 
"Add Observer..." )
 
  414         << KShortcut( Qt::CTRL+Qt::Key_1 );
 
  417     ka = actionCollection()->addAction(
"execute", 
this, SLOT( slotExecute() ) )
 
  418         << i18n( 
"Execute the session Plan..." )
 
  419         << KShortcut( Qt::CTRL+Qt::Key_2 );
 
  426         actionCollection()->addAction(
"telescope_wizard", 
this, SLOT( slotTelescopeWizard() ) )
 
  427             << i18n(
"Telescope Wizard...")
 
  428             << KIcon(
"tools-wizard" );
 
  429         actionCollection()->addAction(
"device_manager", 
this, SLOT( slotINDIDriver() ) )
 
  430             << i18n(
"Device Manager...")
 
  431             << KIcon(
"network-server" );
 
  432         ka = actionCollection()->addAction(
"indi_cpl", 
this, SLOT( slotINDIPanel() ) )
 
  433             << i18n(
"INDI Control Panel...");
 
  434         ka->setEnabled(
false);
 
  441     actionCollection()->addAction( KStandardAction::TipofDay, 
"help_tipofday", 
this, SLOT( slotTipOfDay() ) )
 
  442     ->setWhatsThis(i18n(
"Displays the Tip of the Day"));
 
  447     TimeStep = 
new TimeStepBox( toolBar(
"kstarsToolBar") );
 
  449     QString TSBToolTip = 
i18nc( 
"Tooltip describing the nature of the time step control", 
"Use this to set the rate at which time in the simulation flows.\nFor time step \'X\' up to 10 minutes, time passes at the rate of \'X\' per second.\nFor time steps larger than 10 minutes, frames are displayed at an interval of \'X\'." );
 
  450     TimeStep->setToolTip( TSBToolTip );
 
  451     TimeStep->
tsbox()->setToolTip( TSBToolTip );
 
  452     ka = actionCollection()->addAction(
"timestep_control")
 
  453         << i18n(
"Time step control");
 
  454     ka->setDefaultWidget( TimeStep );
 
  457     actionCollection()->add<KToggleAction>(
"show_stars", 
this, SLOT( slotViewToolBar() ) )
 
  458         << 
i18nc(
"Toggle Stars in the display", 
"Stars" )
 
  459         << KIcon(
"kstars_stars" )
 
  460         << ToolTip( i18n(
"Toggle stars") );
 
  461     actionCollection()->add<KToggleAction>(
"show_deepsky", 
this, SLOT( slotViewToolBar() ) )
 
  462         << 
i18nc(
"Toggle Deep Sky Objects in the display", 
"Deep Sky" )
 
  463         << KIcon(
"kstars_deepsky" )
 
  464         << ToolTip( i18n(
"Toggle deep sky objects") );
 
  465     actionCollection()->add<KToggleAction>(
"show_planets", 
this, SLOT( slotViewToolBar() ) )
 
  466         << 
i18nc(
"Toggle Solar System objects in the display", 
"Solar System" )
 
  467         << KIcon(
"kstars_planets" )
 
  468         << ToolTip( i18n(
"Toggle Solar system objects") );
 
  469     actionCollection()->add<KToggleAction>(
"show_clines", 
this, SLOT( slotViewToolBar() ) )
 
  470         << 
i18nc(
"Toggle Constellation Lines in the display", 
"Const. Lines" )
 
  471         << KIcon(
"kstars_clines" )
 
  472         << ToolTip( i18n(
"Toggle constellation lines") );
 
  473     actionCollection()->add<KToggleAction>(
"show_cnames", 
this, SLOT( slotViewToolBar() ) )
 
  474         << 
i18nc(
"Toggle Constellation Names in the display", 
"Const. Names" )
 
  475         << KIcon(
"kstars_cnames" )
 
  476         << ToolTip( i18n(
"Toggle constellation names") );
 
  477     actionCollection()->add<KToggleAction>(
"show_cbounds", 
this, SLOT( slotViewToolBar() ) )
 
  478         << 
i18nc(
"Toggle Constellation Boundaries in the display", 
"C. Boundaries" )
 
  479         << KIcon(
"kstars_cbound" )
 
  480         << ToolTip( i18n(
"Toggle constellation boundaries") );
 
  481     actionCollection()->add<KToggleAction>(
"show_mw", 
this, SLOT( slotViewToolBar() ) )
 
  482         << 
i18nc(
"Toggle Milky Way in the display", 
"Milky Way" )
 
  483         << KIcon(
"kstars_mw" )
 
  484         << ToolTip( i18n(
"Toggle milky way") );
 
  485     actionCollection()->add<KToggleAction>(
"show_equatorial_grid", 
this, SLOT( slotViewToolBar() ) )
 
  486         << 
i18nc(
"Toggle Equatorial Coordinate Grid in the display", 
"Equatorial coord. grid" )
 
  487         << KIcon(
"kstars_grid" )
 
  488         << ToolTip( i18n(
"Toggle equatorial coordinate grid") );
 
  489     actionCollection()->add<KToggleAction>(
"show_horizontal_grid", 
this, SLOT( slotViewToolBar() ) )
 
  490         << 
i18nc(
"Toggle Horizontal Coordinate Grid in the display", 
"Horizontal coord. grid" )
 
  491         << KIcon(
"kstars_hgrid" )
 
  492         << ToolTip( i18n(
"Toggle horizontal coordinate grid") );
 
  493     actionCollection()->add<KToggleAction>(
"show_horizon", 
this, SLOT( slotViewToolBar() ) )
 
  494         << 
i18nc(
"Toggle the opaque fill of the ground polygon in the display", 
"Ground" )
 
  495         << KIcon(
"kstars_horizon" )
 
  496         << ToolTip( i18n(
"Toggle opaque ground") );
 
  497     actionCollection()->add<KToggleAction>(
"show_flags", 
this, SLOT( slotViewToolBar() ) )
 
  498         << 
i18nc(
"Toggle flags in the display", 
"Flags" )
 
  499         << KIcon(
"kstars_flag" )
 
  500         << ToolTip( i18n(
"Toggle flags") );
 
  501     actionCollection()->add<KToggleAction>(
"show_satellites", 
this, SLOT( slotViewToolBar() ) )
 
  502         << 
i18nc(
"Toggle satellites in the display", 
"Satellites" )
 
  503         << KIcon(
"kstars_satellites" )
 
  504         << ToolTip( i18n(
"Toggle satellites") );
 
  505     actionCollection()->add<KToggleAction>(
"show_supernovae", 
this, SLOT( slotViewToolBar() ) )
 
  506         << 
i18nc(
"Toggle supernovae in the display", 
"Supernovae" )
 
  507         << KIcon(
"kstars_supernovae" )
 
  508         << ToolTip( i18n(
"Toggle supernovae") );
 
  510     setXMLFile(
"kstarsui.rc" );
 
  516 void KStars::repopulateFOV() {
 
  518     qDeleteAll( 
data()->availFOVs );
 
  523     fovActionMenu->menu()->clear();
 
  524     foreach(
FOV* fov, 
data()->availFOVs) {
 
  525         KToggleAction *kta = actionCollection()->add<KToggleAction>( fov->
name() );
 
  526         kta->setText( fov->
name() );
 
  528             kta->setChecked(
true);
 
  530         fovActionMenu->addAction( kta );
 
  531         connect( kta, SIGNAL( toggled( 
bool ) ), 
this, SLOT( slotTargetSymbol(
bool) ) );
 
  534     KAction* ka = actionCollection()->addAction(
"edit_fov",  
this, SLOT( slotFOVEdit() ) )
 
  535         << i18n(
"Edit FOV Symbols...");
 
  536     fovActionMenu->addSeparator();
 
  537     fovActionMenu->addAction( ka );
 
  540 void KStars::initStatusBar() {
 
  541     statusBar()->insertPermanentItem( i18n( 
" Welcome to KStars " ), 0, 1 );
 
  542     statusBar()->setItemAlignment( 0, Qt::AlignLeft | Qt::AlignVCenter );
 
  544     QString s = 
"000d 00m 00s,   +00d 00\' 00\""; 
 
  546         statusBar()->insertPermanentFixedItem( s, 1 );
 
  547         statusBar()->setItemAlignment( 1, Qt::AlignRight | Qt::AlignVCenter );
 
  548         statusBar()->changeItem( QString(), 1 );
 
  552         statusBar()->insertPermanentFixedItem( s, 2 );
 
  553         statusBar()->setItemAlignment( 2, Qt::AlignRight | Qt::AlignVCenter );
 
  554         statusBar()->changeItem( QString(), 2 );
 
  561 void KStars::datainitFinished() {
 
  563     connect( 
data()->clock(), SIGNAL( timeAdvanced() ),
 
  565     connect( 
data()->clock(), SIGNAL( timeChanged() ),
 
  571     connect( 
data()->clock(), SIGNAL( scaleChanged( 
float ) ),
 
  572              map(), SLOT( slotClockSlewing() ) );
 
  574     connect( 
data(),   SIGNAL( update() ),            
map(),  SLOT( forceUpdateNow() ) );
 
  575     connect( TimeStep, SIGNAL( scaleChanged(
float) ), 
data(), SLOT( setTimeDirection( 
float ) ) );
 
  576     connect( TimeStep, SIGNAL( scaleChanged(
float) ),
 
  577              data()->clock(), SLOT( setClockScale( 
float )) );
 
  578     connect( TimeStep, SIGNAL( scaleChanged(
float) ), 
map(),  SLOT( setFocus() ) );
 
  582     obsList = 
new ObservingList( 
this );
 
  583     eWriter = 
new EquipmentWriter();
 
  584     oAdd = 
new ObserverAdd;
 
  587     if ( StartClockRunning )
 
  591     connect( 
data(), SIGNAL( clearCache() ), 
this,
 
  612     KTipDialog::showTip(
this, 
"kstars/tips");
 
  618 void KStars::initFocus() {
 
  636             kWarning() << 
"Cannot center on " 
  638                        << 
": no object found." << endl;
 
  665             map()->focus()->alt().Degrees() < -1.0 ) {
 
  666         QString caption = i18n( 
"Initial Position is Below Horizon" );
 
  667         QString message = i18n( 
"The initial position is below the horizon.\nWould you like to reset to the default position?" );
 
  668         if ( KMessageBox::warningYesNo( 
this, message, caption,
 
  669                                         KGuiItem(i18n(
"Reset Position")), KGuiItem(i18n(
"Do Not Reset")), 
"dag_start_below_horiz" ) == KMessageBox::Yes ) {
 
  677             DefaultFocus.
setAz( 180.0 );
 
  678             DefaultFocus.
setAlt( 45.0 );
 
  685     if ( 
map()->focusObject() && 
map()->focusObject()->isSolarSystem()
 
  688         data()->temporaryTrail = 
true;
 
  692 void KStars::buildGUI() {
 
  699     setCentralWidget( skymap );
 
  705     setupGUI(StandardWindowOptions (Default & ~Create));
 
  708     createGUI(
"kstarsui-win.rc");
 
  710     createGUI(
"kstarsui.rc");
 
  714     map()->QWidget::setFocus();
 
static double focusRA()
Get Right Ascension of focus position. 
 
static double focusDec()
Get Declination of focus position. 
 
void addColorMenuItem(const QString &name, const QString &actionName)
Add an item to the color-scheme action manu. 
 
SkyObject * objectNamed(const QString &name)
Find object by name. 
 
static bool showAltAzField()
Get Display Alt/Az coordinates in the statusbar? 
 
static bool showRADecField()
Get Display RA/Dec coordinates in the statusbar? 
 
class encapulating a Field-of-View symbol 
 
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument. 
 
void setDestination(const SkyPoint &f)
sets the destination point of the sky map. 
 
static QList< FOV * > readFOVs()
Read list of FOVs from "fov.dat". 
 
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument. 
 
void setFocus(SkyPoint *f)
sets the central focus point of the sky map. 
 
void setAz(dms az)
Sets Az, the Azimuth. 
 
void setFullTimeUpdate()
The Sky is updated more frequently than the moon, which is updated more frequently than the planets...
 
static bool isTracking()
Get Is tracking engaged? 
 
static bool useGL()
Get Switch to OpenGL backend. 
 
SkyObject * starNearest(SkyPoint *p, double &maxrad)
 
static void setFitsDir(const QString &v)
Set FITS Default directory. 
 
static QString focusObject()
Get Name of focused object. 
 
static bool showGround()
Get Draw opaque ground in the sky map? 
 
static bool showGeoBox()
Get Display the geographic InfoBox? 
 
static uint windowHeight()
Get Height of main window, in pixels. 
 
void slotSetZoom()
action slot: Allow user to specify a field-of-view angle for the display window in degrees...
 
This composite widget consists of a TimeSpinBox (a QSpinBox), coupled with a TimeUnitBox (a second pa...
 
static uint projection()
Get Mapping projection algorithm. 
 
The sky coordinates of a point in the sky. 
 
void applyConfig(bool doApplyFocus=true)
Apply config options throughout the program. 
 
static QStringList fOVNames()
Get Name of selected FOV indicators. 
 
void showFocusCoords()
Update object name and coordinates in the Focus InfoBox. 
 
TimeSpinBox * tsbox() const 
 
void slotShowPositionBar(SkyPoint *)
Display position in the status bar. 
 
static TextureManager * Create()
Create the instance of TextureManager. 
 
static void setIsTracking(bool v)
Set Is tracking engaged? 
 
static QString fitsDir()
Get FITS Default directory. 
 
static KStarsDateTime currentDateTime(KDateTime::Spec ts=KDateTime::Spec::ClockTime())
 
void slotGeoLocator()
action slot: open dialog for selecting a new geographic location 
 
i18nc("string from libindi, used in the config dialog","100x")
 
static bool runStartupWizard()
Get Run Startup Wizard when KStars launches? 
 
void updateTime(const bool automaticDSTchange=true)
Update time-dependent data and (possibly) repaint the sky map. 
 
void HorizontalToEquatorial(const dms *LST, const dms *lat)
Determine the (RA, Dec) coordinates of the SkyPoint from its (Altitude, Azimuth) coordinates, given the local sidereal time and the observer's latitude. 
 
SkyMapComposite * skyComposite()
 
static bool showTimeBox()
Get Display the time InfoBox? 
 
void slotFlagManager()
action slot: open Flag Manager 
 
void slotTrack()
action slot: Toggle whether kstars is tracking current position 
 
void EquatorialToHorizontal(const dms *LST, const dms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates, given the local sidereal time and the observer's latitude. 
 
void slotZoomChanged()
Called when zoom level is changed. 
 
void syncFOV()
Synchronize list of visible FOVs and list of selected FOVs in Options. 
 
static bool showInfoBoxes()
Get Meta-option to toggle display of all InfoBoxes. 
 
void slotSetTimeToNow()
action slot: sync kstars clock to system time 
 
static uint windowWidth()
Get Width of main window, in pixels. 
 
void setSnapNextFocus(bool b=true)
Disable or re-enable the slewing animation for the next Focus change. 
 
static double zoomFactor()
Get Zoom Factor, in pixels per radian. 
 
static bool showStatusBar()
Get Display the statusbar? 
 
static bool showFocusBox()
Get Display the focus InfoBox? 
 
static SkyMap * Instance()
 
static bool useAltAz()
Get Use horizontal coordinate system? 
 
KStarsData * data() const 
 
void clearCachedFindDialog()
Delete FindDialog because ObjNames list has changed in KStarsData due to reloading star data...
 
A subclass of TrailObject that provides additional information needed for most solar system objects...
 
Q_SCRIPTABLE Q_NOREPLY void start()
DBUS function to start the SimClock. 
 
void setAlt(dms alt)
Sets Alt, the Altitude. 
 
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), type, magnitude, and QStringLists of URLs for images and webpages regarding the object. 
 
static bool useAutoTrail()
Get Automatically add trail to centered solar system body?