[Kstars-devel] branches/kstars/unfrozen/kstars/kstars

Jason Harris kstars at 30doradus.org
Wed Jun 25 09:37:39 CEST 2008


SVN commit 824187 by harris:

When the zoom level is changed, the new FOV angle is now 
displayed in the statusbar.  It uses the non-persistent 
messages section of the SB, which I think works pretty 
well.  

CCMAIL: kstars-devel at kde.org



 M  +2 -0      kstars.h  
 M  +21 -0     kstarsactions.cpp  
 M  +1 -0      kstarsdcop.cpp  


--- branches/kstars/unfrozen/kstars/kstars/kstars.h #824186:824187
@@ -675,6 +675,8 @@
     	*/
     void buildGUI();
 
+    void reportZoom();
+
     KStarsData *kstarsData;
     KStarsSplash *splash;
     SkyMap *skymap;
--- branches/kstars/unfrozen/kstars/kstars/kstarsactions.cpp #824186:824187
@@ -753,6 +753,7 @@
         newZoom = MAXZOOM;
 
     Options::setZoomFactor( newZoom );
+    reportZoom();
 
     if ( newZoom == MAXZOOM )
         actionCollection()->action("zoom_in")->setEnabled (false);
@@ -767,6 +768,7 @@
         newZoom = MINZOOM;
 
     Options::setZoomFactor( newZoom );
+    reportZoom();
 
     if ( newZoom == MINZOOM )
         actionCollection()->action("zoom_out")->setEnabled (false);
@@ -776,6 +778,8 @@
 
 void KStars::slotDefaultZoom() {
     Options::setZoomFactor( DEFAULTZOOM );
+    reportZoom();
+
     map()->forceUpdate();
 
     if ( Options::zoomFactor() > MINZOOM )
@@ -812,10 +816,27 @@
             actionCollection()->action("zoom_in")->setEnabled( true );
         }
 
+        reportZoom();
         map()->forceUpdate();
     }
 }
 
+void KStars::reportZoom() {
+    float fov = map()->fov();
+    QString fovunits = i18n( "degrees" );
+    if ( fov < 1.0 ) {
+        fov = fov * 60.0;
+        fovunits = i18n( "arcminutes" );
+    } 
+    if ( fov < 1.0 ) {
+        fov = fov * 60.0;
+        fovunits = i18n( "arcseconds" );
+    }
+
+    QString fovstring = i18nc("field of view", "FOV") + ": " + QString::number( fov, 'f', 1 ) + " " + fovunits;
+    statusBar()->changeItem( fovstring, 0 );
+}
+
 void KStars::slotCoordSys() {
     if ( Options::useAltAz() ) {
         Options::setUseAltAz( false );
--- branches/kstars/unfrozen/kstars/kstars/kstarsdcop.cpp #824186:824187
@@ -137,6 +137,7 @@
     if ( z > MAXZOOM ) z = MAXZOOM;
     if ( z < MINZOOM ) z = MINZOOM;
     Options::setZoomFactor( z );
+    reportZoom();
     map()->forceUpdate();
 }
 


More information about the Kstars-devel mailing list