TextUserInterface.cpp   TextUserInterface.cpp 
skipping to change at line 46 skipping to change at line 46
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "MilkyWay.hpp" #include "MilkyWay.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "StelNavigator.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainGraphicsView.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
#include <QtOpenGL> #include <QtOpenGL>
#include <QKeyEvent> #include <QKeyEvent>
#include <QDebug> #include <QDebug>
#include <QLabel> #include <QLabel>
skipping to change at line 132 skipping to change at line 131
qDebug() << "init called for TextUserInterface"; qDebug() << "init called for TextUserInterface";
TuiNode* m1 = new TuiNode("1. Set Location"); TuiNode* m1 = new TuiNode("1. Set Location");
TuiNode* m1_1 = new TuiNodeDouble("1.1 Latitude", TuiNode* m1_1 = new TuiNodeDouble("1.1 Latitude",
this, SLOT(setLatitude(double)), this, SLOT(setLatitude(double)),
getLatitude(), -180, 180, 0.5, m1) ; getLatitude(), -180, 180, 0.5, m1) ;
TuiNode* m1_2 = new TuiNodeDouble("1.2 Longitude", TuiNode* m1_2 = new TuiNodeDouble("1.2 Longitude",
this, SLOT(setLongitude(double)), this, SLOT(setLongitude(double)),
getLongitude(), -180, 180, 0.5, m1 , m1_1); getLongitude(), -180, 180, 0.5, m1 , m1_1);
TuiNode* m1_3 = new TuiNodeInt("1.3 Altitude", TuiNode* m1_3 = new TuiNodeInt("1.3 Altitude",
this, SLOT(setAltitude(int)), this, SLOT(setAltitude(int)),
StelApp::getInstance().getCore()->get Navigator()->getCurrentLocation().altitude, StelApp:: getInstance().getCore()->getCurrentLocation().altitude,
-200, 200000, 100, m1, m1_2); -200, 200000, 100, m1, m1_2);
TuiNode* m1_4 = new TuiNodeEnum("1.4 Solar System Body", TuiNode* m1_4 = new TuiNodeEnum("1.4 Solar System Body",
this, SLOT(setHomePlanet(QString)), this, SLOT(setHomePlanet(QString)),
GETSTELMODULE(SolarSystem)->getAllPl anetEnglishNames(), GETSTELMODULE(SolarSystem)->getAllPl anetEnglishNames(),
StelApp::getInstance().getCore()->ge tNavigator()->getCurrentLocation().planetName, Stel App::getInstance().getCore()->getCurrentLocation().planetName,
m1, m1_3); m1, m1_3);
m1_1->setPrevNode(m1_4); m1_1->setPrevNode(m1_4);
m1_1->setNextNode(m1_2); m1_1->setNextNode(m1_2);
m1_2->setNextNode(m1_3); m1_2->setNextNode(m1_3);
m1_3->setNextNode(m1_4); m1_3->setNextNode(m1_4);
m1_4->setNextNode(m1_1); m1_4->setNextNode(m1_1);
m1->setChildNode(m1_1); m1->setChildNode(m1_1);
TuiNode* m2 = new TuiNode("2. Date & Time", NULL, m1); TuiNode* m2 = new TuiNode("2. Date & Time", NULL, m1);
m1->setNextNode(m2); m1->setNextNode(m2);
TuiNode* m2_1 = new TuiNodeDateTime("2.1 Sky Time", TuiNode* m2_1 = new TuiNodeDateTime("2.1 Sky Time",
StelApp::getInstance().getCore() ->getNavigator(), StelApp::getInstance().getCore(),
SLOT(setJDay(double)), SLOT(setJDay(double)),
StelApp::getInstance().getCore() ->getNavigator()->getJDay(), StelApp::getInstance().getCore()->getJDay(),
m2); m2);
TuiNode* m2_2 = new TuiNode("2.2 Set Time Zone", m2, m2_1); TuiNode* m2_2 = new TuiNode("2.2 Set Time Zone", m2, m2_1);
TuiNode* m2_3 = new TuiNode("2.3 Day Keys", m2, m2_2); TuiNode* m2_3 = new TuiNode("2.3 Day Keys", m2, m2_2);
TuiNode* m2_4 = new TuiNodeDateTime("2.4 Preset Sky Time", TuiNode* m2_4 = new TuiNodeDateTime("2.4 Preset Sky Time",
StelApp::getInstance().getCore() ->getNavigator(), StelApp::getInstance().getCore(),
SLOT(setPresetSkyTime(double)), SLOT(setPresetSkyTime(double)),
StelApp::getInstance().getCore() ->getNavigator()->getPresetSkyTime(), StelApp::getInstance().getCore()->getPresetSkyTime(),
m2, m2_3); m2, m2_3);
QStringList startupModes; QStringList startupModes;
startupModes << "system" << "preset"; startupModes << "system" << "preset";
TuiNode* m2_5 = new TuiNodeEnum("2.5 Sky Time at Startup", TuiNode* m2_5 = new TuiNodeEnum("2.5 Sky Time at Startup",
this, SLOT(setStartupDateMode(QStrin g)), startupModes, this, SLOT(setStartupDateMode(QStrin g)), startupModes,
StelApp::getInstance().getCore()->ge tNavigator()->getStartupTimeMode(), Stel App::getInstance().getCore()->getStartupTimeMode(),
m2, m2_4); m2, m2_4);
QStringList dateFormats; QStringList dateFormats;
dateFormats << "system_default" << "mmddyyyy" << "ddmmyyyy" << "yyyy mmdd"; dateFormats << "system_default" << "mmddyyyy" << "ddmmyyyy" << "yyyy mmdd";
TuiNode* m2_6 = new TuiNodeEnum("2.6 Date Display Format", TuiNode* m2_6 = new TuiNodeEnum("2.6 Date Display Format",
this, SLOT(setDateFormat(QString)), dateFormats, this, SLOT(setDateFormat(QString)), dateFormats,
StelApp::getInstance().getLocaleMgr( ).getDateFormatStr(), StelApp::getInstance().getLocaleMgr( ).getDateFormatStr(),
m2, m2_5); m2, m2_5);
QStringList timeFormats; QStringList timeFormats;
timeFormats << "system_default" << "12h" << "24h"; timeFormats << "system_default" << "12h" << "24h";
TuiNode* m2_7 = new TuiNodeEnum("2.7 Time Display Format", TuiNode* m2_7 = new TuiNodeEnum("2.7 Time Display Format",
skipping to change at line 453 skipping to change at line 452
else else
{ {
event->setAccepted(false); event->setAccepted(false);
} }
return; return;
} }
} }
void TextUserInterface::setHomePlanet(QString planetName) void TextUserInterface::setHomePlanet(QString planetName)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( StelCore* core = StelApp::getInstance().getCore();
); if (core->getCurrentLocation().planetName != planetName)
if (nav->getCurrentLocation().planetName != planetName)
{ {
StelLocation newLocation = nav->getCurrentLocation(); StelLocation newLocation = core->getCurrentLocation();
newLocation.planetName = planetName; newLocation.planetName = planetName;
nav->moveObserverTo(newLocation); core->moveObserverTo(newLocation);
} }
} }
void TextUserInterface::setAltitude(int altitude) void TextUserInterface::setAltitude(int altitude)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( StelCore* core = StelApp::getInstance().getCore();
); if (core->getCurrentLocation().altitude != altitude)
if (nav->getCurrentLocation().altitude != altitude)
{ {
StelLocation newLocation = nav->getCurrentLocation(); StelLocation newLocation = core->getCurrentLocation();
newLocation.altitude = altitude; newLocation.altitude = altitude;
nav->moveObserverTo(newLocation, 0.0, 0.0); core->moveObserverTo(newLocation, 0.0, 0.0);
} }
} }
void TextUserInterface::setLatitude(double latitude) void TextUserInterface::setLatitude(double latitude)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( StelCore* core = StelApp::getInstance().getCore();
); if (core->getCurrentLocation().latitude != latitude)
if (nav->getCurrentLocation().latitude != latitude)
{ {
StelLocation newLocation = nav->getCurrentLocation(); StelLocation newLocation = core->getCurrentLocation();
newLocation.latitude = latitude; newLocation.latitude = latitude;
nav->moveObserverTo(newLocation, 0.0, 0.0); core->moveObserverTo(newLocation, 0.0, 0.0);
} }
} }
void TextUserInterface::setLongitude(double longitude) void TextUserInterface::setLongitude(double longitude)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( StelCore* core = StelApp::getInstance().getCore();
); if (core->getCurrentLocation().longitude != longitude)
if (nav->getCurrentLocation().longitude != longitude)
{ {
StelLocation newLocation = nav->getCurrentLocation(); StelLocation newLocation = core->getCurrentLocation();
newLocation.longitude = longitude; newLocation.longitude = longitude;
nav->moveObserverTo(newLocation, 0.0, 0.0); core->moveObserverTo(newLocation, 0.0, 0.0);
} }
} }
double TextUserInterface::getLatitude(void) double TextUserInterface::getLatitude(void)
{ {
return StelApp::getInstance().getCore()->getNavigator()->getCurrentL ocation().latitude; return StelApp::getInstance().getCore()->getCurrentLocation().latitu de;
} }
double TextUserInterface::getLongitude(void) double TextUserInterface::getLongitude(void)
{ {
return StelApp::getInstance().getCore()->getNavigator()->getCurrentL ocation().longitude; return StelApp::getInstance().getCore()->getCurrentLocation().longit ude;
} }
void TextUserInterface::setStartupDateMode(QString mode) void TextUserInterface::setStartupDateMode(QString mode)
{ {
StelApp::getInstance().getCore()->getNavigator()->setStartupTimeMode (mode); StelApp::getInstance().getCore()->setStartupTimeMode(mode);
} }
void TextUserInterface::setDateFormat(QString format) void TextUserInterface::setDateFormat(QString format)
{ {
StelApp::getInstance().getLocaleMgr().setDateFormatStr(format); StelApp::getInstance().getLocaleMgr().setDateFormatStr(format);
} }
void TextUserInterface::setTimeFormat(QString format) void TextUserInterface::setTimeFormat(QString format)
{ {
StelApp::getInstance().getLocaleMgr().setTimeFormatStr(format); StelApp::getInstance().getLocaleMgr().setTimeFormatStr(format);
skipping to change at line 553 skipping to change at line 552
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
Q_ASSERT(cmgr); Q_ASSERT(cmgr);
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
Q_ASSERT(smgr); Q_ASSERT(smgr);
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
Q_ASSERT(nmgr); Q_ASSERT(nmgr);
GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr); GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr);
Q_ASSERT(glmgr); Q_ASSERT(glmgr);
StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr); StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
Q_ASSERT(mvmgr); Q_ASSERT(mvmgr);
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( StelCore* core = StelApp::getInstance().getCore();
); Q_ASSERT(core);
Q_ASSERT(nav);
MilkyWay* milk = GETSTELMODULE(MilkyWay); MilkyWay* milk = GETSTELMODULE(MilkyWay);
Q_ASSERT(nav); Q_ASSERT(milk);
const StelProjectorP proj = StelApp::getInstance().getCore()->getPro const StelProjectorP proj = StelApp::getInstance().getCore()->getPro
jection(Mat4d()); jection(StelCore::FrameJ2000);
Q_ASSERT(proj); Q_ASSERT(proj);
StelLocaleMgr& lomgr = StelApp::getInstance().getLocaleMgr(); StelLocaleMgr& lomgr = StelApp::getInstance().getLocaleMgr();
// MENU ITEMS // MENU ITEMS
// sub-menu 1: location // sub-menu 1: location
// TODO // TODO
// sub-menu 2: date and time // sub-menu 2: date and time
conf->setValue("navigation/preset_sky_time", nav->getPresetSkyTime() conf->setValue("navigation/preset_sky_time", core->getPresetSkyTime(
); ));
conf->setValue("navigation/startup_time_mode", nav->getStartupTimeMo conf->setValue("navigation/startup_time_mode", core->getStartupTimeM
de()); ode());
conf->setValue("navigation/startup_time_mode", nav->getStartupTimeMo conf->setValue("navigation/startup_time_mode", core->getStartupTimeM
de()); ode());
conf->setValue("localization/time_display_format", lomgr.getTimeForm atStr()); conf->setValue("localization/time_display_format", lomgr.getTimeForm atStr());
conf->setValue("localization/date_display_format", lomgr.getDateForm atStr()); conf->setValue("localization/date_display_format", lomgr.getDateForm atStr());
// sub-menu 3: general // sub-menu 3: general
StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()); StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
QString langName = lomgr.getAppLanguage(); QString langName = lomgr.getAppLanguage();
conf->setValue("localization/app_locale", StelTranslator::nativeName ToIso639_1Code(langName)); conf->setValue("localization/app_locale", StelTranslator::nativeName ToIso639_1Code(langName));
langName = StelApp::getInstance().getLocaleMgr().getSkyLanguage(); langName = StelApp::getInstance().getLocaleMgr().getSkyLanguage();
conf->setValue("localization/sky_locale", StelTranslator::nativeName ToIso639_1Code(langName)); conf->setValue("localization/sky_locale", StelTranslator::nativeName ToIso639_1Code(langName));
 End of changes. 26 change blocks. 
43 lines changed or deleted 37 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/