Commit 496c467c authored by nobody's avatar nobody

This commit was manufactured by cvs2svn to create tag

'KDE_3_3_1_RELEASE'.

svn path=/tags/KDE_3_3_1_RELEASE/kdeedu/kstars/; revision=354021
parents b8bae513 dd1ce806
bin_PROGRAMS = kstars
kstars_SOURCES = Options.kcfgc kspluto.cpp addcatdialog.cpp addlinkdialog.cpp colorscheme.cpp detaildialog.cpp dmsbox.cpp dms.cpp filesource.cpp finddialog.cpp focusdialog.cpp geolocation.cpp imageviewer.cpp indidevice.cpp indidriver.cpp indimenu.cpp infobox.cpp infoboxes.cpp jupitermoons.cpp ksasteroid.cpp kscomet.cpp ksfilereader.cpp ksmoon.cpp ksnewstuff.cpp ksnumbers.cpp ksplanetbase.cpp ksplanet.cpp kspopupmenu.cpp kssun.cpp kstarsactions.cpp kstars.cpp kstarsdata.cpp kstarsdatetime.cpp kstarsdcop.cpp kstarsinit.cpp kstarssplash.cpp ksutils.cpp locationdialog.cpp magnitudespinbox.cpp main.cpp mapcanvas.cpp objectnamelist.cpp planetcatalog.cpp simclock.cpp skymap.cpp skymapdraw.cpp skymapevents.cpp skyobject.cpp skyobjectname.cpp skypoint.cpp stardatasink.cpp starobject.cpp starpixmap.cpp telescopewizardprocess.cpp timebox.cpp timedialog.cpp timespinbox.cpp timestepbox.cpp timeunitbox.cpp timezonerule.cpp toggleaction.cpp deepskyobject.cpp fovdialog.cpp fov.cpp indigroup.cpp indiproperty.cpp indielement.cpp devicemanager.cpp indistd.cpp kswizard.cpp csegment.cpp fitsviewer.cpp conbridlg.cpp fitsimage.cpp fitsprocess.cpp imagereductiondlg.cpp opsadvanced.cpp opscatalog.cpp opscolors.cpp fitshistogram.cpp kstarsinterface.skel simclockinterface.skel addcatdialogui.ui devmanager.ui focusdialogdlg.ui indiconf.ui indihostconf.ui opsadvancedui.ui opscatalogui.ui opscolorsui.ui opsguides.ui opssolarsystem.ui telescopewizard.ui fovdialogui.ui newfovui.ui kswizardui.ui contrastbrightnessgui.ui imagereductionui.ui histdialog.ui statform.ui fitsheaderdialog.ui streamformui.ui streamwg.cpp indifitsconf.cpp imgsequencedlgui.ui imagesequence.cpp
kstars_SOURCES = Options.kcfgc kspluto.cpp addcatdialog.cpp addlinkdialog.cpp colorscheme.cpp detaildialog.cpp dmsbox.cpp dms.cpp filesource.cpp finddialog.cpp focusdialog.cpp geolocation.cpp imageviewer.cpp indidevice.cpp indidriver.cpp indimenu.cpp infobox.cpp infoboxes.cpp jupitermoons.cpp ksasteroid.cpp kscomet.cpp ksfilereader.cpp ksmoon.cpp ksnewstuff.cpp ksnumbers.cpp ksplanetbase.cpp ksplanet.cpp kspopupmenu.cpp kssun.cpp kstarsactions.cpp kstars.cpp kstarsdata.cpp kstarsdatetime.cpp kstarsdcop.cpp kstarsinit.cpp kstarssplash.cpp ksutils.cpp locationdialog.cpp magnitudespinbox.cpp main.cpp mapcanvas.cpp objectnamelist.cpp planetcatalog.cpp simclock.cpp skymap.cpp skymapdraw.cpp skymapevents.cpp skyobject.cpp skyobjectname.cpp skypoint.cpp stardatasink.cpp starobject.cpp starpixmap.cpp telescopewizardprocess.cpp timebox.cpp timedialog.cpp timespinbox.cpp timestepbox.cpp timeunitbox.cpp timezonerule.cpp toggleaction.cpp deepskyobject.cpp fovdialog.cpp fov.cpp indigroup.cpp indiproperty.cpp indielement.cpp devicemanager.cpp indistd.cpp kswizard.cpp csegment.cpp fitsviewer.cpp conbridlg.cpp fitsimage.cpp fitsprocess.cpp imagereductiondlg.cpp opsadvanced.cpp opscatalog.cpp opscolors.cpp fitshistogram.cpp kstarsinterface.skel simclockinterface.skel addcatdialogui.ui devmanager.ui focusdialogdlg.ui indiconf.ui indihostconf.ui opsadvancedui.ui opscatalogui.ui opscolorsui.ui opsguides.ui opssolarsystem.cpp opssolarsystemui.ui telescopewizard.ui fovdialogui.ui newfovui.ui kswizardui.ui contrastbrightnessgui.ui imagereductionui.ui histdialog.ui statform.ui fitsheaderdialog.ui streamformui.ui streamwg.cpp indifitsconf.cpp imgsequencedlgui.ui imagesequence.cpp
kde_kcfg_DATA = kstars.kcfg
kde_conf_DATA = kstarsrc
......
......@@ -447,7 +447,7 @@ Chitose : : Japan
Chittagong : : Bangladesh : 22 : 15 : 0 : N : 91 : 49 : 59 : E : 6.0 : --
Christchurch : : New Zealand : 43 : 28 : 58 : S : 172 : 31 : 58 : E : 12.0 : NZ
Christiansoe : Bornholm : Denmark : 55 : 19 : 0 : N : 15 : 11 : 0 : E : 1.0 : EU
Christmas Island : : Australia : 1 : 58 : 59 : N : 157 : 22 : 1 : W : 7.0 : --
Christmas Island : : Australia : 10 : 30 : 00 : S : 105 : 40 : 00 : E : 7.0 : --
Chula Vista : California : USA : 32 : 38 : 35 : N : 117 : 4 : 58 : W : -8.0 : US
Chuncheon : Gangwon : Korea : 37 : 54 : 0 : N : 127 : 44 : 0 : E : 9.0 : SK
Chungju : Chungbuk : Korea : 36 : 58 : 0 : N : 127 : 53 : 0 : E : 9.0 : SK
......
......@@ -288,13 +288,18 @@ void DetailDialog::createGeneralTab( const KStarsDateTime &ut, GeoLocation *geo
default: //deep-sky objects
dso = (DeepSkyObject *)selectedObject;
if ( ! dso->longname().isEmpty() ) {
if ( ! dso->longname().isEmpty() && dso->longname() != dso->name() ) {
pname = dso->translatedLongName();
oname = dso->translatedName();
} else {
pname = dso->translatedName();
}
if ( ! dso->name2().isEmpty() ) oname += ", " + dso->translatedName2();
if ( ! dso->name2().isEmpty() ) {
if ( oname.isEmpty() ) oname = dso->translatedName2();
else oname += ", " + dso->translatedName2();
}
if ( dso->ugc() != 0 ) oname += ", UGC " + QString("%1").arg( dso->ugc() );
if ( dso->pgc() != 0 ) oname += ", PGC " + QString("%1").arg( dso->pgc() );
......
......@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
......
......@@ -281,6 +281,7 @@ LX200Generic::LX200Generic()
trackingMode = LX200_TRACK_DEFAULT;
lastSet = -1;
fault = false;
simulation = false;
targetRA = 0;
targetDEC = 0;
currentRA = 0;
......@@ -1188,6 +1189,8 @@ void LX200Generic::handleError(ITextVectorProperty *tvp, int err, const char *ms
bool LX200Generic::isTelescopeOn(void)
{
if (simulation) return true;
return (PowerSP.sp[0].s == ISS_ON);
}
......@@ -1570,6 +1573,8 @@ int LX200Generic::getOnSwitch(ISwitchVectorProperty *sp)
int LX200Generic::checkPower(ISwitchVectorProperty *sp)
{
if (simulation) return 0;
if (PowerSP.s != IPS_OK)
{
if (!strcmp(sp->label, ""))
......@@ -1587,7 +1592,8 @@ int LX200Generic::checkPower(ISwitchVectorProperty *sp)
int LX200Generic::checkPower(INumberVectorProperty *np)
{
if (simulation) return 0;
if (PowerSP.s != IPS_OK)
{
......@@ -1608,6 +1614,8 @@ int LX200Generic::checkPower(INumberVectorProperty *np)
int LX200Generic::checkPower(ITextVectorProperty *tp)
{
if (simulation) return 0;
if (PowerSP.s != IPS_OK)
{
if (!strcmp(tp->label, ""))
......@@ -1712,3 +1720,13 @@ void LX200Generic::getAlignment()
IDSetSwitch (&AlignmentSw, NULL);
IDLog("ACK success %c\n", align);
}
void LX200Generic::enableSimulation(bool enable)
{
simulation = enable;
if (simulation)
IDLog("Warning: Simulation is activated.\n");
else
IDLog("Simulation is disabled.\n");
}
......@@ -54,6 +54,7 @@ class LX200Generic
int getOnSwitch(ISwitchVectorProperty *sp);
void setCurrentDeviceName(const char * devName);
void correctFault();
void enableSimulation(bool enable);
protected:
......@@ -69,6 +70,7 @@ class LX200Generic
double lastRA;
double lastDEC;
bool fault;
bool simulation;
struct tm *localTM;
......
......@@ -33,7 +33,7 @@ extern ITextVectorProperty Time;
extern int MaxReticleFlashRate;
static ISwitch GPSPowerS[] = {{ "On", "", ISS_OFF, 0, 0}, {"Off", "", ISS_ON, 0, 0}};
static ISwitch GPSStatusS[] = {{ "GPS Sleep", "", ISS_OFF, 0, 0}, {"GPS Wake up", "", ISS_OFF, 0 ,0}, {"GPS Restart", "", ISS_OFF, 0, 0}};
static ISwitch GPSStatusS[] = {{ "Sleep", "", ISS_OFF, 0, 0}, {"Wake up", "", ISS_OFF, 0 ,0}, {"Restart", "", ISS_OFF, 0, 0}};
static ISwitch GPSUpdateS[] = { {"Update", "", ISS_OFF, 0, 0}};
static ISwitch AltDecPecS[] = {{ "Enable", "", ISS_OFF, 0 ,0}, {"Disable", "", ISS_OFF, 0 ,0}};
static ISwitch AzRaPecS[] = {{ "Enable", "", ISS_OFF, 0, 0}, {"Disable", "", ISS_OFF, 0 ,0}};
......@@ -53,6 +53,8 @@ static ISwitchVectorProperty AzRaBackSlashSw = { mydev, "Az/Ra Anti-backslash",
static INumber Temp[] = { {"Temp.", "", "%g", -200., 500., 0., 0., 0, 0, 0 } };
static INumberVectorProperty OTATemp = { mydev, "OTA Temperature (C)", "", GPSGroup, IP_RO, 0, IPS_IDLE, Temp, NARRAY(Temp), 0, 0};
void updateTemp(void * /*p*/);
void changeLX200GPSDeviceName(const char *newName)
{
strcpy(GPSPowerSw.device, newName);
......@@ -68,7 +70,8 @@ void changeLX200GPSDeviceName(const char *newName)
LX200GPS::LX200GPS() : LX200_16()
{
IEAddTimer(900000, updateTemp, NULL);
}
void LX200GPS::ISGetProperties (const char *dev)
......@@ -111,36 +114,18 @@ void LX200GPS::ISNewNumber (const char *dev, const char *name, double values[],
}
/*#define turnGPSOn() portWrite("#:g+#")
#define turnGPSOff() portWrite("#:g-#")
#define alignGPSScope() portWrite("#:Aa#")
#define gpsSleep() portWrite("#:hN#")
#define gpsWakeUp() portWrite("#:hW#")
#define gpsRestart() portWrite("#:I#")
#define updateGPS_System() setStandardProcedure("#:gT#")
#define enableDecAltPec() portWrite("#:QA+#")
#define disableDecAltPec() portWrite("#:QA-#")
#define enableRA_AZPec() portWrite("#:QZ+#")
#define disableRA_AZPec() portWrite("#:QZ-#")
#define activateAltDecAntiBackSlash() portWrite("#$BAdd#")
#define activateAzRaAntiBackSlash() portWrite("#$BZdd#")
#define SelenographicSync() portWrite("#:CL#")
double getOTATemp();
*/
void LX200GPS::ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
{
int index;
char msg[32];
char msg[64];
if (strcmp (dev, thisDevice))
return;
if (!strcmp(name,GPSPowerSw.name))
{
if (checkPower(&GPSPowerSw))
if (checkPower(&GPSPowerSw))
return;
IUResetSwitches(&GPSPowerSw);
......@@ -155,10 +140,10 @@ double getOTATemp();
if (!strcmp(name,GPSStatusSw.name))
{
if (checkPower(&GPSStatusSw))
if (checkPower(&GPSStatusSw))
return;
IUResetSwitches(&GPSPowerSw);
IUResetSwitches(&GPSStatusSw);
IUUpdateSwitches(&GPSStatusSw, states, names, n);
index = getOnSwitch(&GPSStatusSw);
......@@ -186,7 +171,7 @@ double getOTATemp();
if (!strcmp(name,GPSUpdateSw.name))
{
if (checkPower(&GPSUpdateSw))
if (checkPower(&GPSUpdateSw))
return;
GPSUpdateSw.s = IPS_OK;
......@@ -203,7 +188,7 @@ double getOTATemp();
if (!strcmp(name, AltDecPecSw.name))
{
if (checkPower(&AltDecPecSw))
if (checkPower(&AltDecPecSw))
return;
IUResetSwitches(&AltDecPecSw);
......@@ -229,8 +214,8 @@ double getOTATemp();
if (!strcmp(name, AzRaPecSw.name))
{
if (checkPower(&AzRaPecSw))
return;
if (checkPower(&AzRaPecSw))
return;
IUResetSwitches(&AzRaPecSw);
IUUpdateSwitches(&AzRaPecSw, states, names, n);
......@@ -255,7 +240,7 @@ double getOTATemp();
if (!strcmp(name, AltDecBackSlashSw.name))
{
if (checkPower(&AltDecBackSlashSw))
if (checkPower(&AltDecBackSlashSw))
return;
activateAltDecAntiBackSlash();
......@@ -284,12 +269,20 @@ double getOTATemp();
LX200_16::ISPoll();
if (isTelescopeOn())
}
void updateTemp(void * /*p*/)
{
if (telescope->isTelescopeOn())
{
getOTATemp(&OTATemp.np[0].value);
IDSetNumber(&OTATemp, NULL);
}
}
IEAddTimer(900000, updateTemp, NULL);
}
void LX200GPS::getBasicData()
......
......@@ -30,6 +30,7 @@
#include <signal.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
......
......@@ -29,6 +29,7 @@
#include <signal.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
......
......@@ -38,7 +38,7 @@
#endif /* LOCKING */
#ifdef __linux__
#if defined(arm) || defined(__hppa__)
#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__)
#include <fcntl.h>
#else
#include <sys/io.h>
......@@ -74,7 +74,7 @@ port_t::port_t(int iport) {
#endif /* LOCKING */
#ifdef LINUX
#if defined(arm) || defined(__hppa__)
#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__)
if ((devport = open("/dev/port", O_RDWR)) < 0) {
perror("open /dev/port");
return;
......@@ -118,7 +118,7 @@ port_t::~port_t(void) {
unlock(port);
#endif /* LOCKING */
#ifdef LINUX
#if defined(arm) || defined(__hppa__)
#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__)
if (devport >= 0)
close(devport);
#else
......
......@@ -35,7 +35,7 @@
#include <unistd.h>
#ifdef __linux__
#if !defined(arm) && !defined(__hppa__)
#if !defined(arm) && !defined(__hppa__) && !defined(__sparc__) && !defined(__ppc__) && !defined(__powerpc__)
#include <sys/io.h>
#endif /* !arm */
#elif defined(QNX)
......@@ -55,7 +55,7 @@
#error Please define a platform in the Makefile
#endif
#if defined(arm) || defined(__hppa__)
#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__)
static char ports_temp;
#ifdef inb
......@@ -114,7 +114,7 @@ private:
#ifdef FREEBSD
FILE *devio;
#endif
#if defined(__linux__) && (defined(arm) || defined(__hppa__))
#if defined(__linux__) && (defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__))
int devport;
#endif
};
......
......@@ -341,9 +341,9 @@ bool InfoBoxes::timeChanged( const KStarsDateTime &ut, const KStarsDateTime &lt,
QString ot3 = TimeBox->text3();
TimeBox->setText1( i18n( "Local Time", "LT: " ) + lt.time().toString()
+ " " + lt.date().toString("dd MMM yyyy") );
+ " " + lt.date().toString( "%d %b %Y" ) );
TimeBox->setText2( i18n( "Universal Time", "UT: " ) + ut.time().toString()
+ " " + ut.date().toString("dd MMM yyyy") );
+ " " + ut.date().toString( "%d %b %Y" ) );
QString STString;
STString = STString.sprintf( "%02d:%02d:%02d ", lst->hour(), lst->minute(), lst->second() );
TimeBox->setText3( i18n( "Sidereal Time", "ST: " ) + STString +
......
......@@ -52,7 +52,6 @@ Comment[tg]=Планетариуми Мизи Корӣ
Comment[tr]=Masaüstünde Yıldızlar
Comment[ven]=Vhusumbedzhwa mupo ya Desikithopo
Comment[xh]=Indlu ye Desktop
Comment[xx]=xxDesktop Planetariumxx
Comment[zh_CN]=桌面天文馆
Comment[zh_TW]=桌面星象儀
Comment[zu]=Okwemikhathi kwe-Desktop
......@@ -70,7 +69,6 @@ Name[pt_BR]=Estrelas
Name[sv]=Kstars
Name[ta]=கேஸ்டார்ஸ்
Name[ven]=Vhadivhalea vha K
Name[xx]=xxKStarsxx
GenericName=Desktop Planetarium
GenericName[bg]=Планетариум за работния плот
GenericName[bs]=Desktop planetarijum
......@@ -105,7 +103,6 @@ GenericName[sr@Latn]=Planetarijum na radnoj površinidž
GenericName[sv]=Skrivbordsplanetarium
GenericName[ta]=பணிமேடை கோளரங்கம்
GenericName[tg]=Планетариуми Мизи Корӣ
GenericName[xx]=xxDesktop Planetariumxx
GenericName[zh_CN]=桌面天文馆
X-DCOP-ServiceType=Multi
Categories=Qt;KDE;Education;Science;Astronomy
......@@ -224,6 +224,8 @@ class KStars : public KMainWindow, virtual public KStarsInterface
void resumeDCOP( void ) { kapp->dcopClient()->resume(); }
void slotClearAllTrails();
private slots:
/**
*action slot: synch kstars clock to system time
......
......@@ -53,6 +53,9 @@
#include "skyobject.h"
#include "skyobjectname.h"
#include "ksplanetbase.h"
#include "ksasteroid.h"
#include "kscomet.h"
#include "ksmoon.h"
#include "simclock.h"
#include "infoboxes.h"
#include "toggleaction.h"
......@@ -334,6 +337,7 @@ void KStars::slotViewOps() {
void KStars::slotApplySettings() {
Options::writeConfig();
data()->setFullTimeUpdate();
map()->forceUpdate();
}
......@@ -588,6 +592,9 @@ void KStars::slotTrack() {
map()->setFocusPoint( NULL );
} else {
map()->setClickedPoint( map()->focus() );
map()->setClickedObject( NULL );
map()->setFocusObject( NULL );//no longer tracking focusObject
map()->setFocusPoint( map()->clickedPoint() );
Options::setIsTracking( true );
actionCollection()->action("track_object")->setText( i18n( "Stop &Tracking" ) );
actionCollection()->action("track_object")->setIconSet( BarIcon( "encrypted" ) );
......@@ -838,6 +845,36 @@ void KStars::slotFullScreen()
}
}
void KStars::slotClearAllTrails() {
//Exclude object with temporary trail
SkyObject *exOb( NULL );
if ( map()->focusObject() && map()->focusObject()->isSolarSystem() && data()->temporaryTrail ) {
exOb = map()->focusObject();
}
//Major bodies
if ( !( exOb && exOb->name() == "Moon" ) ) data()->Moon->clearTrail();
if ( !( exOb && exOb->name() == "Sun" ) ) data()->PCat->findByName("Sun")->clearTrail();
if ( !( exOb && exOb->name() == "Mercury" ) ) data()->PCat->findByName("Mercury")->clearTrail();
if ( !( exOb && exOb->name() == "Venus" ) ) data()->PCat->findByName("Venus")->clearTrail();
if ( !( exOb && exOb->name() == "Mars" ) ) data()->PCat->findByName("Mars")->clearTrail();
if ( !( exOb && exOb->name() == "Jupiter" ) ) data()->PCat->findByName("Jupiter")->clearTrail();
if ( !( exOb && exOb->name() == "Saturn" ) ) data()->PCat->findByName("Saturn")->clearTrail();
if ( !( exOb && exOb->name() == "Uranus" ) ) data()->PCat->findByName("Uranus")->clearTrail();
if ( !( exOb && exOb->name() == "Neptune" ) ) data()->PCat->findByName("Neptune")->clearTrail();
if ( !( exOb && exOb->name() == "Pluto" ) ) data()->PCat->findByName("Pluto")->clearTrail();
//Asteroids
for ( KSAsteroid *ast = data()->asteroidList.first(); ast; ast = data()->asteroidList.next() )
if ( !( exOb && exOb->name() == ast->name() ) ) ast->clearTrail();
//Comets
for ( KSComet *com = data()->cometList.first(); com; com = data()->cometList.next() )
if ( !( exOb && exOb->name() == com->name() ) ) com->clearTrail();
map()->forceUpdate();
}
//toggle display of GUI Items on/off
void KStars::slotShowGUIItem( bool show ) {
//Toolbars
......
......@@ -443,8 +443,9 @@ void KStars::printImage( bool usePrintDialog, bool useChartColors ) {
if ( useChartColors ) {
data()->colorScheme()->copy( cs );
// restore colormode in skymap
// restore colormode and colorintensity in skymap
map()->setStarColorMode( cs.starColorMode() );
map()->setStarColorIntensity( cs.starColorIntensity() );
map()->forceUpdate();
}
......
......@@ -16,6 +16,8 @@
***************************************************************************/
#include <qlistview.h> //QCheckListItem
#include <qcheckbox.h>
#include <qlabel.h>
#include "opscatalog.h"
#include "Options.h"
......@@ -43,9 +45,17 @@ OpsCatalog::OpsCatalog( QWidget *p, const char *name, WFlags fl )
showMessier = new QCheckListItem( CatalogList, i18n( "Messier Catalog (symbols)" ), QCheckListItem::CheckBox );
showMessier->setOn( Options::showMessier() );
kcfg_MagLimitDrawStar->setValue( Options::magLimitDrawStar() );
kcfg_MagLimitDrawStarZoomOut->setValue( Options::magLimitDrawStarZoomOut() );
kcfg_MagLimitDrawStar->setMinValue( Options::magLimitDrawStarZoomOut() );
kcfg_MagLimitDrawStarZoomOut->setMaxValue( Options::magLimitDrawStar() );
kcfg_MagLimitDrawDeepSky->setMaxValue( 16.0 );
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
QCheckListItem *newItem = new QCheckListItem( CatalogList, Options::catalogName()[i], QCheckListItem::CheckBox );
......@@ -57,13 +67,11 @@ OpsCatalog::OpsCatalog( QWidget *p, const char *name, WFlags fl )
connect( AddCatalog, SIGNAL( clicked() ), this, SLOT( slotAddCatalog() ) );
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) ) );
}
//empty destructor
......@@ -142,13 +150,29 @@ void OpsCatalog::slotRemoveCatalog() {
}
void OpsCatalog::slotSetDrawStarMagnitude(double newValue) {
kcfg_MagLimitDrawStarZoomOut->setMaxValue( newValue );
ksw->data()->setMagnitude( newValue );
}
void OpsCatalog::slotSetDrawStarZoomOutMagnitude(double newValue) {
Options::setMagLimitDrawStarZoomOut(newValue);
kcfg_MagLimitDrawStar->setMinValue( newValue );
Options::setMagLimitDrawStarZoomOut( newValue );
// force redraw
ksw->map()->forceUpdate();
}
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"
......@@ -51,7 +51,7 @@ private slots:
void slotRemoveCatalog();
void slotSetDrawStarMagnitude(double newValue);
void slotSetDrawStarZoomOutMagnitude(double newValue);
void slotStarWidgets(bool on);
private:
QCheckListItem *showMessier, *showMessImages, *showNGC, *showIC;
......
......@@ -78,9 +78,13 @@ OpsColors::OpsColors( QWidget *p, const char *name, WFlags fl )
kcfg_StarColorMode->setCurrentItem( ksw->data()->colorScheme()->starColorMode() );
connect( ColorPalette, SIGNAL( clicked( QListBoxItem* ) ), this, SLOT( newColor( QListBoxItem* ) ) );
connect( kcfg_StarColorIntensity, SIGNAL( valueChanged( int ) ), this, SLOT( slotStarColorIntensity( int ) ) );
connect( kcfg_StarColorMode, SIGNAL( activated( int ) ), this, SLOT( slotStarColorMode( int ) ) );
connect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) );
connect( AddPreset, SIGNAL( clicked() ), this, SLOT( slotAddPreset() ) );
connect( RemovePreset, SIGNAL( clicked() ), this, SLOT( slotRemovePreset() ) );
RemovePreset->setEnabled( false );
}
//empty destructor
......@@ -130,9 +134,15 @@ bool OpsColors::setColors( QString filename ) {
test.close();
ksw->loadColorScheme( filename );
kcfg_StarColorMode->setCurrentItem( ksw->data()->colorScheme()->starColorMode() );
kcfg_StarColorIntensity->setValue( ksw->data()->colorScheme()->starColorIntensity() );
if ( ksw->map()->starColorMode() != ksw->data()->colorScheme()->starColorMode() )
ksw->map()->setStarColorMode( ksw->data()->colorScheme()->starColorMode() );
if ( ksw->map()->starColorIntensity() != ksw->data()->colorScheme()->starColorIntensity() )
ksw->map()->setStarColorIntensity( ksw->data()->colorScheme()->starColorIntensity() );
for ( unsigned int i=0; i < ksw->data()->colorScheme()->numberOfColors(); ++i ) {
temp->fill( QColor( ksw->data()->colorScheme()->colorAt( i ) ) );
ColorPalette->changeItem( *temp, ksw->data()->colorScheme()->nameAt( i ), i );
......@@ -151,8 +161,10 @@ void OpsColors::slotAddPreset() {
if ( okPressed && ! schemename.isEmpty() ) {
if ( ksw->data()->colorScheme()->save( schemename ) ) {
PresetBox->insertItem( schemename );
PresetFileList.append( ksw->data()->colorScheme()->fileName() );
ksw->addColorMenuItem( schemename, "cs_" + ksw->data()->colorScheme()->fileName().utf8() );
PresetBox->setCurrentItem( PresetBox->findItem( schemename ) );
QString fname = ksw->data()->colorScheme()->fileName();
PresetFileList.append( fname );
ksw->addColorMenuItem( schemename, QString("cs_" + fname.left(fname.find(".colors"))).utf8() );
}
}
}
......@@ -163,17 +175,6 @@ void OpsColors::slotRemovePreset() {
QFile cdatFile;
cdatFile.setName( locateLocal( "appdata", "colors.dat" ) ); //determine filename in local user KDE directory tree.
//Remove entry from the ListBox and from the QStringList holding filenames.
//We don't want another color scheme to be selected, so first
//temporarily disconnect the "highlighted" signal.
disconnect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) );
PresetFileList.remove( PresetFileList.at( PresetBox->currentItem() ) );
PresetBox->removeItem( PresetBox->currentItem() );
//Reconnect the "highlighted" signal
connect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) );
//Remove action from color-schemes menu
ksw->removeColorMenuItem( QString("cs_" + filename.left( filename.find(".colors"))).utf8() );
......@@ -181,6 +182,17 @@ void OpsColors::slotRemovePreset() {
QString message = i18n( "Local color scheme index file could not be opened.\nScheme cannot be removed." );
KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
} else {
//Remove entry from the ListBox and from the QStringList holding filenames.
//We don't want another color scheme to be selected, so first
//temporarily disconnect the "highlighted" signal.
disconnect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) );
PresetBox->removeItem( PresetBox->currentItem() );
PresetBox->setCurrentItem( -1 );
RemovePreset->setEnabled( false );
//Reconnect the "highlighted" signal