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

Jérôme Sonrier jsid at emor3j.fr.eu.org
Wed Jul 8 01:21:53 CEST 2009


SVN commit 992915 by jsonrier:

We can now center a flag on the map by clicking on the "center" button or by double clicking on the flag in the flag manager.

CCMAIL: kstars-devel at kde.org



 M  +12 -1     flagmanager.cpp  
 M  +5 -0      flagmanager.h  
 M  +7 -0      flagmanager.ui  


--- trunk/KDE/kdeedu/kstars/kstars/tools/flagmanager.cpp #992914:992915
@@ -23,6 +23,7 @@
 #include <kmessagebox.h>
 #include <kstandarddirs.h>
 
+#include "Options.h"
 #include "kstars.h"
 #include "kstarsdata.h"
 #include "skymap.h"
@@ -82,9 +83,11 @@
                                    flagNames.at( i ) );
     }
 
-    // Connect "Add" and "Delete" buttons
+    // Connect buttons 
     connect( ui->addButton, SIGNAL( clicked() ), this, SLOT( slotValidatePoint() ) );
     connect( ui->delButton, SIGNAL( clicked() ), this, SLOT( slotDeleteFlag() ) );
+    connect( ui->CenterButton, SIGNAL( clicked() ), this, SLOT( slotCenterFlag() ) );
+    connect( ui->flagList, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( slotCenterFlag() ) );
 }
 
 FlagManager::~FlagManager()
@@ -179,4 +182,12 @@
     m_Ks->map()->forceUpdate(false);
 }
 
+void FlagManager::slotCenterFlag() {
+    if ( ui->flagList->currentIndex().isValid() ) {
+        m_Ks->map()->setClickedObject( 0 );
+        m_Ks->map()->setClickedPoint( m_Ks->data()->skyComposite()->flags()->pointList().at( ui->flagList->currentIndex().row() ) );
+        m_Ks->map()->slotCenter();
+    }
+}
+
 #include "flagmanager.moc"
--- trunk/KDE/kdeedu/kstars/kstars/tools/flagmanager.h #992914:992915
@@ -71,6 +71,11 @@
      */
     void slotDeleteFlag();
 
+    /**
+     *@short Center the selected object in the display
+     */
+    void slotCenterFlag();
+
 private:
     KStars *m_Ks;
     FlagManagerUI *ui;
--- trunk/KDE/kdeedu/kstars/kstars/tools/flagmanager.ui #992914:992915
@@ -172,6 +172,13 @@
        <item>
         <layout class="QVBoxLayout" name="verticalLayout">
          <item>
+          <widget class="QPushButton" name="CenterButton">
+           <property name="text">
+            <string>Center</string>
+           </property>
+          </widget>
+         </item>
+         <item>
           <widget class="QPushButton" name="delButton">
            <property name="text">
             <string>Delete</string>


More information about the Kstars-devel mailing list