DateTimeDialog.cpp   DateTimeDialog.cpp 
skipping to change at line 57 skipping to change at line 57
DateTimeDialog::~DateTimeDialog() DateTimeDialog::~DateTimeDialog()
{ {
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()->getJD(); StelCore *core = StelApp::getInstance().getCore();
double jd = core->getJD();
// UTC -> local tz // UTC -> local tz
setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift( jd)/24.0)); setDateTime(jd + (core->getUTCOffset(jd)/24.0));
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())) ;
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint))); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint)));
connectSpinnerEvents(); connectSpinnerEvents();
} }
void DateTimeDialog::connectSpinnerEvents() const void DateTimeDialog::connectSpinnerEvents() const
{ {
skipping to change at line 122 skipping to change at line 123
second = ds; second = ds;
pushToWidgets(); pushToWidgets();
StelApp::getInstance().getCore()->setJD(newJd()); StelApp::getInstance().getCore()->setJD(newJd());
return true; return true;
} }
bool DateTimeDialog::validJd(double jday) bool DateTimeDialog::validJd(double jday)
{ {
pushToWidgets(); pushToWidgets();
StelApp::getInstance().getCore()->setJD(jday); StelApp::getInstance().getCore()->setJD(jday);
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 153 skipping to change at line 153
/************************************************************************ /************************************************************************
year slider or dial changed year slider or dial changed
************************************************************************/ ************************************************************************/
void DateTimeDialog::yearChanged(int newyear) void DateTimeDialog::yearChanged(int newyear)
{ {
if ( year != newyear ) if ( year != newyear )
{ {
valid( newyear, month, day, hour, minute, second ); valid( newyear, month, day, hour, minute, second );
emit StelApp::getInstance().getCore()->dateChanged();
} }
} }
void DateTimeDialog::monthChanged(int newmonth) void DateTimeDialog::monthChanged(int newmonth)
{ {
if ( month != newmonth ) if ( month != newmonth )
{ {
valid( year, newmonth, day, hour, minute, second ); valid( year, newmonth, day, hour, minute, second );
emit StelApp::getInstance().getCore()->dateChanged();
} }
} }
void DateTimeDialog::dayChanged(int newday) void DateTimeDialog::dayChanged(int newday)
{ {
int delta = newday - day; int delta = newday - day;
validJd(jd + delta); validJd(jd + delta);
emit StelApp::getInstance().getCore()->dateChanged();
} }
void DateTimeDialog::hourChanged(int newhour) void DateTimeDialog::hourChanged(int newhour)
{ {
int delta = newhour - hour; int delta = newhour - hour;
validJd(jd + delta/24.); validJd(jd + delta/24.);
} }
void DateTimeDialog::minuteChanged(int newminute) void DateTimeDialog::minuteChanged(int newminute)
{ {
int delta = newminute - minute; int delta = newminute - minute;
skipping to change at line 203 skipping to change at line 206
void DateTimeDialog::mjdChanged(double nmjd) void DateTimeDialog::mjdChanged(double nmjd)
{ {
double delta = nmjd - getMjd(); double delta = nmjd - getMjd();
validJd(jd + delta); validJd(jd + delta);
} }
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);
cjd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(cjd)/24.0) ; // local tz -> UTC cjd -= (StelApp::getInstance().getCore()->getUTCOffset(cjd)/24.0); / / local tz -> UTC
return cjd; return cjd;
} }
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);
skipping to change at line 233 skipping to change at line 236
connectSpinnerEvents(); connectSpinnerEvents();
} }
/************************************************************************ /************************************************************************
Prepare date elements from newJd and send to spinner_* Prepare date elements from newJd and send to spinner_*
************************************************************************/ ************************************************************************/
void DateTimeDialog::setDateTime(double newJd) void DateTimeDialog::setDateTime(double newJd)
{ {
if (this->visible()) { if (this->visible()) {
// JD and MJD should be at the UTC scale on the window! // JD and MJD should be at the UTC scale on the window!
double newJdC = newJd + StelApp::getInstance().getLocaleMgr( ).getGMTShift(newJd)/24.0; // UTC -> local tz double newJdC = newJd + StelApp::getInstance().getCore()->ge tUTCOffset(newJd)/24.0; // UTC -> local tz
StelUtils::getDateFromJulianDay(newJdC, &year, &month, &day) ; StelUtils::getDateFromJulianDay(newJdC, &year, &month, &day) ;
StelUtils::getTimeFromJulianDay(newJdC, &hour, &minute, &sec ond); StelUtils::getTimeFromJulianDay(newJdC, &hour, &minute, &sec ond);
jd = newJd; jd = newJd;
pushToWidgets(); pushToWidgets();
} }
} }
 End of changes. 8 change blocks. 
5 lines changed or deleted 8 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/