TextUserInterface.cpp   TextUserInterface.cpp 
skipping to change at line 104 skipping to change at line 104
/************************************************************************* /*************************************************************************
Constructor Constructor
*************************************************************************/ *************************************************************************/
TextUserInterface::TextUserInterface() TextUserInterface::TextUserInterface()
: dummyDialog(this) : dummyDialog(this)
, tuiActive(false) , tuiActive(false)
, tuiDateTime(false) , tuiDateTime(false)
, tuiObjInfo(false) , tuiObjInfo(false)
, tuiGravityUi(false) , tuiGravityUi(false)
, currentNode(NULL) , currentNode(Q_NULLPTR)
{ {
setObjectName("TextUserInterface"); setObjectName("TextUserInterface");
} }
/************************************************************************* /*************************************************************************
Destructor Destructor
*************************************************************************/ *************************************************************************/
TextUserInterface::~TextUserInterface() TextUserInterface::~TextUserInterface()
{ {
} }
skipping to change at line 169 skipping to change at line 169
solarSystem->getAllPlanetEnglishName s(), solarSystem->getAllPlanetEnglishName s(),
core->getCurrentLocation().planetNam e, core->getCurrentLocation().planetNam e,
m1, m1_3); m1, m1_3);
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_1->loopToTheLast(); m1_1->loopToTheLast();
m1->setChildNode(m1_1); m1->setChildNode(m1_1);
TuiNode* m2 = new TuiNode(N_("Date and Time"), NULL, m1); TuiNode* m2 = new TuiNode(N_("Date and Time"), Q_NULLPTR, m1);
m2->setParent(this); m2->setParent(this);
m1->setNextNode(m2); m1->setNextNode(m2);
TuiNode* m2_1 = new TuiNodeDateTime(N_("Current date/time"), TuiNode* m2_1 = new TuiNodeDateTime(N_("Current date/time"),
core, core,
SLOT(setJD(double)), SLOT(setJD(double)),
core->getJD(), core->getJD(),
m2); m2);
TuiNode* m2_2 = new TuiNode(N_("Set time zone"), m2, m2_1); // GZ Th is is inactive(?) TuiNode* m2_2 = new TuiNode(N_("Set time zone"), m2, m2_1); // GZ Th is is inactive(?)
TuiNode* m2_3 = new TuiNode(N_("Day keys"), m2, m2_2); // GZ Th is is inactive(?) TuiNode* m2_3 = new TuiNode(N_("Day keys"), m2, m2_2); // GZ Th is is inactive(?)
TuiNode* m2_4 = new TuiNodeDateTime(N_("Startup date/time preset"), TuiNode* m2_4 = new TuiNodeDateTime(N_("Startup date/time preset"),
skipping to change at line 223 skipping to change at line 223
m2_1->setNextNode(m2_2); m2_1->setNextNode(m2_2);
m2_2->setNextNode(m2_3); m2_2->setNextNode(m2_3);
m2_3->setNextNode(m2_4); m2_3->setNextNode(m2_4);
m2_4->setNextNode(m2_5); m2_4->setNextNode(m2_5);
m2_5->setNextNode(m2_6); m2_5->setNextNode(m2_6);
m2_6->setNextNode(m2_7); m2_6->setNextNode(m2_7);
m2_7->setNextNode(m2_1); m2_7->setNextNode(m2_1);
m2_1->loopToTheLast(); m2_1->loopToTheLast();
m2->setChildNode(m2_1); m2->setChildNode(m2_1);
TuiNode* m3 = new TuiNode(N_("General"), NULL, m2); TuiNode* m3 = new TuiNode(N_("General"), Q_NULLPTR, m2);
m3->setParent(this); m3->setParent(this);
m2->setNextNode(m3); m2->setNextNode(m3);
StelSkyCultureMgr& skyCultureMgr = StelApp::getInstance().getSkyCult ureMgr(); StelSkyCultureMgr& skyCultureMgr = StelApp::getInstance().getSkyCult ureMgr();
TuiNode* m3_1 = new TuiNodeEnum(N_("Starlore"), TuiNode* m3_1 = new TuiNodeEnum(N_("Starlore"),
this, this,
SLOT(setSkyCulture(QString)), SLOT(setSkyCulture(QString)),
skyCultureMgr.getSkyCultureListI18() , skyCultureMgr.getSkyCultureListI18() ,
skyCultureMgr.getCurrentSkyCultureNa meI18(), skyCultureMgr.getCurrentSkyCultureNa meI18(),
m3); m3);
TuiNode* m3_2 = new TuiNodeEnum(N_("Sky Language"), TuiNode* m3_2 = new TuiNodeEnum(N_("Sky Language"),
skipping to change at line 251 skipping to change at line 251
SLOT(setAppLanguage(QString)), SLOT(setAppLanguage(QString)),
StelTranslator::globalTranslator->ge tAvailableLanguagesNamesNative(StelFileMgr::getLocaleDir()), StelTranslator::globalTranslator->ge tAvailableLanguagesNamesNative(StelFileMgr::getLocaleDir()),
StelTranslator::iso639_1CodeToNative Name(localeMgr.getAppLanguage()), StelTranslator::iso639_1CodeToNative Name(localeMgr.getAppLanguage()),
m3, m3_1); m3, m3_1);
m3_1->setNextNode(m3_2); m3_1->setNextNode(m3_2);
m3_2->setNextNode(m3_3); m3_2->setNextNode(m3_3);
m3_3->setNextNode(m3_1); m3_3->setNextNode(m3_1);
m3_1->loopToTheLast(); m3_1->loopToTheLast();
m3->setChildNode(m3_1); m3->setChildNode(m3_1);
TuiNode* m4 = new TuiNode(N_("Stars"), NULL, m3); TuiNode* m4 = new TuiNode(N_("Stars"), Q_NULLPTR, m3);
m4->setParent(this); m4->setParent(this);
m3->setNextNode(m4); m3->setNextNode(m4);
StarMgr* starMgr = GETSTELMODULE(StarMgr); StarMgr* starMgr = GETSTELMODULE(StarMgr);
TuiNode* m4_1 = new TuiNodeBool(N_("Show stars"), TuiNode* m4_1 = new TuiNodeBool(N_("Show stars"),
starMgr, SLOT(setFlagStars(bool)), starMgr, SLOT(setFlagStars(bool)),
starMgr->getFlagStars(), m4); starMgr->getFlagStars(), m4);
StelSkyDrawer* skyDrawer = core->getSkyDrawer(); StelSkyDrawer* skyDrawer = core->getSkyDrawer();
TuiNode* m4_2 = new TuiNodeDouble(N_("Relative scale:"), TuiNode* m4_2 = new TuiNodeDouble(N_("Relative scale:"),
skyDrawer, skyDrawer,
SLOT(setRelativeStarScale(double)) , SLOT(setRelativeStarScale(double)) ,
skipping to change at line 283 skipping to change at line 283
skyDrawer->getTwinkleAmount(), skyDrawer->getTwinkleAmount(),
0.0, 1.5, 0.1, 0.0, 1.5, 0.1,
m4, m4_3); m4, m4_3);
m4_1->setNextNode(m4_2); m4_1->setNextNode(m4_2);
m4_2->setNextNode(m4_3); m4_2->setNextNode(m4_3);
m4_3->setNextNode(m4_4); m4_3->setNextNode(m4_4);
m4_4->setNextNode(m4_1); m4_4->setNextNode(m4_1);
m4_1->loopToTheLast(); m4_1->loopToTheLast();
m4->setChildNode(m4_1); m4->setChildNode(m4_1);
TuiNode* m5 = new TuiNode(N_("Colors"), NULL, m4); TuiNode* m5 = new TuiNode(N_("Colors"), Q_NULLPTR, m4);
m5->setParent(this); m5->setParent(this);
m4->setNextNode(m5); m4->setNextNode(m5);
ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr) ; ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr) ;
TuiNode* m5_1 = new TuiNodeColor(N_("Constellation lines"), TuiNode* m5_1 = new TuiNodeColor(N_("Constellation lines"),
constellationMgr, constellationMgr,
SLOT(setLinesColor(Vec3f)), SLOT(setLinesColor(Vec3f)),
constellationMgr->getLinesColor(), constellationMgr->getLinesColor(),
m5); m5);
TuiNode* m5_2 = new TuiNodeColor(N_("Constellation labels"), TuiNode* m5_2 = new TuiNodeColor(N_("Constellation labels"),
constellationMgr, constellationMgr,
skipping to change at line 438 skipping to change at line 438
m5_19->setNextNode(m5_20); m5_19->setNextNode(m5_20);
m5_20->setNextNode(m5_21); m5_20->setNextNode(m5_21);
m5_21->setNextNode(m5_22); m5_21->setNextNode(m5_22);
m5_22->setNextNode(m5_23); m5_22->setNextNode(m5_23);
m5_23->setNextNode(m5_24); m5_23->setNextNode(m5_24);
m5_24->setNextNode(m5_25); m5_24->setNextNode(m5_25);
m5_25->setNextNode(m5_1); m5_25->setNextNode(m5_1);
m5_1->loopToTheLast(); m5_1->loopToTheLast();
m5->setChildNode(m5_1); m5->setChildNode(m5_1);
TuiNode* m6 = new TuiNode(N_("Effects"), NULL, m5); TuiNode* m6 = new TuiNode(N_("Effects"), Q_NULLPTR, m5);
m6->setParent(this); m6->setParent(this);
m5->setNextNode(m6); m5->setNextNode(m6);
TuiNode* m6_1 = new TuiNodeInt(N_("Light pollution:"), TuiNode* m6_1 = new TuiNodeInt(N_("Light pollution:"),
skyDrawer, skyDrawer,
SLOT(setBortleScaleIndex(int)), SLOT(setBortleScaleIndex(int)),
skyDrawer->getBortleScaleIndex(), 1, 9, 1, skyDrawer->getBortleScaleIndex(), 1, 9, 1,
m6); m6);
TuiNode* m6_2 = new TuiNodeEnum(N_("Landscape"), TuiNode* m6_2 = new TuiNodeEnum(N_("Landscape"),
landscapeMgr, landscapeMgr,
SLOT(setCurrentLandscapeName(QString )), SLOT(setCurrentLandscapeName(QString )),
skipping to change at line 492 skipping to change at line 492
m6_2->setNextNode(m6_3); m6_2->setNextNode(m6_3);
m6_3->setNextNode(m6_4); m6_3->setNextNode(m6_4);
m6_4->setNextNode(m6_5); m6_4->setNextNode(m6_5);
m6_5->setNextNode(m6_6); m6_5->setNextNode(m6_6);
m6_6->setNextNode(m6_7); m6_6->setNextNode(m6_7);
m6_7->setNextNode(m6_1); m6_7->setNextNode(m6_1);
m6_1->loopToTheLast(); m6_1->loopToTheLast();
m6->setChildNode(m6_1); m6->setChildNode(m6_1);
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
TuiNode* m7 = new TuiNode(N_("Scripts"), NULL, m6); TuiNode* m7 = new TuiNode(N_("Scripts"), Q_NULLPTR, m6);
m7->setParent(this); m7->setParent(this);
m6->setNextNode(m7); m6->setNextNode(m7);
StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr(); StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr();
TuiNode* m7_1 = new TuiNodeEnum(N_("Run local script"), TuiNode* m7_1 = new TuiNodeEnum(N_("Run local script"),
&scriptMgr, &scriptMgr,
SLOT(runScript(QString)), SLOT(runScript(QString)),
scriptMgr.getScriptList(), scriptMgr.getScriptList(),
"", "",
m7); m7);
TuiNode* m7_2 = new TuiNodeActivate(N_("Stop running script"), TuiNode* m7_2 = new TuiNodeActivate(N_("Stop running script"),
&scriptMgr, SLOT(stopScript()), &scriptMgr, SLOT(stopScript()),
m7, m7_1); m7, m7_1);
// TuiNode* m7_3 = new TuiNode(N_("CD/DVD script"), m7, m7_2); // Dead node. // TuiNode* m7_3 = new TuiNode(N_("CD/DVD script"), m7, m7_2); // Dead node.
m7_1->setNextNode(m7_2); m7_1->setNextNode(m7_2);
m7_2->setNextNode(m7_1); m7_2->setNextNode(m7_1);
// m7_3->setNextNode(m7_1); // m7_3->setNextNode(m7_1);
m7_1->loopToTheLast(); m7_1->loopToTheLast();
m7->setChildNode(m7_1); m7->setChildNode(m7_1);
TuiNode* m8 = new TuiNode(N_("Administration"), NULL, m7); TuiNode* m8 = new TuiNode(N_("Administration"), Q_NULLPTR, m7);
m8->setParent(this); m8->setParent(this);
m7->setNextNode(m8); m7->setNextNode(m8);
#else #else
TuiNode* m8 = new TuiNode(N_("Administration"), NULL, m6); TuiNode* m8 = new TuiNode(N_("Administration"), Q_NULLPTR, m6);
m8->setParent(this); m8->setParent(this);
m6->setNextNode(m8); m6->setNextNode(m8);
#endif #endif
m8->setNextNode(m1); m8->setNextNode(m1);
m1->loopToTheLast(); m1->loopToTheLast();
TuiNode* m8_1 = new TuiNode(N_("Load default configuration"), m8); TuiNode* m8_1 = new TuiNode(N_("Load default configuration"), m8);
TuiNode* m8_2 = new TuiNodeActivate(N_("Save current configuration") , TuiNode* m8_2 = new TuiNodeActivate(N_("Save current configuration") ,
this, SLOT(saveDefaultSettings() ), this, SLOT(saveDefaultSettings() ),
m8, m8_1); m8, m8_1);
TuiNode* m8_3 = new TuiNodeActivate(N_("Shut down"), this, SLOT(shut Down()), TuiNode* m8_3 = new TuiNodeActivate(N_("Shut down"), this, SLOT(shut Down()),
skipping to change at line 567 skipping to change at line 567
if (!tuiActive && !tuiDateTime && !tuiObjInfo) if (!tuiActive && !tuiDateTime && !tuiObjInfo)
return; return;
int x = 0, y = 0; int x = 0, y = 0;
int xVc = 0, yVc = 0; int xVc = 0, yVc = 0;
int pixOffset = 15; int pixOffset = 15;
int fovOffsetX = 0, fovOffsetY=0; int fovOffsetX = 0, fovOffsetY=0;
bool fovMaskDisk = false; bool fovMaskDisk = false;
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
if (gui!=NULL) if (gui!=Q_NULLPTR)
{ {
if (gui->getVisible()) if (gui->getVisible())
{ {
QGraphicsItem* bottomBar = dynamic_cast<QGraphicsIte m*>(gui->getButtonBar()); QGraphicsItem* bottomBar = dynamic_cast<QGraphicsIte m*>(gui->getButtonBar());
LeftStelBar* sideBar = gui->getWindowsButtonBar(); LeftStelBar* sideBar = gui->getWindowsButtonBar();
x = (sideBar) ? sideBar->boundingRectNoHelpLabel().r ight() : 50; x = (sideBar) ? sideBar->boundingRectNoHelpLabel().r ight() : 50;
y = (bottomBar) ? bottomBar->boundingRect().height() : 50; y = (bottomBar) ? bottomBar->boundingRect().height() : 50;
} }
} }
skipping to change at line 602 skipping to change at line 602
if (tuiActive) if (tuiActive)
{ {
int text_x = x + pixOffset, text_y = y + pixOffset; int text_x = x + pixOffset, text_y = y + pixOffset;
if (fovMaskDisk) { if (fovMaskDisk) {
text_x = xVc - fovOffsetX + pixOffset; text_x = xVc - fovOffsetX + pixOffset;
text_y = yVc - fovOffsetY + pixOffset; text_y = yVc - fovOffsetY + pixOffset;
} }
QString tuiText = q_("[no TUI node]"); QString tuiText = q_("[no TUI node]");
if (currentNode!=NULL) { if (currentNode!=Q_NULLPTR) {
tuiText = currentNode->getDisplayText(); tuiText = currentNode->getDisplayText();
} }
StelPainter painter(core->getProjection(StelCore::FrameJ2000 )); StelPainter painter(core->getProjection(StelCore::FrameJ2000 ));
painter.setFont(font); painter.setFont(font);
painter.setColor(color[0],color[1],color[2]); painter.setColor(color[0],color[1],color[2]);
painter.drawText(text_x, text_y, tuiText, 0, 0, 0, !tuiGravi tyUi); painter.drawText(text_x, text_y, tuiText, 0, 0, 0, !tuiGravi tyUi);
} }
if (tuiDateTime) if (tuiDateTime)
skipping to change at line 662 skipping to change at line 662
StelPainter painter(core->getProjection(StelCore::FrameJ2000 )); StelPainter painter(core->getProjection(StelCore::FrameJ2000 ));
painter.setFont(font); painter.setFont(font);
painter.setColor(color[0],color[1],color[2]); painter.setColor(color[0],color[1],color[2]);
painter.drawText(text_x, text_y, objInfo, 0, 0, 0, !tuiGravi tyUi); painter.drawText(text_x, text_y, objInfo, 0, 0, 0, !tuiGravi tyUi);
} }
} }
void TextUserInterface::handleKeys(QKeyEvent* event) void TextUserInterface::handleKeys(QKeyEvent* event)
{ {
if (currentNode == NULL) if (currentNode == Q_NULLPTR)
{ {
qWarning() << "WARNING: no current node in TextUserInterface plugin"; qWarning() << "WARNING: no current node in TextUserInterface plugin";
event->setAccepted(false); event->setAccepted(false);
return; return;
} }
if (event->type()==QEvent::KeyPress && (event->modifiers() & Qt::Alt Modifier) && event->key()==Qt::Key_T) if (event->type()==QEvent::KeyPress && (event->modifiers() & Qt::Alt Modifier) && event->key()==Qt::Key_T)
{ {
tuiActive = ! tuiActive; tuiActive = ! tuiActive;
dummyDialog.close(); dummyDialog.close();
 End of changes. 12 change blocks. 
12 lines changed or deleted 12 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/