[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Thu Oct 16 20:55:17 CEST 2003


CVS commit by harris: 

Improvements to splashscreen, to fix two refresh issues:

1. occassionally the background of the text region would become light 
grey, making the white text impossible to read.  Fixed by adding an 
"inactive background" color to the widget palette.

2. Two of the load items (stars and deep-sky) take a significant amount of 
time, so a long time passes during loading with no apparent progress in
the splashscreen.  Added "N%" text to the loadStarData() and 
loadDeepSkyData() functions, which update whenever a new data file is 
opened (127 and 14 files for stars and deep-sky, respectively).  I timed 
the functions with and without this addition, and the additional updates 
only add about 1% to the startup time.

This has the additional benefit that the splashscreen is refreshed more 
often, so if another window is placed in front of it temporarily, there 
will no longer be a long interval during which the splashscreen is 
completely blank.

CCMAIL: kstars-devel at kde.org


  M +6 -2      kstarsdata.cpp   1.102
  M +1 -0      kstarssplash.cpp   1.19


--- kdeedu/kstars/kstars/kstarsdata.cpp  #1.101:1.102
@@ -474,4 +474,6 @@ bool KStarsData::readStarData( void ) {
 
         for (unsigned int i=1; i<NHIPFILES+1; ++i) {
+                emit progressText( i18n( "Loading Star Data (%1%)" ).arg( int(100.*float(i)/float(NHIPFILES)) ) );
+                
                 if (openStarFile(i) == true) {
                         while (starFileReader->hasMoreLines()) {
@@ -776,4 +778,6 @@ bool KStarsData::readDeepSkyData( void )
                 fname = "ngcic" + snum + ".dat";
 
+                emit progressText( i18n( "Loading NGC/IC Data (%1%)" ).arg( int(100.*float(i)/float(NNGCFILES)) ) );
+
                 if ( KSUtils::openDataFile( file, fname ) ) {
                         KSFileReader fileReader( file ); // close file is included
@@ -1572,5 +1576,5 @@ void KStarsData::slotInitialize() {
                 case 2: //Load stellar database//
 
-                        emit progressText(i18n("Loading Star Data" ) );
+                        emit progressText(i18n("Loading Star Data (%1%)" ).arg(0) );
                         if ( !readStarData( ) )
                                 initError( "hipN.dat", true );
@@ -1583,5 +1587,5 @@ void KStarsData::slotInitialize() {
                 case 3: //Load NGC/IC database//
 
-                        emit progressText( i18n("Loading NGC/IC Data" ) );
+                        emit progressText( i18n("Loading NGC/IC Data (%1%)" ).arg(0) );
                         if ( !readDeepSkyData( ) )
                                 initError( "ngcicN.dat", true );

--- kdeedu/kstars/kstars/kstarssplash.cpp  #1.18:1.19
@@ -54,4 +54,5 @@ KStarsSplash::KStarsSplash( QWidget *par
         QPalette pal( label->palette() );
         pal.setColor( QPalette::Normal, QColorGroup::Background, QColor( "Black" ) );
+        pal.setColor( QPalette::Inactive, QColorGroup::Background, QColor( "Black" ) );
         pal.setColor( QPalette::Normal, QColorGroup::Foreground, QColor( "White" ) );
         pal.setColor( QPalette::Inactive, QColorGroup::Foreground, QColor( "White" ) );




More information about the Kstars-devel mailing list