00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qlayout.h>
00019 #include <qfile.h>
00020 #include <qdir.h>
00021 #include <dcopclient.h>
00022 #include <kshortcut.h>
00023 #include <kiconloader.h>
00024 #include <kpopupmenu.h>
00025 #include <kstatusbar.h>
00026 #include <ktip.h>
00027 #include <kmessagebox.h>
00028 #include <kstandarddirs.h>
00029 #include <kdeversion.h>
00030
00031 #include "Options.h"
00032 #include "kstars.h"
00033 #include "kstarsdata.h"
00034 #include "kstarssplash.h"
00035 #include "skymap.h"
00036 #include "skyobject.h"
00037 #include "ksplanetbase.h"
00038 #include "ksutils.h"
00039 #include "ksnumbers.h"
00040 #include "infoboxes.h"
00041 #include "toggleaction.h"
00042 #include "indimenu.h"
00043 #include "simclock.h"
00044 #include "timestepbox.h"
00045
00046
00047
00048
00049 void KStars::initActions() {
00050
00051 new KAction(i18n("&New Window"), "window_new", KShortcut( "Ctrl+N" ),
00052 this, SLOT( newWindow() ), actionCollection(), "new_window");
00053 new KAction(i18n("&Close Window"), "fileclose", KShortcut( "Ctrl+W" ),
00054 this, SLOT( closeWindow() ), actionCollection(), "close_window");
00055 new KAction( i18n( "&Download Data..." ), "knewstuff", KShortcut( "Ctrl+D" ),
00056 this, SLOT( slotDownload() ), actionCollection(), "get_data" );
00057 new KAction( i18n( "Open FITS..."), "fileopen", KShortcut( "Ctrl+O"), this, SLOT( slotOpenFITS()), actionCollection(), "open_file");
00058 new KAction( i18n( "&Save Sky Image..." ), "fileexport", KShortcut( "Ctrl+I" ),
00059 this, SLOT( slotExportImage() ), actionCollection(), "export_image" );
00060 new KAction( i18n( "&Run Script..." ), "launch", KShortcut( "Ctrl+R" ),
00061 this, SLOT( slotRunScript() ), actionCollection(), "run_script" );
00062 KStdAction::print(this, SLOT( slotPrint() ), actionCollection(), "print" );
00063 KStdAction::quit(this, SLOT( close() ), actionCollection(), "quit" );
00064
00065
00066 new KAction( i18n( "Set Time to &Now" ), KShortcut( "Ctrl+E" ),
00067 this, SLOT( slotSetTimeToNow() ), actionCollection(), "time_to_now" );
00068 new KAction( i18n( "set Clock to New Time", "&Set Time..." ), "clock", KShortcut( "Ctrl+S" ),
00069 this, SLOT( slotSetTime() ), actionCollection(), "time_dialog" );
00070 ToggleAction *actTimeRun = new ToggleAction( i18n( "Stop &Clock" ), BarIcon("player_pause"),
00071 i18n("Start &Clock"), BarIcon("1rightarrow"),
00072 0, this, SLOT( slotToggleTimer() ), actionCollection(), "timer_control" );
00073 actTimeRun->setOffToolTip( i18n( "Start Clock" ) );
00074 actTimeRun->setOnToolTip( i18n( "Stop Clock" ) );
00075 QObject::connect(data()->clock(), SIGNAL(clockStarted()), actTimeRun, SLOT(turnOn()) );
00076 QObject::connect(data()->clock(), SIGNAL(clockStopped()), actTimeRun, SLOT(turnOff()) );
00077
00078 QObject::connect(data()->clock(), SIGNAL(clockStopped()), this, SLOT(updateTime()) );
00079
00080
00081 new KAction(i18n( "&Zenith" ), KShortcut( "Z" ),
00082 this, SLOT( slotPointFocus() ), actionCollection(), "zenith");
00083 new KAction(i18n( "&North" ), KShortcut( "N" ),
00084 this, SLOT( slotPointFocus() ), actionCollection(), "north");
00085 new KAction(i18n( "&East" ), KShortcut( "E" ),
00086 this, SLOT( slotPointFocus() ), actionCollection(), "east");
00087 new KAction(i18n( "&South" ), KShortcut( "S" ),
00088 this, SLOT( slotPointFocus() ), actionCollection(), "south");
00089 new KAction(i18n( "&West" ), KShortcut( "W" ),
00090 this, SLOT( slotPointFocus() ), actionCollection(), "west");
00091 KAction *tmpAction = KStdAction::find( this, SLOT( slotFind() ),
00092 actionCollection(), "find_object" );
00093 tmpAction->setText( i18n( "&Find Object..." ) );
00094 tmpAction->setToolTip( i18n( "Find object" ) );
00095
00096 new KAction( i18n( "Engage &Tracking" ), "decrypted", KShortcut( "Ctrl+T" ),
00097 this, SLOT( slotTrack() ), actionCollection(), "track_object" );
00098
00099 new KAction( i18n( "Set Focus &Manually..." ), KShortcut( "Ctrl+M" ),
00100 this, SLOT( slotManualFocus() ), actionCollection(), "manual_focus" );
00101
00102
00103 KStdAction::zoomIn(this, SLOT( slotZoomIn() ), actionCollection(), "zoom_in" );
00104 KStdAction::zoomOut(this, SLOT( slotZoomOut() ), actionCollection(), "zoom_out" );
00105 new KAction( i18n( "&Default Zoom" ), "viewmagfit.png", KShortcut( "Ctrl+Z" ),
00106 this, SLOT( slotDefaultZoom() ), actionCollection(), "zoom_default" );
00107 new KAction( i18n( "&Zoom to Angular Size..." ), "viewmag.png", KShortcut( "Ctrl+Shift+Z" ),
00108 this, SLOT( slotSetZoom() ), actionCollection(), "zoom_set" );
00109 actCoordSys = new ToggleAction( i18n("Horizontal &Coordinates"), i18n( "Equatorial &Coordinates" ),
00110 Key_Space, this, SLOT( slotCoordSys() ), actionCollection(), "coordsys" );
00111 KStdAction::fullScreen( this, SLOT( slotFullScreen() ), actionCollection(), 0 );
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 KToggleAction *a = new KToggleAction(i18n( "Show the information boxes", "Show &Info Boxes"),
00123 0, 0, 0, actionCollection(), "show_boxes");
00124 a->setChecked( Options::showInfoBoxes() );
00125 QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(setVisible(bool)));
00126 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00127
00128 a = new KToggleAction(i18n( "Show time-related info box", "Show &Time Box"),
00129 0, 0, 0, actionCollection(), "show_time_box");
00130 QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showTimeBox(bool)));
00131 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00132
00133 a = new KToggleAction(i18n( "Show focus-related info box", "Show &Focus Box"),
00134 0, 0, 0, actionCollection(), "show_focus_box");
00135 QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showFocusBox(bool)));
00136 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00137
00138 a = new KToggleAction(i18n( "Show location-related info box", "Show &Location Box"),
00139 0, 0, 0, actionCollection(), "show_location_box");
00140 QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showGeoBox(bool)));
00141 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00142
00143
00144 a = new KToggleAction(i18n( "Show Main Toolbar" ),
00145 0, 0, 0, actionCollection(), "show_mainToolBar");
00146 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00147
00148 a = new KToggleAction(i18n( "Show View Toolbar" ),
00149 0, 0, 0, actionCollection(), "show_viewToolBar");
00150 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00151
00152
00153 a = new KToggleAction(i18n( "Show Statusbar" ),
00154 0, 0, 0, actionCollection(), "show_statusBar");
00155 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00156
00157 a = new KToggleAction(i18n( "Show Az/Alt Field" ),
00158 0, 0, 0, actionCollection(), "show_sbAzAlt");
00159 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00160
00161 a = new KToggleAction(i18n( "Show RA/Dec Field" ),
00162 0, 0, 0, actionCollection(), "show_sbRADec");
00163 QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool)));
00164
00165
00166 colorActionMenu = new KActionMenu( i18n( "C&olor Schemes" ), actionCollection(), "colorschemes" );
00167 addColorMenuItem( i18n( "&Default" ), "cs_default" );
00168 addColorMenuItem( i18n( "&Star Chart" ), "cs_chart" );
00169 addColorMenuItem( i18n( "&Night Vision" ), "cs_night" );
00170 addColorMenuItem( i18n( "&Moonless Night" ), "cs_moonless-night" );
00171
00172
00173 QFile file;
00174 QString line, schemeName, filename;
00175 file.setName( locate( "appdata", "colors.dat" ) );
00176 if ( file.exists() && file.open( IO_ReadOnly ) ) {
00177 QTextStream stream( &file );
00178
00179 while ( !stream.eof() ) {
00180 line = stream.readLine();
00181 schemeName = line.left( line.find( ':' ) );
00182
00183 filename = "cs_" + line.mid( line.find( ':' ) +1, line.find( '.' ) - line.find( ':' ) - 1 );
00184 addColorMenuItem( i18n( schemeName.local8Bit() ), filename.local8Bit() );
00185 }
00186 file.close();
00187 }
00188
00189
00190 fovActionMenu = new KActionMenu( i18n( "&FOV Symbols" ), actionCollection(), "fovsymbols" );
00191 initFOV();
00192
00193 new KAction( i18n( "Location on Earth", "&Geographic..." ),
00194 "kstars_geo", KShortcut( "Ctrl+G" ), this,
00195 SLOT( slotGeoLocator() ), actionCollection(), "geolocation" );
00196
00197 KStdAction::preferences( this, SLOT( slotViewOps() ), actionCollection(), "configure" );
00198
00199 new KAction(i18n( "Startup Wizard..." ), "wizard", KShortcut(),
00200 this, SLOT( slotWizard() ), actionCollection(), "startwizard" );
00201
00202
00203 new KAction(i18n( "Calculator..."), KShortcut( "Ctrl+C"),
00204 this, SLOT( slotCalculator() ), actionCollection(), "astrocalculator");
00205
00206 new KAction(i18n( "Observing List..."), KShortcut( "Ctrl+L"),
00207 this, SLOT( slotObsList() ), actionCollection(), "obslist");
00208
00209
00210 if (!data()->VariableStarsList.isEmpty())
00211 new KAction(i18n( "AAVSO Light Curves..."), KShortcut( "Ctrl+V"),
00212 this, SLOT( slotLCGenerator() ), actionCollection(), "lightcurvegenerator");
00213
00214 new KAction(i18n( "Altitude vs. Time..."), KShortcut( "Ctrl+A"),
00215 this, SLOT( slotAVT() ), actionCollection(), "altitude_vs_time");
00216 new KAction(i18n( "What's up Tonight..."), KShortcut("Ctrl+U"),
00217 this, SLOT(slotWUT()), actionCollection(), "whats_up_tonight");
00218
00219
00220
00221 new KAction(i18n( "Script Builder..."), KShortcut("Ctrl+B"),
00222 this, SLOT(slotScriptBuilder()), actionCollection(), "scriptbuilder");
00223 new KAction(i18n( "Solar System..."), KShortcut("Ctrl+Y"),
00224 this, SLOT(slotSolarSystem()), actionCollection(), "solarsystem");
00225 new KAction(i18n( "Jupiter's Moons..."), KShortcut("Ctrl+J"),
00226 this, SLOT(slotJMoonTool()), actionCollection(), "jmoontool");
00227
00228
00229 new KAction(i18n("Telescope Wizard..."), 0, this, SLOT(slotTelescopeWizard()), actionCollection(), "telescope_wizard");
00230 new KAction(i18n("Telescope Properties..."), 0, this, SLOT(slotTelescopeProperties()), actionCollection(), "telescope_properties");
00231 new KAction(i18n("Device Manager..."), 0, this, SLOT(slotINDIDriver()), actionCollection(), "device_manager");
00232
00233 tmpAction = new KAction(i18n("Capture Image Sequence..."), 0, this, SLOT(slotImageSequence()), actionCollection(), "capture_sequence");
00234 tmpAction->setEnabled(false);
00235
00236 tmpAction = new KAction(i18n("INDI Control Panel..."), 0, this, SLOT(slotINDIPanel()), actionCollection(), "indi_control_panel");
00237 tmpAction->setEnabled(false);
00238
00239 new KAction(i18n("Configure INDI..."), 0, this, SLOT(slotINDIConf()), actionCollection(), "configure_indi");
00240
00241
00242
00243
00244 new KAction( i18n( "Tip of the Day" ), "idea", 0,
00245 this, SLOT( slotTipOfDay() ), actionCollection(), "help_tipofday" );
00246
00247
00248 new KAction( i18n( "&Handbook" ), "contents", KShortcut( "F1" ),
00249 this, SLOT( appHelpActivated() ), actionCollection(), "handbook" );
00250
00251
00252
00253
00254
00255
00256 a = new KToggleAction( i18n( "Toggle Stars" ), "kstars_stars",
00257 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_stars" );
00258
00259
00260 a = new KToggleAction( i18n( "Toggle Deep Sky Objects" ), "kstars_deepsky",
00261 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_deepsky" );
00262
00263
00264 a = new KToggleAction( i18n( "Toggle Solar System" ), "kstars_planets",
00265 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_planets" );
00266
00267
00268 a = new KToggleAction( i18n( "Toggle Constellation Lines" ), "kstars_clines",
00269 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_clines" );
00270
00271
00272 a = new KToggleAction( i18n( "Toggle Constellation Names" ), "kstars_cnames",
00273 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_cnames" );
00274
00275
00276 a = new KToggleAction( i18n( "Toggle Constellation Boundaries" ), "kstars_cbound",
00277 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_cbounds" );
00278
00279
00280 a = new KToggleAction( i18n( "Toggle Milky Way" ), "kstars_mw",
00281 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_mw" );
00282
00283
00284 a = new KToggleAction( i18n( "Toggle Coordinate Grid" ), "kstars_grid",
00285 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_grid" );
00286
00287
00288 a = new KToggleAction( i18n( "Toggle Ground" ), "kstars_horizon",
00289 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_horizon" );
00290
00291 if (Options::fitsSaveDirectory().isEmpty())
00292 Options::setFitsSaveDirectory(QDir:: homeDirPath());
00293 }
00294
00295 void KStars::initFOV() {
00296
00297
00298 QFile f;
00299 QStringList fields;
00300 QString nm;
00301
00302 f.setName( locateLocal( "appdata", "fov.dat" ) );
00303
00304
00305 if ( (uint)f.size() == 0 ) f.remove();
00306
00307 if ( ! f.exists() ) {
00308 if ( ! f.open( IO_WriteOnly ) ) {
00309 kdDebug() << i18n( "Could not open fov.dat." ) << endl;
00310 } else {
00311 QTextStream ostream(&f);
00312 ostream << i18n( "Do not use a field-of-view indicator", "No FOV" ) << ":0.0:0:#AAAAAA" << endl;
00313 ostream << i18n( "use field-of-view for binoculars", "7x35 Binoculars" ) << ":558:1:#AAAAAA" << endl;
00314 ostream << i18n( "use 1-degree field-of-view indicator", "One Degree" ) << ":60:2:#AAAAAA" << endl;
00315 ostream << i18n( "use HST field-of-view indicator", "HST WFPC2" ) << ":2.4:0:#AAAAAA" << endl;
00316 ostream << i18n( "use Radiotelescope HPBW", "30m at 1.3cm" ) << ":1.79:1:#AAAAAA" << endl;
00317 f.close();
00318 }
00319 }
00320
00321
00322 if ( f.open( IO_ReadOnly ) ) {
00323 QTextStream stream( &f );
00324 while ( !stream.eof() ) {
00325 QString line = stream.readLine();
00326 fields = QStringList::split( ":", line );
00327
00328 if ( fields.count() == 4 ) {
00329 nm = fields[0].stripWhiteSpace();
00330 KToggleAction *kta = new KToggleAction( nm, 0, this, SLOT( slotTargetSymbol() ),
00331 actionCollection(), nm.utf8() );
00332 kta->setExclusiveGroup( "fovsymbol" );
00333 if ( nm == Options::fOVName() ) kta->setChecked( true );
00334 fovActionMenu->insert( kta );
00335 }
00336 }
00337 } else {
00338 kdDebug() << i18n( "Could not open file: %1" ).arg( f.name() ) << endl;
00339 }
00340
00341 fovActionMenu->popupMenu()->insertSeparator();
00342 fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) );
00343 }
00344
00345 void KStars::initStatusBar() {
00346 statusBar()->insertItem( i18n( " Welcome to KStars " ), 0, 1, true );
00347 statusBar()->setItemAlignment( 0, AlignLeft | AlignVCenter );
00348
00349 QString s = "000d 00m 00s, +00d 00\' 00\"";
00350
00351 if ( Options::showAltAzField() ) {
00352 statusBar()->insertFixedItem( s, 1, true );
00353 statusBar()->setItemAlignment( 1, AlignRight | AlignVCenter );
00354 statusBar()->changeItem( "", 1 );
00355 }
00356
00357 if ( Options::showRADecField() ) {
00358 statusBar()->insertFixedItem( s, 2, true );
00359 statusBar()->setItemAlignment( 2, AlignRight | AlignVCenter );
00360 statusBar()->changeItem( "", 2 );
00361 }
00362
00363 if ( ! Options::showStatusBar() ) statusBar()->hide();
00364 }
00365
00366 void KStars::datainitFinished(bool worked) {
00367 if (!worked) {
00368 kapp->quit();
00369 return;
00370 }
00371
00372 if (pd->splash) {
00373 delete pd->splash;
00374 pd->splash = 0;
00375 }
00376
00377 pd->buildGUI();
00378 data()->setFullTimeUpdate();
00379 updateTime();
00380
00381
00382 if ( StartClockRunning )
00383 data()->clock()->start();
00384
00385
00386 data()->fovSymbol.setName( Options::fOVName() );
00387 data()->fovSymbol.setSize( Options::fOVSize() );
00388 data()->fovSymbol.setShape( Options::fOVShape() );
00389 data()->fovSymbol.setColor( Options::fOVColor().name() );
00390
00391 show();
00392
00393
00394 if ( Options::runStartupWizard() ) {
00395 slotWizard();
00396
00397 slotSetTimeToNow();
00398 }
00399
00400
00401
00402
00403
00404
00405 if ( Options::useAltAz() && Options::showGround() &&
00406 map()->focus()->alt()->Degrees() < -1.0 ) {
00407 QString caption = i18n( "Initial Position is Below Horizon" );
00408 QString message = i18n( "The initial position is below the horizon.\nWould you like to reset to the default position?" );
00409 if ( KMessageBox::warningYesNo( this, message, caption,
00410 i18n("Reset Position"), i18n("Do Not Reset"), "dag_start_below_horiz" ) == KMessageBox::Yes ) {
00411 map()->setClickedObject( NULL );
00412 map()->setFocusObject( NULL );
00413 Options::setIsTracking( false );
00414
00415 data()->setSnapNextFocus(true);
00416
00417 SkyPoint DefaultFocus;
00418 DefaultFocus.setAz( 180.0 );
00419 DefaultFocus.setAlt( 45.0 );
00420 DefaultFocus.HorizontalToEquatorial( LST(), geo()->lat() );
00421 map()->setDestination( &DefaultFocus );
00422 }
00423 }
00424
00425
00426 Options::setFocusRA( map()->focus()->ra()->Hours() );
00427 Options::setFocusDec( map()->focus()->dec()->Degrees() );
00428
00429
00430 applyConfig();
00431
00432
00433 if ( map()->focusObject() && map()->focusObject()->isSolarSystem()
00434 && Options::useAutoTrail() ) {
00435 ((KSPlanetBase*)map()->focusObject())->addToTrail();
00436 data()->temporaryTrail = true;
00437 }
00438
00439
00440 KTipDialog::showTip( "kstars/tips" );
00441 }
00442
00443 void KStars::privatedata::buildGUI() {
00444
00445 ks->centralWidget = new QWidget( ks );
00446 ks->setCentralWidget( ks->centralWidget );
00447
00448
00449 ks->AAVSODialog = 0;
00450
00451
00452 ks->indimenu = new INDIMenu(ks);
00453
00454
00455 ks->indidriver = 0;
00456
00457
00458 ks->indiseq = 0;
00459
00460 ks->skymap = new SkyMap( ks->data(), ks->centralWidget );
00461
00462 QObject::connect(kstarsData, SIGNAL( update() ), ks->skymap, SLOT( forceUpdateNow() ) );
00463
00464
00465 ks->map()->QWidget::setFocus();
00466
00467 ks->initStatusBar();
00468 ks->initActions();
00469
00470
00471 ks->topLayout = new QVBoxLayout( ks->centralWidget );
00472 ks->topLayout->addWidget( ks->skymap );
00473
00474
00475 ks->createGUI("kstarsui.rc", false);
00476
00477
00478
00479
00480 ks->toolBar( "viewToolBar" )->setIconText( KToolBar::IconOnly );
00481
00482 ks->TimeStep = new TimeStepBox( ks->toolBar() );
00483 ks->toolBar()->insertWidget( 0, 6, ks->TimeStep, 15 );
00484
00485
00486
00487 connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks->data(), SLOT( setTimeDirection( float ) ) );
00488 connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks->data()->clock(), SLOT( setScale( float )) );
00489
00490 connect( ks->data()->clock(), SIGNAL( scaleChanged( float ) ), ks->map(), SLOT( slotClockSlewing() ) );
00491 connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks, SLOT( mapGetsFocus() ) );
00492
00493 ks->resize( Options::windowWidth(), Options::windowHeight() );
00494
00495
00496 ks->setGeoLocation( Options::cityName(), Options::provinceName(), Options::countryName() );
00497
00498
00499 KStarsDateTime startDate = KStarsDateTime::fromString( ks->StartDateString );
00500 if ( startDate.isValid() )
00501 ks->data()->changeDateTime( ks->geo()->LTtoUT( startDate ) );
00502 else
00503 ks->slotSetTimeToNow();
00504
00505
00506 KSNumbers tempnum(ks->data()->ut().djd());
00507 ks->data()->initGuides(&tempnum);
00508
00509
00510 QObject::connect( ks->data()->clock(), SIGNAL( timeAdvanced() ), ks, SLOT( updateTime() ) );
00511 QObject::connect( ks->data()->clock(), SIGNAL( timeChanged() ), ks, SLOT( updateTime() ) );
00512
00513
00514 QObject::connect( kstarsData, SIGNAL( clearCache() ), ks, SLOT( clearCachedFindDialog() ) );
00515
00516 SkyPoint newPoint;
00517 if ( ks->data()->useDefaultOptions ) {
00518 newPoint.setAz( Options::focusRA() );
00519 newPoint.setAlt( Options::focusDec() + 0.0001 );
00520 newPoint.HorizontalToEquatorial( ks->LST(), ks->geo()->lat() );
00521 } else {
00522 newPoint.set( Options::focusRA(), Options::focusDec() );
00523 }
00524
00525
00526 if ( (Options::focusObject() != i18n( "star" ) ) &&
00527 (Options::focusObject() != i18n( "nothing" ) ) )
00528 ks->map()->setFocusObject( ks->data()->objectNamed( Options::focusObject() ) );
00529
00530 ks->updateTime();
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541 if ( Options::isTracking() ) {
00542 if ( (Options::focusObject() == i18n( "star" ) ) ||
00543 (Options::focusObject() == i18n( "nothing" ) ) ) {
00544 ks->map()->setFocusPoint( &newPoint );
00545 } else {
00546 ks->map()->setClickedObject( ks->data()->objectNamed( Options::focusObject() ) );
00547 if ( ks->map()->clickedObject() ) {
00548 ks->map()->setFocusPoint( ks->map()->clickedObject() );
00549 ks->map()->setFocusObject( ks->map()->clickedObject() );
00550 } else {
00551 ks->map()->setFocusPoint( &newPoint );
00552 }
00553 }
00554
00555 } else {
00556 ks->map()->setFocusPoint( &newPoint );
00557
00558 }
00559
00560
00561
00562 ks->map()->setDestination( ks->map()->focusPoint() );
00563 ks->map()->destination()->EquatorialToHorizontal( ks->LST(), ks->geo()->lat() );
00564 ks->map()->setFocus( ks->map()->destination() );
00565 ks->map()->focus()->EquatorialToHorizontal( ks->LST(), ks->geo()->lat() );
00566
00567
00568
00569 ks->map()->showFocusCoords();
00570
00571 ks->data()->setHourAngle( ks->LST()->Hours() - ks->map()->focus()->ra()->Hours() );
00572
00573 ks->map()->setOldFocus( ks->map()->focus() );
00574 ks->map()->oldfocus()->setAz( ks->map()->focus()->az()->Degrees() );
00575 ks->map()->oldfocus()->setAlt( ks->map()->focus()->alt()->Degrees() );
00576
00577
00578 if ( Options::zoomFactor() >= MAXZOOM ) ks->actionCollection()->action("zoom_in")->setEnabled( false );
00579 if ( Options::zoomFactor() <= MINZOOM ) ks->actionCollection()->action("zoom_out")->setEnabled( false );
00580
00581 kapp->dcopClient()->resume();
00582 }