Commit e55790ee authored by nobody's avatar nobody

This commit was manufactured by cvs2svn to create tag

'KDE_3_1_4_RELEASE'.

svn path=/tags/KDE_3_1_4_RELEASE/kdeedu/kstars/; revision=250011
parents 4a918643 f80c17ab
......@@ -41,7 +41,7 @@
AstroCalc::AstroCalc( QWidget* parent ) :
KDialogBase( parent, "starscalculator", true,
i18n("KStars Calculator"), Ok | Cancel ) {
i18n("KStars Calculator"), Close ) {
split = new QSplitter ( this );
setMainWidget(split);
......
......@@ -1242,7 +1242,7 @@ Lewiston : New York : USA
Lewistown : Montana : USA : 47 : 4 : 58 : N : 109 : 25 : 1 : W : -7.0 : US
Lexington : Kentucky : USA : 38 : 2 : 49 : N : 84 : 29 : 45 : W : -5.0 : US
Leopold Figl : : Austria : 48 : 5 : 0 : N : 15 : 25 : 30 : E : 1.0 : EU
Lhasa : : Tibet : 29 : 40 : 59 : N : 91 : 12 : 0 : E : 8.0 : CH
Lhasa : Tibet : China : 29 : 40 : 59 : N : 91 : 12 : 0 : E : 8.0 : CH
Libreville : : Gabon : 0 : 36 : 0 : N : 9 : 18 : 0 : E : 1.0 : --
Lihue : Hawaii : USA : 21 : 58 : 48 : N : 159 : 22 : 30 : W :-10.0 : US
Lima : Ohio : USA : 40 : 44 : 34 : N : 84 : 6 : 19 : W : -5.0 : US
......
......@@ -1479,7 +1479,7 @@
1496 PER 04 04 31.8 +52 39 41 3 II1p 9.6 6.00
1497 TAU 04 02 06.8 +23 07 58 8 S0 14.3 1.80 1.2 60 14331 2929
1498 ERI 04 00 19.4 -12 01 12 0 *3
1499 PER 04 03 14.4 +36 22 03 5 EN 5.0 160.00 40.0 California Nebula
1499 PER 04 03 14.4 +36 22 03 5 EN 5.0 160.00 40.0 California Nebula
1500 DOR 03 58 14.0 -52 19 44 8 E 14.7 1.10 0.9 14187
1501 CAM 04 06 59.4 +60 55 15 6 PN 13.3 0.87
1502 CAM 04 07 49.2 +62 19 54 3 II3p 6.9 8.00
......@@ -6908,7 +6908,7 @@
6997 CYG 20 56 39.0 +44 37 54 3 III2 10.0 7.00
6998 MIC 21 01 37.7 -28 01 56 8 E 15.2 0.70 0.7 65925
6999 MIC 21 01 59.6 -28 03 34 8 S0 15.0 0.90 0.7 65940
7000 CYG 21 59 00.0 +44 31 00 5 EN 4.0 120.00 30.0 North American Nebula
7000 CYG 20 58 48.0 +44 20 00 5 EN 4.0 120.00 100.0 North American Nebula
7001 AQR 21 01 07.7 -00 11 43 8 Sab 14.3 1.40 1.1 162 65905 11663
7002 IND 21 03 45.0 -49 01 47 8 E 13.4 1.50 1.2 3 66009
7003 DEL 21 00 42.3 +17 48 15 8 Sb-c 13.8 1.10 0.8 120 65887 11662
......@@ -27,7 +27,6 @@
#include <qhbox.h>
#include <qlineedit.h>
#include <qstring.h>
#include <qregexp.h>
#include <qwidget.h>
#include <qregexp.h>
......
......@@ -17,7 +17,7 @@
#include <qstring.h>
#include <qimage.h>
#include <qvector.h>
#include <qptrvector.h>
#include <qdict.h>
#include "ksplanetbase.h"
#include "dms.h"
......
......@@ -91,7 +91,6 @@ KStars::KStars( KStarsData* kd )
KStars::~KStars()
{
kdDebug() << "in kstars destructor..." << endl;
saveOptions();
clearCachedFindDialog();
......
......@@ -9,6 +9,7 @@ Comment=Desktop Planetarium
Comment[af]=Werkskerm Planetarium
Comment[bg]=Планетариум за рабоно място
Comment[bs]=Planetarium na desktopu
Comment[ca]=Planetari per a l'escriptori
Comment[da]=Planetarieprogram
Comment[de]=Das Planetarium für den Schreibtisch
Comment[el]=Πλανητάριο για την επιφάνεια εργασίας
......@@ -18,14 +19,17 @@ Comment[fr]=Planétarium pour le bureau
Comment[he]=פלנטריום שולחני
Comment[hr]=Planetarij za radnu površinu
Comment[hu]=mini planetárium
Comment[is]=Planetarium á skjáborðið
Comment[it]=Planetario per il desktop
Comment[ja]=デスクトッププラネタリウム
Comment[lt]=Darbastalio planetariumas
Comment[lv]=Darbvirsmas Planetārijs
Comment[mn]=Дэлгэцэн дээрх Оддын Хотхон
Comment[nb]=Skrivebordsplanetarium
Comment[nl]=Desktop-planetarium
Comment[nn]=Skrivebordsplanetarium
Comment[nso]=Planetarium ya Desktop
Comment[pl]=Planetarium na pulpicie
Comment[pt]=Planetário
Comment[pt_BR]=Planetário do Ambiente de trabalho
Comment[ru]=Настольный планетарий
......@@ -42,6 +46,7 @@ Terminal=0
Name=KStars
Name[af]=K-sterre
Name[fo]=KStjørnur
Name[mn]=K-Од
Name[pl]=Gwiazdy
Name[pt_BR]=Estrelas
Name[sv]=Kstars
......
......@@ -22,9 +22,15 @@
void KStars::loadOptions()
{
KConfig *conf = kapp->config();
//Check if kstarsrc exists. If not, we are using default options (need to know for setting initial focus point)
if ( conf->hasGroup( "Location" ) ) useDefaultOptions = false;
else useDefaultOptions = true;
//Check if kstarsrc exists. If not, we are using default options
//(need to know for setting initial focus point).
//We used to use hasGroup() here, but I have reason to suspect that this
//this causes a crash on some systems (see bug #44869). At Kevin
//Krammer's suggestion, using findResource("kstarsrc") instead.
//if ( conf->hasGroup( "Location" ) ) useDefaultOptions = false;
//else useDefaultOptions = true;
if ( data()->stdDirs->findResource( "config", "kstarsrc" ).isNull() ) useDefaultOptions = true;
else useDefaultOptions = false;
// Get initial Location from config()
conf->setGroup( "Location" );
......
......@@ -304,7 +304,7 @@ void KStars::initActions() {
void KStars::initStatusBar() {
statusBar()->insertItem( i18n( " Welcome to KStars " ), 0, 1, true );
statusBar()->setItemAlignment( 0, AlignLeft | AlignVCenter );
QString s = "00:00:00, +00:00:00";
QString s = "00h 00m 00s, +00d 00\'00\"";
statusBar()->insertItem( s, 1, 1, true );
statusBar()->setItemAlignment( 1, AlignRight | AlignVCenter );
......@@ -366,10 +366,33 @@ void KStars::datainitFinished(bool worked) {
pd->buildGUI();
updateTime();
clock->start();
show();
//Check whether initial position is below the horizon.
//We sued to just call slotCenter() in buildGUI() which performs this check.
//However, on a Gentoo system, if the messagebox is shown before show() is called,
//the program exits. It does not crash (at least there are no error messages),
//it simply exits. Very strange.
if ( options()->useAltAz && options()->drawGround &&
map()->focus()->alt().Degrees() < -1.0 ) {
QString caption = i18n( "Initial Position is Below Horizon" );
QString message = i18n( "The initial position is below the horizon.\nWould you like to reset to the default position?" );
if ( KMessageBox::warningYesNo( this, message, caption,
KStdGuiItem::yes(), KStdGuiItem::no(), "dag_start_below_horiz" ) == KMessageBox::Yes ) {
map()->setClickedObject( NULL );
map()->setFoundObject( NULL );
options()->isTracking = false;
options()->setSnapNextFocus(true);
SkyPoint DefaultFocus;
DefaultFocus.setAz( 180.0 );
DefaultFocus.setAlt( 45.0 );
DefaultFocus.HorizontalToEquatorial( LSTh(), geo()->lat() );
map()->setDestination( &DefaultFocus );
}
}
// just show dialog if option is set (don't force it)
KTipDialog::showTip( "kstars/tips" );
}
......@@ -493,21 +516,22 @@ void KStars::privatedata::buildGUI() {
}
}
ks->map()->slotCenter();
// ks->map()->slotCenter();
} else {
ks->map()->setClickedPoint( &newPoint );
ks->map()->slotCenter();
// ks->map()->slotCenter();
}
ks->map()->setDestination( ks->map()->clickedPoint() );
ks->map()->destination()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() );
ks->map()->setFocus( ks->map()->destination() );
ks->map()->focus()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() );
ks->map()->destination()->EquatorialToHorizontal( ks->LSTh(), ks->geo()->lat() );
ks->setHourAngle();
ks->map()->setOldFocus( ks->map()->focus() );
ks->map()->oldfocus()->setAz( ks->map()->focus()->az() );
ks->map()->oldfocus()->setAlt( ks->map()->focus()->alt() );
ks->map()->oldfocus()->setAz( ks->map()->focus()->az().Degrees() );
ks->map()->oldfocus()->setAlt( ks->map()->focus()->alt().Degrees() );
kapp->dcopClient()->resume();
......
......@@ -19,7 +19,6 @@
#include "modcalcprec.h"
#include "dms.h"
#include "dmsbox.h"
#include "timebox.h"
#include "skyobject.h"
#include "ksutils.h"
#include "kssun.h"
......@@ -288,6 +287,7 @@ void modCalcDayLength::slotComputePosTime()
{
long double jd0 = computeJdFromCalendar();
getGeoLocation();
KSNumbers * num = new KSNumbers(jd0);
KSSun *Sun = new KSSun((KStars*) parent()->parent()->parent());
......
......@@ -40,6 +40,7 @@
#include "ksutils.h"
#include "skymap.h"
#include "imageviewer.h"
#include "infoboxes.h"
#include "addlinkdialog.h"
#if (QT_VERSION < 300)
......@@ -295,7 +296,8 @@ void SkyMap::slotCenter( void ) {
QString caption = i18n( "Requested Position Below Horizon" );
QString message = i18n( "The requested position is below the horizon.\nWould you like to go there anyway?" );
if ( KMessageBox::warningYesNo( 0, message, caption )==KMessageBox::No ) {
if ( KMessageBox::warningYesNo( ksw, message, caption,
KStdGuiItem::yes(), KStdGuiItem::no(), "dag_focus_below_horiz" )==KMessageBox::No ) {
setClickedObject( NULL );
setFoundObject( NULL );
ksw->options()->isTracking = false;
......@@ -338,17 +340,25 @@ void SkyMap::slotCenter( void ) {
void SkyMap::slotDSS( void ) {
QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=1" );
QString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" );
dms ra(0.0), dec(0.0);
QString RAString, DecString;
char decsgn;
RAString = RAString.sprintf( "&r=%02d+%02d+%02d", clickedPoint()->ra().hour(),
clickedPoint()->ra().minute(),
clickedPoint()->ra().second() );
//ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
if ( clickedObject() ) {
ra.setH( clickedObject()->ra0().Hours() );
dec.setD( clickedObject()->dec0().Degrees() );
} else {
ra.setH( clickedPoint()->ra().Hours() );
dec.setD( clickedPoint()->dec().Degrees() );
}
RAString = RAString.sprintf( "&r=%02d+%02d+%02d", ra.hour(), ra.minute(), ra.second() );
decsgn = '+';
if (clickedPoint()->dec().Degrees() < 0.0) decsgn = '-';
int dd = abs( clickedPoint()->dec().degree() );
int dm = abs( clickedPoint()->dec().getArcMin() );
int ds = abs( clickedPoint()->dec().getArcSec() );
if ( dec.Degrees() < 0.0 ) decsgn = '-';
int dd = abs( dec.degree() );
int dm = abs( dec.getArcMin() );
int ds = abs( dec.getArcSec() );
DecString = DecString.sprintf( "&d=%c%02d+%02d+%02d", decsgn, dd, dm, ds );
//concat all the segments into the kview command line:
......@@ -360,15 +370,25 @@ void SkyMap::slotDSS2( void ) {
QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=2r" );
QString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" );
QString RAString, DecString;
dms ra(0.0), dec(0.0);
char decsgn;
RAString = RAString.sprintf( "&r=%02d+%02d+%02d", clickedPoint()->ra().hour(),
clickedPoint()->ra().minute(),
clickedPoint()->ra().second() );
//ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords
if ( clickedObject() ) {
ra.setH( clickedObject()->ra0().Hours() );
dec.setD( clickedObject()->dec0().Degrees() );
} else {
ra.setH( clickedPoint()->ra().Hours() );
dec.setD( clickedPoint()->dec().Degrees() );
}
RAString = RAString.sprintf( "&r=%02d+%02d+%02d", ra.hour(), ra.minute(), ra.second() );
decsgn = '+';
if (clickedPoint()->dec().Degrees() < 0.0) decsgn = '-';
int dd = abs( clickedPoint()->dec().degree() );
int dm = abs( clickedPoint()->dec().getArcMin() );
int ds = abs( clickedPoint()->dec().getArcSec() );
if ( dec.Degrees() < 0.0 ) decsgn = '-';
int dd = abs( dec.degree() );
int dm = abs( dec.getArcMin() );
int ds = abs( dec.getArcSec() );
DecString = DecString.sprintf( "&d=%c%02d+%02d+%02d", decsgn, dd, dm, ds );
......@@ -521,6 +541,9 @@ void SkyMap::slewFocus( void ) {
//Also, now that the focus has re-centered, engage tracking.
setFocus( destination() );
focus()->EquatorialToHorizontal( ksw->data()->LSTh, ksw->geo()->lat() );
if ( foundObject() )
ksw->infoBoxes()->focusObjChanged( foundObject()->translatedName() );
ksw->setHourAngle();
slewing = false;
......
......@@ -388,8 +388,11 @@ void SkyMap::mouseReleaseEvent( QMouseEvent * ) {
if (mouseMoveCursor) setDefaultMouseCursor(); // set default cursor
if (mouseButtonDown) { //false if double-clicked, becuase it's unset there.
mouseButtonDown = false;
setDestination( focus() );
slewing = false;
if ( slewing ) {
setDestination( focus() );
slewing = false;
}
setOldFocus( focus() );
Update(); // is needed because after moving the sky not all stars are shown
}
......
......@@ -329,7 +329,7 @@ dms SkyObject::gstAtCeroUT (long double jd) {
double SkyObject::approxHourAngle (dms h0, dms gLat, dms dec) {
double sh0 = - sin ( h0.radians() );
double sh0 = sin ( h0.radians() );
double r = (sh0 - sin( gLat.radians() ) * sin(dec.radians() ))
/ (cos( gLat.radians() ) * cos( dec.radians() ) );
......@@ -347,12 +347,32 @@ bool SkyObject::checkCircumpolar(dms gLat) {
}
dms SkyObject::elevationCorrection(void) {
/** The atmospheric refraction at the horizon shifts altitude by
* - 34 arcmin = 0.5667 degrees. This value changes if the observer
* is above the horizon, or if the weather conditions change much.
*
* For the sun we have to add half the angular sie of the body, since
* the sunset is the time the upper limb of the sun disappears below
* the horizon, and dawn, when the upper part of the limb appears
* over the horizon. The angular size of the sun = angular size of the
* moon = 31' 59''.
*
* So for the sun the correction is = -34 - 16 = 50 arcmin = -0.8333
*
* This same correction should be applied to the moon however parallax
* is important here. Meeus states that the correction should be
* 0.7275 P - 34 arcmin, where P is the moon's horizontal parallax.
* He proposes a mean value of 0.125 degrees if no great accuracy
* is needed.
*/
if ( name() == "Sun" )
return dms(0.5667);
return dms(-0.8333);
else if ( name() == "Moon" )
return dms(0.125); // a rough approximation
else
return dms(0.8333);
return dms(-0.5667);
}
long double SkyObject::newJDfromJDandUT(long double jd, dms UT) {
......
......@@ -198,10 +198,11 @@ bool TimeZoneRule::isDSTActive( const QDateTime date ) {
// the interval check is different if StartMonth > RevertMonth (indicating that
// the DST interval includes the end of the year).
int month = date.date().month();
if ( StartMonth < RevertMonth )
if ( StartMonth < RevertMonth ) {
if ( month < StartMonth || month > RevertMonth ) return false;
else
} else {
if ( month < StartMonth && month > RevertMonth ) return false;
}
// OK, if the month is equal to StartMonth or Revert Month, we have more
// detailed checking to do...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment