[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Jul 25 04:48:39 CEST 2004


CVS commit by harris: 

The Settings|FOV Symbol menu now indicates which symbol is selected with 
a checkbox (i.e., the symbols are now KToggleActions).

CCMAIL: kstars-devel at kde.org


  M +7 -2      kstarsactions.cpp   1.115
  M +5 -16     kstarsinit.cpp   1.100


--- kdeedu/kstars/kstars/kstarsinit.cpp  #1.99:1.100
@@ -237,19 +237,4 @@ void KStars::initActions() {
         initFOV();
 
-//      new KAction( i18n( "do not use a target symbol", "No Symbol" ), 0,
-//                      this, SLOT( slotTargetSymbol() ), actionCollection(), "target_symbol_none" );
-//
-//      new KAction( i18n( "use a circle target symbol", "Circle" ), 0,
-//                      this, SLOT( slotTargetSymbol() ), actionCollection(), "target_symbol_circle" );
-//
-//      new KAction( i18n( "use a crosshairs target symbol", "Crosshairs" ), 0,
-//                      this, SLOT( slotTargetSymbol() ), actionCollection(), "target_symbol_crosshairs" );
-//
-//      new KAction( i18n( "use a bullseye target symbol", "Bullseye" ), 0,
-//                      this, SLOT( slotTargetSymbol() ), actionCollection(), "target_symbol_bullseye" );
-//
-//      new KAction( i18n( "use a rectangle target symbol", "Rectangle" ), 0,
-//                      this, SLOT( slotTargetSymbol() ), actionCollection(), "target_symbol_rectangle" );
-
         //use custom icon earth.png for the geoLocator icon.  If it is not installed
   //for some reason, use standard icon gohome.png instead.
@@ -472,5 +457,9 @@ void KStars::initFOV() {
                         if ( fields.count() == 4 ) {
                                 nm = fields[0].stripWhiteSpace();
-                                fovActionMenu->insert( new KAction( nm, 0, this, SLOT( slotTargetSymbol() ), actionCollection(), nm.utf8() ) );
+                                KToggleAction *kta = new KToggleAction( nm, 0, this, SLOT( slotTargetSymbol() ), 
+                                                actionCollection(), nm.utf8() );
+                                kta->setExclusiveGroup( "fovsymbol" );
+                                if ( nm == Options::fOVName() ) kta->setChecked( true );
+                                fovActionMenu->insert( kta );
                         }
                 }

--- kdeedu/kstars/kstars/kstarsactions.cpp  #1.114:1.115
@@ -21,4 +21,5 @@
 #include <kdebug.h>
 #include <kaction.h>
+#include <kactionclasses.h>
 #include <klineedit.h>
 #include <kshortcut.h>
@@ -789,5 +790,8 @@ void KStars::slotFOVEdit() {
                                 if ( fields.count() == 4 ) {
                                         QString nm = fields[0].stripWhiteSpace();
-                                        fovActionMenu->insert( new KAction( nm, 0, this, SLOT( slotTargetSymbol() ), actionCollection(), nm.utf8() ) );
+                                        KToggleAction *kta = new KToggleAction( nm, 0, this, SLOT( slotTargetSymbol() ), 
+                                                        actionCollection(), nm.utf8() );
+                                        kta->setExclusiveGroup( "fovsymbol" );
+                                        fovActionMenu->insert( kta );
                                 }
                         }
@@ -797,5 +801,6 @@ void KStars::slotFOVEdit() {
 
                 fovActionMenu->popupMenu()->insertSeparator();
-                fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) );
+                fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, 
+                                SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) );
 
                 //set FOV to whatever was highlighted in FOV dialog




More information about the Kstars-devel mailing list