DateTimeDialog.cpp   DateTimeDialog.cpp 
skipping to change at line 124 skipping to change at line 124
minute = dmin; minute = dmin;
second = ds; second = ds;
pushToWidgets(); pushToWidgets();
StelApp::getInstance().getCore()->setJDay(newJd()); StelApp::getInstance().getCore()->setJDay(newJd());
return true; return true;
} }
bool DateTimeDialog::validJd(double jday) bool DateTimeDialog::validJd(double jday)
{ {
pushToWidgets(); pushToWidgets();
StelApp::getInstance().getCore()->setJDay(jday+StelApp::getInstance( StelCore *core = StelApp::getInstance().getCore();
).getCore()->getDeltaT(jday)/86400.); core->setJDay(jday+core->getDeltaT(jday)/86400.);
return true;
}
bool DateTimeDialog::validMjd(double mjday)
{
pushToWidgets();
StelApp::getInstance().getCore()->setMJDay(mjday+StelApp::getInstanc
e().getCore()->getDeltaT(mjday)/86400.);
return true; return true;
} }
void DateTimeDialog::retranslate() void DateTimeDialog::retranslate()
{ {
if (dialog) { if (dialog) {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
} }
skipping to change at line 210 skipping to change at line 204
{ {
if ( jd != njd) if ( jd != njd)
{ {
validJd(njd); validJd(njd);
} }
} }
void DateTimeDialog::mjdChanged(double nmjd) void DateTimeDialog::mjdChanged(double nmjd)
{ {
if ( mjd != nmjd) if ( mjd != nmjd)
{ {
validMjd(nmjd); validJd(2400000.5 + nmjd);
} }
} }
double DateTimeDialog::newJd() double DateTimeDialog::newJd()
{ {
double cjd; double cjd;
StelUtils::getJDFromDate(&cjd, year, month, day, hour, minute, secon d); StelUtils::getJDFromDate(&cjd, year, month, day, hour, minute, secon d);
// Add in a DeltaT correction. Divide DeltaT by 86400 to convert fro m seconds to days. // Add in a DeltaT correction. Divide DeltaT by 86400 to convert fro m seconds to days.
double deltaT = 0.; double deltaT = 0.;
if (StelApp::getInstance().getCore()->getCurrentLocation().planetNam e=="Earth") if (StelApp::getInstance().getCore()->getCurrentLocation().planetNam e=="Earth")
skipping to change at line 241 skipping to change at line 235
ui->spinner_day->setValue(day); ui->spinner_day->setValue(day);
ui->spinner_hour->setValue(hour); ui->spinner_hour->setValue(hour);
if (!ui->spinner_minute->hasFocus() || (ui->spinner_minute->value() == -1) || (ui->spinner_minute->value() == 60)) if (!ui->spinner_minute->hasFocus() || (ui->spinner_minute->value() == -1) || (ui->spinner_minute->value() == 60))
{ {
ui->spinner_minute->setValue(minute); ui->spinner_minute->setValue(minute);
} }
if (!ui->spinner_second->hasFocus() || (ui->spinner_second->value() == -1) || (ui->spinner_second->value() == 60)) if (!ui->spinner_second->hasFocus() || (ui->spinner_second->value() == -1) || (ui->spinner_second->value() == 60))
{ {
ui->spinner_second->setValue(second); ui->spinner_second->setValue(second);
} }
if (!ui->spinner_jd->hasFocus()) ui->spinner_jd->setValue(jd);
{ ui->spinner_mjd->setValue(mjd);
ui->spinner_jd->setValue(jd);
}
if (!ui->spinner_mjd->hasFocus())
{
ui->spinner_mjd->setValue(mjd);
}
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()) {
// Add in a DeltaT correction. Divide DeltaT by 86400 to con vert from seconds to days. // Add in a DeltaT correction. Divide DeltaT by 86400 to con vert from seconds to days.
 End of changes. 3 change blocks. 
19 lines changed or deleted 5 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/