DateTimeDialog.cpp   DateTimeDialog.cpp 
skipping to change at line 55 skipping to change at line 55
{ {
delete ui; delete ui;
ui=NULL; ui=NULL;
} }
void DateTimeDialog::createDialogContent() void DateTimeDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
double jd = StelApp::getInstance().getCore()->getJDay(); double jd = StelApp::getInstance().getCore()->getJDay();
// UTC -> local tz // UTC -> local tz
setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift( // Add in a DeltaT correction. Divide DeltaT by 86400 to convert fro
jd)/24.0)); m seconds to days.
double deltaT = 0.;
if (StelApp::getInstance().getCore()->getCurrentLocation().planetNam
e=="Earth")
deltaT = StelUtils::getDeltaT(jd)/86400.;
setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift(
jd)/24.0)-deltaT);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connectSpinnerEvents(); connectSpinnerEvents();
} }
void DateTimeDialog::connectSpinnerEvents() const void DateTimeDialog::connectSpinnerEvents() const
{ {
connect(ui->spinner_year, SIGNAL(valueChanged(int)), this, SLOT(year Changed(int))); connect(ui->spinner_year, SIGNAL(valueChanged(int)), this, SLOT(year Changed(int)));
skipping to change at line 172 skipping to change at line 176
{ {
if ( second != newsecond ) { if ( second != newsecond ) {
valid( year, month, day, hour, minute, newsecond ); valid( year, month, day, hour, minute, newsecond );
} }
} }
double DateTimeDialog::newJd() double DateTimeDialog::newJd()
{ {
double jd; double jd;
StelUtils::getJDFromDate(&jd,year, month, day, hour, minute, second); StelUtils::getJDFromDate(&jd,year, month, day, hour, minute, second);
jd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0); // lo // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from sec
cal tz -> UTC onds to days.
double deltaT = 0.;
if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="E
arth")
deltaT = StelUtils::getDeltaT(jd)/86400.;
jd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0-deltaT)
; // local tz -> UTC
return jd; return jd;
} }
void DateTimeDialog::pushToWidgets() void DateTimeDialog::pushToWidgets()
{ {
disconnectSpinnerEvents(); disconnectSpinnerEvents();
ui->spinner_year->setValue(year); ui->spinner_year->setValue(year);
ui->spinner_month->setValue(month); ui->spinner_month->setValue(month);
ui->spinner_day->setValue(day); ui->spinner_day->setValue(day);
ui->spinner_hour->setValue(hour); ui->spinner_hour->setValue(hour);
skipping to change at line 202 skipping to change at line 210
} }
connectSpinnerEvents(); connectSpinnerEvents();
} }
/************************************************************************ /************************************************************************
Send newJd to spinner_* Send newJd to spinner_*
************************************************************************/ ************************************************************************/
void DateTimeDialog::setDateTime(double newJd) void DateTimeDialog::setDateTime(double newJd)
{ {
if (this->visible()) { if (this->visible()) {
newJd += (StelApp::getInstance().getLocaleMgr().getGMTShift( // Add in a DeltaT correction. Divide DeltaT by 86400 to con
newJd)/24.0); // UTC -> local tz vert from seconds to days.
double deltaT = 0.;
if (StelApp::getInstance().getCore()->getCurrentLocation().p
lanetName=="Earth")
deltaT = StelUtils::getDeltaT(newJd)/86400.;
newJd += (StelApp::getInstance().getLocaleMgr().getGMTShift(
newJd)/24.0-deltaT); // UTC -> local tz
StelUtils::getDateFromJulianDay(newJd, &year, &month, &day); StelUtils::getDateFromJulianDay(newJd, &year, &month, &day);
StelUtils::getTimeFromJulianDay(newJd, &hour, &minute, &seco nd); StelUtils::getTimeFromJulianDay(newJd, &hour, &minute, &seco nd);
pushToWidgets(); pushToWidgets();
} }
} }
 End of changes. 3 change blocks. 
6 lines changed or deleted 24 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/