TuiNodeDateTime.cpp   TuiNodeDateTime.cpp 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "TuiNodeDateTime.hpp" #include "TuiNodeDateTime.hpp"
#include "StelNavigator.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelCore.hpp"
#include <QKeyEvent> #include <QKeyEvent>
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
TuiNodeDateTime::TuiNodeDateTime(const QString& text, QObject* receiver, co nst char* method, double defValue, TuiNode* parent, TuiNode* prev) TuiNodeDateTime::TuiNodeDateTime(const QString& text, QObject* receiver, co nst char* method, double defValue, TuiNode* parent, TuiNode* prev)
: TuiNodeEditable(text, parent, prev), value(defValue), editingPart( 0), typing(false) : TuiNodeEditable(text, parent, prev), value(defValue), editingPart( 0), typing(false)
{ {
this->connect(this, SIGNAL(setValue(double)), receiver, method); this->connect(this, SIGNAL(setValue(double)), receiver, method);
} }
skipping to change at line 163 skipping to change at line 163
{ {
double newDate; double newDate;
int m = ((parts.at(editingPart)-1+diff) % 12) + 1; int m = ((parts.at(editingPart)-1+diff) % 12) + 1;
if (m==0) m=12; if (m==0) m=12;
qDebug() << "new m is" << m; qDebug() << "new m is" << m;
if (StelUtils::getJDFromDate(&newDate, parts.at(0), m, parts .at(2), parts.at(3), parts.at(4), parts.at(5))) if (StelUtils::getJDFromDate(&newDate, parts.at(0), m, parts .at(2), parts.at(3), parts.at(4), parts.at(5)))
value = newDate; value = newDate;
} }
else if (editingPart==2) else if (editingPart==2)
{ {
value += (diff * JD_DAY); value += (diff * StelCore::JD_DAY);
} }
else if (editingPart==3) else if (editingPart==3)
{ {
value += (diff * JD_HOUR); value += (diff * StelCore::JD_HOUR);
} }
else if (editingPart==4) else if (editingPart==4)
{ {
value += (diff * JD_MINUTE); value += (diff * StelCore::JD_MINUTE);
} }
else if (editingPart==5) else if (editingPart==5)
{ {
value += (diff * JD_SECOND); value += (diff * StelCore::JD_SECOND);
} }
} }
QList<int> TuiNodeDateTime::getParts(double jd) QList<int> TuiNodeDateTime::getParts(double jd)
{ {
int year, month, day, hour, minute, second; int year, month, day, hour, minute, second;
StelUtils::getDateFromJulianDay(jd, &year, &month, &day); StelUtils::getDateFromJulianDay(jd, &year, &month, &day);
StelUtils::getTimeFromJulianDay(jd, &hour, &minute, &second); StelUtils::getTimeFromJulianDay(jd, &hour, &minute, &second);
QList<int> parts; QList<int> parts;
parts << year << month << day << hour << minute << second; parts << year << month << day << hour << minute << second;
 End of changes. 6 change blocks. 
5 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/