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

Alexey Khudyakov alexey.skladnoy at gmail.com
Fri Feb 12 18:06:34 CET 2010


SVN commit 1089200 by khudyakov:

Compute angular distance on right button press without
digging through context menu. _Much_ better in my opinion.

CCMAIL: kstars-devel at kde.org

 M  +13 -7     skymapevents.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skymapevents.cpp #1089199:1089200
@@ -680,7 +680,8 @@
         double maxrad = 1000.0/Options::zoomFactor();
         SkyObject* obj = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
         setClickedObject( obj );
-        setClickedPoint(  obj );
+        if( obj )
+            setClickedPoint(  obj );
 
         switch( e->button() ) {
         case Qt::LeftButton:
@@ -694,13 +695,18 @@
             }
             break;
         case Qt::RightButton:
-            // Show popup menu
-            if( clickedObject() ) {
-                clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+            if( angularDistanceMode ) {
+                // Compute angular distance.
+                slotEndAngularDistance();
             } else {
-                SkyObject o( SkyObject::TYPE_UNKNOWN, clickedPoint()->ra()->Hours(), clickedPoint()->dec()->Degrees() );
-                pmenu->createEmptyMenu( &o );
-                pmenu->popup( QCursor::pos() );
+                // Show popup menu
+                if( clickedObject() ) {
+                    clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+                } else {
+                    SkyObject o( SkyObject::TYPE_UNKNOWN, clickedPoint()->ra()->Hours(), clickedPoint()->dec()->Degrees() );
+                    pmenu->createEmptyMenu( &o );
+                    pmenu->popup( QCursor::pos() );
+                }
             }
             break;
         default: ;


More information about the Kstars-devel mailing list