/*************************************************************************** colorscheme.cpp - description ------------------- begin : Wed May 8 2002 copyright : (C) 2002 by Jason Harris email : kstars@30doradus.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include #include #include "ksutils.h" #include "colorscheme.h" typedef TQStringList::const_iterator SL_it; ColorScheme::ColorScheme() : FileName() { //Each color has two names associated with it. The KeyName is its //identification in the TQMap, the *.colors file, and the config file. //The Name is what appears in the ViewOpsDialog ListBox. //In addition, we define default RGB strings for each item. //To add another color to the Palette, just add an entry for KeyName, //Name and Default here. KeyName.append( "SkyColor" ); Name.append( i18n( "Sky" ) ); Default.append( "#002" ); KeyName.append( "MessColor" ); Name.append( i18n( "Messier Object" ) ); Default.append( "#0F0" ); KeyName.append( "NGCColor" ); Name.append( i18n( "New General Catalog object", "NGC Object" ) ); Default.append( "#066" ); KeyName.append( "ICColor" ); Name.append( i18n( "Index Catalog object", "IC Object" ) ); Default.append( "#439" ); KeyName.append( "HSTColor" ); Name.append( i18n( "Object with extra attached URLs", "Object w/ Links" ) ); Default.append( "#A00" ); KeyName.append( "SNameColor" ); Name.append( i18n( "Star Name" ) ); Default.append( "#7AA" ); KeyName.append( "PNameColor" ); Name.append( i18n( "Planet Name" ) ); Default.append( "#A77" ); KeyName.append( "CNameColor" ); Name.append( i18n( "Constellation Name", "Constell. Name" ) ); Default.append( "#AA7" ); KeyName.append( "CLineColor" ); Name.append( i18n( "Constellation Line", "Constell. Line" ) ); Default.append( "#555" ); KeyName.append( "CBoundColor" ); Name.append( i18n( "Constellation Boundary", "Constell. Boundary" ) ); Default.append( "#222" ); KeyName.append( "MWColor" ); Name.append( i18n( "refers to the band of stars in the sky due to the Galactic plane", "Milky Way" ) ); Default.append( "#123" ); KeyName.append( "EqColor" ); Name.append( i18n( "Equator" ) ); Default.append( "#FFF" ); KeyName.append( "EclColor" ); Name.append( i18n( "Ecliptic" ) ); Default.append( "#663" ); KeyName.append( "HorzColor" ); Name.append( i18n( "Horizon" ) ); Default.append( "#5A3" ); KeyName.append( "CompassColor" ); Name.append( i18n( "Compass Labels" ) ); Default.append( "#002" ); KeyName.append( "GridColor" ); Name.append( i18n( "Coordinate Grid" ) ); Default.append( "#456" ); KeyName.append( "BoxTextColor" ); Name.append( i18n( "Info Box Text" ) ); Default.append( "#FFF" ); KeyName.append( "BoxGrabColor" ); Name.append( i18n( "Info Box Selected" ) ); Default.append( "#F00" ); KeyName.append( "BoxBGColor" ); Name.append( i18n( "Info Box Background" ) ); Default.append( "#000" ); KeyName.append( "TargetColor" ); Name.append( i18n( "Target Indicator" ) ); Default.append( "#8B8" ); KeyName.append( "UserLabelColor" ); Name.append( i18n( "User Labels" ) ); Default.append( "#FFF" ); KeyName.append( "PlanetTrailColor" ); Name.append( i18n( "Planet Trails" ) ); Default.append( "#963" ); KeyName.append( "AngularRuler" ); Name.append( i18n( "Angular Distance Ruler" ) ); Default.append( "#FFF" ); KeyName.append( "ObsListColor" ); Name.append( i18n( "Observing List Label" ) ); Default.append( "#F00" ); //Set the default colors in the Palette. for( uint i=0; ireadEntry( TQString(*it), TQString( *Default.at( KeyName.findIndex(*it) ) ) ) ); setStarColorMode( conf->readNumEntry( "StarColorMode", 0 ) ); setStarColorIntensity( conf->readNumEntry( "StarColorIntensity", 5 ) ); } void ColorScheme::saveToConfig( TDEConfig *conf ) { TQStringList::Iterator it = KeyName.begin(); TQStringList::Iterator it_end = KeyName.end(); for ( ; it != it_end; ++it ) conf->writeEntry( TQString(*it), colorNamed( TQString(*it) ) ); conf->writeEntry( "StarColorMode", starColorMode() ); conf->writeEntry( "StarColorIntensity", starColorIntensity() ); }