? branch.diff Index: kstars/kstars.cpp =================================================================== RCS file: /home/kde/kdeedu/kstars/kstars/kstars.cpp,v retrieving revision 1.53 retrieving revision 1.53.2.1 diff -u -p -r1.53 -r1.53.2.1 --- kstars/kstars/kstars.cpp 14 Oct 2002 22:29:24 -0000 1.53 +++ kstars/kstars/kstars.cpp 2 Feb 2003 04:04:53 -0000 1.53.2.1 @@ -91,7 +91,6 @@ KStars::KStars( KStarsData* kd ) KStars::~KStars() { - kdDebug() << "in kstars destructor..." << endl; saveOptions(); clearCachedFindDialog(); Index: kstars/kstarsinit.cpp =================================================================== RCS file: /home/kde/kdeedu/kstars/kstars/kstarsinit.cpp,v retrieving revision 1.26 retrieving revision 1.26.2.2 diff -u -p -r1.26 -r1.26.2.2 --- kstars/kstars/kstarsinit.cpp 12 Oct 2002 14:17:31 -0000 1.26 +++ kstars/kstars/kstarsinit.cpp 2 Feb 2003 06:41:25 -0000 1.26.2.2 @@ -304,7 +304,7 @@ void KStars::initActions() { void KStars::initStatusBar() { statusBar()->insertItem( i18n( " Welcome to KStars " ), 0, 1, true ); statusBar()->setItemAlignment( 0, AlignLeft | AlignVCenter ); - QString s = "00:00:00, +00:00:00"; + QString s = "00h 00m 00s, +00d 00\'00\""; statusBar()->insertItem( s, 1, 1, true ); statusBar()->setItemAlignment( 1, AlignRight | AlignVCenter ); @@ -366,10 +366,33 @@ void KStars::datainitFinished(bool worke pd->buildGUI(); updateTime(); - clock->start(); show(); +//Check whether initial position is below the horizon. +//We sued to just call slotCenter() in buildGUI() which performs this check. +//However, on a Gentoo system, if the messagebox is shown before show() is called, +//the program exits. It does not crash (at least there are no error messages), +//it simply exits. Very strange. + if ( options()->useAltAz && options()->drawGround && + map()->focus()->alt().Degrees() < -1.0 ) { + QString caption = i18n( "Initial Position is Below Horizon" ); + QString message = i18n( "The initial position is below the horizon.\nWould you like to reset to the default position?" ); + if ( KMessageBox::warningYesNo( this, message, caption, + KStdGuiItem::yes(), KStdGuiItem::no(), "dag_start_below_horiz" ) == KMessageBox::Yes ) { + map()->setClickedObject( NULL ); + map()->setFoundObject( NULL ); + options()->isTracking = false; + options()->setSnapNextFocus(true); + + SkyPoint DefaultFocus; + DefaultFocus.setAz( 180.0 ); + DefaultFocus.setAlt( 45.0 ); + DefaultFocus.HorizontalToEquatorial( LSTh(), geo()->lat() ); + map()->setDestination( &DefaultFocus ); + } + } + // just show dialog if option is set (don't force it) KTipDialog::showTip( "kstars/tips" ); } @@ -493,21 +516,22 @@ void KStars::privatedata::buildGUI() { } } - ks->map()->slotCenter(); +// ks->map()->slotCenter(); } else { ks->map()->setClickedPoint( &newPoint ); - ks->map()->slotCenter(); +// ks->map()->slotCenter(); } + ks->map()->setDestination( ks->map()->clickedPoint() ); + ks->map()->destination()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() ); ks->map()->setFocus( ks->map()->destination() ); ks->map()->focus()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() ); - ks->map()->destination()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() ); ks->setHourAngle(); ks->map()->setOldFocus( ks->map()->focus() ); - ks->map()->oldfocus()->setAz( ks->map()->focus()->az() ); - ks->map()->oldfocus()->setAlt( ks->map()->focus()->alt() ); + ks->map()->oldfocus()->setAz( ks->map()->focus()->az().Degrees() ); + ks->map()->oldfocus()->setAlt( ks->map()->focus()->alt().Degrees() ); kapp->dcopClient()->resume(); Index: kstars/skymap.cpp =================================================================== RCS file: /home/kde/kdeedu/kstars/kstars/skymap.cpp,v retrieving revision 1.71 retrieving revision 1.71.2.1 diff -u -p -r1.71 -r1.71.2.1 --- kstars/kstars/skymap.cpp 12 Oct 2002 14:17:31 -0000 1.71 +++ kstars/kstars/skymap.cpp 2 Feb 2003 04:04:53 -0000 1.71.2.1 @@ -295,7 +295,8 @@ void SkyMap::slotCenter( void ) { QString caption = i18n( "Requested Position Below Horizon" ); QString message = i18n( "The requested position is below the horizon.\nWould you like to go there anyway?" ); - if ( KMessageBox::warningYesNo( 0, message, caption )==KMessageBox::No ) { + if ( KMessageBox::warningYesNo( ksw, message, caption, + KStdGuiItem::yes(), KStdGuiItem::no(), "dag_focus_below_horiz" )==KMessageBox::No ) { setClickedObject( NULL ); setFoundObject( NULL ); ksw->options()->isTracking = false;