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

Jason Harris kstars at 30doradus.org
Sat Jun 21 17:12:43 CEST 2008


SVN commit 822804 by harris:

Fixing a usability issue in the options window.
Toggling the view toolbar buttons now toggles the 
corresponding control in the options dialog.  This is 
useful for those who keep the options window open while 
using the program.

TODO: there's no meta-option for deep-sky objects in the 
options window.  I'll ask translators if it's ok to add 
one for 4.2.

Thanks for pointing this out, James.

CCMAIL: kstars-devel at kde.org



 M  +11 -0     kstars.h  
 M  +30 -5     kstarsactions.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/kstars.h #822803:822804
@@ -47,6 +47,12 @@
 class JMoonTool;
 class ImageViewer;
 
+class OpsCatalog;
+class OpsGuides;
+class OpsSolarSystem;
+class OpsColors;
+class OpsAdvanced;
+
 /**
 	*@class KStars
 	*@short This is the main window for KStars.
@@ -692,6 +698,11 @@
 
     QPalette OriginalPalette, DarkPalette;
 
+    OpsCatalog *opcatalog;
+    OpsGuides *opguides;
+    OpsSolarSystem *opsolsys;
+    OpsColors *opcolors;
+    OpsAdvanced *opadvanced;
 };
 
 #endif
--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #822803:822804
@@ -102,25 +102,50 @@
 
 void KStars::slotViewToolBar() {
     KToggleAction *a = (KToggleAction*)sender();
+    KConfigDialog *kcd = KConfigDialog::exists( "settings" );
 
     if ( a == actionCollection()->action( "show_stars" ) ) {
         Options::setShowStars( a->isChecked() );
+        if ( kcd ) {
+            opcatalog->kcfg_ShowStars->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_deepsky" ) ) {
         Options::setShowDeepSky( a->isChecked() );
     } else if ( a == actionCollection()->action( "show_planets" ) ) {
         Options::setShowSolarSystem( a->isChecked() );
+        if ( kcd ) {
+            opsolsys->kcfg_ShowSolarSystem->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_clines" ) ) {
         Options::setShowCLines( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowCLines->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_cnames" ) ) {
         Options::setShowCNames( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowCNames->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_cbounds" ) ) {
         Options::setShowCBounds( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowCBounds->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_mw" ) ) {
         Options::setShowMilkyWay( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowMilkyWay->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_grid" ) ) {
         Options::setShowGrid( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowGrid->setChecked( a->isChecked() );
+        }
     } else if ( a == actionCollection()->action( "show_horizon" ) ) {
         Options::setShowGround( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowGround->setChecked( a->isChecked() );
+        }
     }
 
     // update time for all objects because they might be not initialized
@@ -364,11 +389,11 @@
 
     connect( dialog, SIGNAL( settingsChanged( const QString &) ), this, SLOT( slotApplyConfigChanges() ) );
 
-    OpsCatalog *opcatalog    = new OpsCatalog( this );
-    OpsGuides  *opguides     = new OpsGuides( this );
-    OpsSolarSystem *opsolsys = new OpsSolarSystem( this );
-    OpsColors  *opcolors     = new OpsColors( this );
-    OpsAdvanced *opadvanced  = new OpsAdvanced( this );
+    opcatalog    = new OpsCatalog( this );
+    opguides     = new OpsGuides( this );
+    opsolsys = new OpsSolarSystem( this );
+    opcolors     = new OpsColors( this );
+    opadvanced  = new OpsAdvanced( this );
 
     dialog->addPage(opcatalog, i18n("Catalogs"), "kstars_catalog");
     dialog->addPage(opsolsys, i18n("Solar System"), "kstars_solarsystem");


More information about the Kstars-devel mailing list