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

Jason Harris kstars at 30doradus.org
Sun Jun 1 22:26:47 CEST 2008


SVN commit 815443 by harris:

We have 6 "object action" keystrokes that operate on the clickedObject: 
C = center the object
D = Show the object's Details window
P = Show the object's popup menu
O = Add the object to the observing list
L = Add/remove the object's name label
T = Add/remove a trail from the object (if isSolarSystem()==true)

If the Shift key is held, then these actions operate on the *centered 
object (i.e., focusObject) instead.  This is accomplished by setting the 
clicked object to be the focus object (setClickedObject( focusObject() 
)).  With this commit, the re-assignment of clickedObject when Shift is 
used with an action key is now temporary; it now reverts back to 
whatever it was before the action was invoked.

CCMAIL: kstars-devel at kde.org



 M  +3 -0      imageviewer.cpp  
 M  +2 -2      kstars.cpp  
 M  +60 -9     skymapevents.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/imageviewer.cpp #815442:815443
@@ -113,6 +113,9 @@
     // check if download job is running
     checkJob();
 
+    //DEBUG
+    kDebug() << View << "::" << Caption << endl;
+
     delete View;
     delete Caption;
     if ( downloadJob ) delete downloadJob;
--- trunk/KDE/kdeedu/kstars/kstars/kstars.cpp #815442:815443
@@ -248,10 +248,10 @@
 }
 
 void KStars::removeImageViewer( ImageViewer *iv ) {
+    int i = m_ImageViewerList.indexOf( iv );
     //DEBUG
-    kDebug() ;
+    kDebug() << i << "::" << m_ImageViewerList.size() << endl;
 
-    int i = m_ImageViewerList.indexOf( iv );
     if ( i != -1 )
         m_ImageViewerList.takeAt( i )->deleteLater();
 }
--- trunk/KDE/kdeedu/kstars/kstars/skymapevents.cpp #815442:815443
@@ -279,41 +279,92 @@
         break;
 
     case Qt::Key_D: //Details window for Clicked/Centered object
-        if ( shiftPressed ) setClickedObject( focusObject() );
-        if ( clickedObject() ) slotDetail();
+    {
+        SkyObject *orig = 0;
+        if ( shiftPressed ) { 
+            orig = clickedObject();
+            setClickedObject( focusObject() );
+        }
+
+        if ( clickedObject() ) {
+            slotDetail();
+        }
+
+        if ( orig ) {
+            setClickedObject( orig );
+        }
         break;
+    }
 
     case Qt::Key_P: //Show Popup menu for Clicked/Centered object
-        if ( shiftPressed ) setClickedObject( focusObject() );
-        if ( clickedObject() )
-            clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+        if ( shiftPressed ) {
+            if ( focusObject() ) 
+                focusObject()->showPopupMenu( pmenu, QCursor::pos() );
+        } else {
+            if ( clickedObject() )
+                clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+        }
         break;
 
     case Qt::Key_O: //Add object to Observing List
-        if ( shiftPressed ) setClickedObject( focusObject() );
-        if ( clickedObject() )
+    {
+        SkyObject *orig = 0;
+        if ( shiftPressed ) {
+            orig = clickedObject();
+            setClickedObject( focusObject() );
+        }
+
+        if ( clickedObject() ) {
             ks->observingList()->slotAddObject();
+        }
+
+        if ( orig ) {
+            setClickedObject( orig );
+        }
         break;
+    }
 
     case Qt::Key_L: //Toggle User label on Clicked/Centered object
-        if ( shiftPressed ) setClickedObject( focusObject() );
+    {
+        SkyObject *orig = 0;
+        if ( shiftPressed ) {
+            orig = clickedObject();
+            setClickedObject( focusObject() );
+        }
+
         if ( clickedObject() ) {
             if ( isObjectLabeled( clickedObject() ) )
                 slotRemoveObjectLabel();
             else
                 slotAddObjectLabel();
         }
+
+        if ( orig ) {
+            setClickedObject( orig );
+        }
         break;
+    }
 
     case Qt::Key_T: //Toggle planet trail on Clicked/Centered object (if solsys)
-        if ( shiftPressed ) setClickedObject( focusObject() );
+    {
+        SkyObject *orig = 0;
+        if ( shiftPressed ) {
+            orig = clickedObject();
+            setClickedObject( focusObject() );
+        }
+
         if ( clickedObject() && clickedObject()->isSolarSystem() ) {
             if ( ((KSPlanetBase*)clickedObject())->hasTrail() )
                 slotRemovePlanetTrail();
             else
                 slotAddPlanetTrail();
         }
+
+        if ( orig ) {
+            setClickedObject( orig );
+        }
         break;
+    }
 
     //DEBUG_REFRACT
     case Qt::Key_Q:


More information about the Kstars-devel mailing list