[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Sep 21 16:03:07 CEST 2007


SVN commit 715215 by harris:

When changing the Date/Time while tracking an object under Az/Alt
coordinates, make sure the focus position gets updated immediately.

CCMAIL: kstars-devel at kde.org



 M  +29 -17    kstarsactions.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #715214:715215
@@ -410,9 +410,15 @@
 		data()->changeDateTime( geo()->LTtoUT( timedialog.selectedDateTime() ) );
 
 		if ( Options::useAltAz() ) {
-			map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
+			if ( map()->focusObject() ) {
+				map()->focusObject()->EquatorialToHorizontal( LST(), geo()->lat() );
+				map()->setFocus( map()->focusObject() );
+			} else
+				map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
 		}
 
+		map()->forceUpdateNow();
+
 		//If focusObject has a Planet Trail, clear it and start anew.
 		if ( map()->focusObject() && map()->focusObject()->isSolarSystem() &&
 		     ((KSPlanetBase*)map()->focusObject())->hasTrail() ) {
@@ -422,6 +428,28 @@
 	}
 }
 
+//Set Time to CPU clock
+void KStars::slotSetTimeToNow() {
+	data()->changeDateTime( geo()->LTtoUT( KStarsDateTime::currentDateTime() ) );
+
+	if ( Options::useAltAz() ) {
+		if ( map()->focusObject() ) {
+				map()->focusObject()->EquatorialToHorizontal( LST(), geo()->lat() );
+				map()->setFocus( map()->focusObject() );
+		} else
+			map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
+	}
+
+	map()->forceUpdateNow();
+
+	//If focusObject has a Planet Trail, clear it and start anew.
+	if ( map()->focusObject() && map()->focusObject()->isSolarSystem() &&
+	     ((KSPlanetBase*)map()->focusObject())->hasTrail() ) {
+	  ((KSPlanetBase*)map()->focusObject())->clearTrail();
+	  ((KSPlanetBase*)map()->focusObject())->addToTrail();
+	}
+}
+
 void KStars::slotFind() {
 	clearCachedFindDialog();
 	if ( !findDialog ) {	  // create new dialog if no dialog is existing
@@ -624,22 +652,6 @@
 	printImage( true, switchColors );
 }
 
-//Set Time to CPU clock
-void KStars::slotSetTimeToNow() {
-	data()->changeDateTime( geo()->LTtoUT( KStarsDateTime::currentDateTime() ) );
-
-	if ( Options::useAltAz() ) {
-		map()->focus()->HorizontalToEquatorial( LST(), geo()->lat() );
-	}
-
-	//If focusObject has a Planet Trail, clear it and start anew.
-	if ( map()->focusObject() && map()->focusObject()->isSolarSystem() &&
-	     ((KSPlanetBase*)map()->focusObject())->hasTrail() ) {
-	  ((KSPlanetBase*)map()->focusObject())->clearTrail();
-	  ((KSPlanetBase*)map()->focusObject())->addToTrail();
-	}
-}
-
 void KStars::slotToggleTimer() {
 	if ( data()->clock()->isActive() ) {
 		data()->clock()->stop();


More information about the Kstars-devel mailing list