[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Aug 22 21:43:40 CEST 2004


CVS commit by harris: 

Disable stars-related widgets in the options dialog (Catalog tab) if the 
"Hipparcos Star Catalog" box is unchecked.
(TO BE BACKPORTED)

CCMAIL: kstars-devel at kde.org


  M +20 -3     opscatalog.cpp   1.7
  M +1 -1      opscatalog.h   1.4


--- kdeedu/kstars/kstars/opscatalog.cpp  #1.6:1.7
@@ -17,4 +17,6 @@
 
 #include <qlistview.h> //QCheckListItem
+#include <qcheckbox.h>
+#include <qlabel.h>
 
 #include "opscatalog.h"
@@ -52,4 +54,7 @@ OpsCatalog::OpsCatalog( QWidget *p, cons
         kcfg_MagLimitDrawDeepSkyZoomOut->setMaxValue( 16.0 );
         
+        //disable star-related widgets if not showing stars
+        if ( ! kcfg_ShowStars->isChecked() ) slotStarWidgets(false);
+        
         //Add custom catalogs, if necessary
         for ( unsigned int i=0; i<Options::catalogCount(); ++i ) { //loop over custom catalogs
@@ -63,11 +68,9 @@ OpsCatalog::OpsCatalog( QWidget *p, cons
         connect( RemoveCatalog, SIGNAL( clicked() ), this, SLOT( slotRemoveCatalog() ) );
 
-        // draw star magnitude box
         connect( kcfg_MagLimitDrawStar, SIGNAL( valueChanged(double) ),
                 SLOT( slotSetDrawStarMagnitude(double) ) );
-        
-        // draw star zoom out magnitude box
         connect( kcfg_MagLimitDrawStarZoomOut, SIGNAL( valueChanged(double) ),
                 SLOT( slotSetDrawStarZoomOutMagnitude(double) ) );
+        connect( kcfg_ShowStars, SIGNAL( toggled(bool) ), SLOT( slotStarWidgets(bool) ) );
 }
 
@@ -159,3 +162,17 @@ void OpsCatalog::slotSetDrawStarZoomOutM
 }
 
+void OpsCatalog::slotStarWidgets(bool on) {
+        textLabelMagStars->setEnabled(on);
+        textLabelMagStarsZoomOut->setEnabled(on);
+        textLabelMagStarInfo->setEnabled(on);
+        textLabelMag1->setEnabled(on);
+        textLabelMag2->setEnabled(on);
+        textLabelMag3->setEnabled(on);
+        kcfg_MagLimitDrawStar->setEnabled(on);
+        kcfg_MagLimitDrawStarZoomOut->setEnabled(on);
+        kcfg_MagLimitDrawStarInfo->setEnabled(on);
+        kcfg_ShowStarNames->setEnabled(on);
+        kcfg_ShowStarMagnitudes->setEnabled(on);
+}
+
 #include "opscatalog.moc"

--- kdeedu/kstars/kstars/opscatalog.h  #1.3:1.4
@@ -52,5 +52,5 @@ private slots:
         void slotSetDrawStarMagnitude(double newValue);
         void slotSetDrawStarZoomOutMagnitude(double newValue);
-
+        void slotStarWidgets(bool on);
         
 private:




More information about the Kstars-devel mailing list