ConfigurationDialog.cpp   ConfigurationDialog.cpp 
/* /*
*
* Stellarium * Stellarium
* Copyright (C) 2008 Fabien Chereau * Copyright (C) 2008 Fabien Chereau
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 92 skipping to change at line 91
void ConfigurationDialog::styleChanged() void ConfigurationDialog::styleChanged()
{ {
// Nothing for now // Nothing for now
} }
void ConfigurationDialog::createDialogContent() void ConfigurationDialog::createDialogContent()
{ {
const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(Mat4d()); const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(Mat4d());
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( ); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( );
StelMovementMgr* mvmgr = (StelMovementMgr*)GETSTELMODULE("StelMoveme StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
ntMgr"); StelGui* gui = GETSTELMODULE(StelGui);
StelGui* gui = (StelGui*)GETSTELMODULE("StelGui");
ui->setupUi(dialog); ui->setupUi(dialog);
// Set the main tab activated by default // Set the main tab activated by default
ui->configurationTabWidget->setCurrentIndex(0); ui->configurationTabWidget->setCurrentIndex(0);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
// Main tab // Main tab
// Fill the language list widget from the available list // Fill the language list widget from the available list
skipping to change at line 120 skipping to change at line 119
if (lt == -1 && appLang.contains('_')) if (lt == -1 && appLang.contains('_'))
{ {
l2 = appLang.left(appLang.indexOf('_')); l2 = appLang.left(appLang.indexOf('_'));
l2=StelTranslator::iso639_1CodeToNativeName(l2); l2=StelTranslator::iso639_1CodeToNativeName(l2);
lt = cb->findText(l2, Qt::MatchExactly); lt = cb->findText(l2, Qt::MatchExactly);
} }
if (lt!=-1) if (lt!=-1)
cb->setCurrentIndex(lt); cb->setCurrentIndex(lt);
connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( languageChanged(const QString&))); connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( languageChanged(const QString&)));
starSettings = ((StarMgr*)GETSTELMODULE("StarMgr"))->getStarSettings (); starSettings = GETSTELMODULE(StarMgr)->getStarSettings();
connect(ui->getStarsButton, SIGNAL(clicked(void)), this, SLOT(downlo adStars(void))); connect(ui->getStarsButton, SIGNAL(clicked(void)), this, SLOT(downlo adStars(void)));
connect(ui->downloadCancelButton, SIGNAL(clicked(void)), this, SLOT( cancelDownload(void))); connect(ui->downloadCancelButton, SIGNAL(clicked(void)), this, SLOT( cancelDownload(void)));
connect(ui->downloadRetryButton, SIGNAL(clicked(void)), this, SLOT(r etryDownload(void))); connect(ui->downloadRetryButton, SIGNAL(clicked(void)), this, SLOT(r etryDownload(void)));
checkUpdates(); checkUpdates();
// Selected object info // Selected object info
if (gui->getInfoPanel()->getInfoTextFilters() == (StelObject::InfoSt ringGroup)0) if (gui->getInfoPanel()->getInfoTextFilters() == (StelObject::InfoSt ringGroup)0)
ui->noSelectedInfoRadio->setChecked(true); ui->noSelectedInfoRadio->setChecked(true);
else if (gui->getInfoPanel()->getInfoTextFilters() == StelObject::In foStringGroup(StelObject::ShortInfo)) else if (gui->getInfoPanel()->getInfoTextFilters() == StelObject::In foStringGroup(StelObject::ShortInfo))
skipping to change at line 163 skipping to change at line 162
connect(ui->fixedDateTimeEdit, SIGNAL(dateTimeChanged(QDateTime)), n av, SLOT(setPresetSkyTime(QDateTime))); connect(ui->fixedDateTimeEdit, SIGNAL(dateTimeChanged(QDateTime)), n av, SLOT(setPresetSkyTime(QDateTime)));
ui->enableKeysNavigationCheckBox->setChecked(mvmgr->getFlagEnableMov eKeys() || mvmgr->getFlagEnableZoomKeys()); ui->enableKeysNavigationCheckBox->setChecked(mvmgr->getFlagEnableMov eKeys() || mvmgr->getFlagEnableZoomKeys());
ui->enableMouseNavigationCheckBox->setChecked(mvmgr->getFlagEnableMo useNavigation()); ui->enableMouseNavigationCheckBox->setChecked(mvmgr->getFlagEnableMo useNavigation());
connect(ui->enableKeysNavigationCheckBox, SIGNAL(toggled(bool)), mvm gr, SLOT(setFlagEnableMoveKeys(bool))); connect(ui->enableKeysNavigationCheckBox, SIGNAL(toggled(bool)), mvm gr, SLOT(setFlagEnableMoveKeys(bool)));
connect(ui->enableKeysNavigationCheckBox, SIGNAL(toggled(bool)), mvm gr, SLOT(setFlagEnableZoomKeys(bool))); connect(ui->enableKeysNavigationCheckBox, SIGNAL(toggled(bool)), mvm gr, SLOT(setFlagEnableZoomKeys(bool)));
connect(ui->enableMouseNavigationCheckBox, SIGNAL(toggled(bool)), mv mgr, SLOT(setFlagEnableMouseNavigation(bool))); connect(ui->enableMouseNavigationCheckBox, SIGNAL(toggled(bool)), mv mgr, SLOT(setFlagEnableMouseNavigation(bool)));
connect(ui->fixedDateTimeCurrentButton, SIGNAL(clicked()), this, SLO T(setFixedDateTimeToCurrent())); connect(ui->fixedDateTimeCurrentButton, SIGNAL(clicked()), this, SLO T(setFixedDateTimeToCurrent()));
// Tools tab // Tools tab
ConstellationMgr* cmgr = (ConstellationMgr*)GETSTELMODULE("Constella tionMgr"); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
Q_ASSERT(cmgr); Q_ASSERT(cmgr);
ui->sphericMirrorCheckbox->setChecked(StelAppGraphicsScene::getInsta nce().getViewPortDistorterType() == "fisheye_to_spheric_mirror"); ui->sphericMirrorCheckbox->setChecked(StelAppGraphicsScene::getInsta nce().getViewPortDistorterType() == "fisheye_to_spheric_mirror");
connect(ui->sphericMirrorCheckbox, SIGNAL(toggled(bool)), this, SLOT (setSphericMirror(bool))); connect(ui->sphericMirrorCheckbox, SIGNAL(toggled(bool)), this, SLOT (setSphericMirror(bool)));
ui->gravityLabelCheckbox->setChecked(proj->getFlagGravityLabels()); ui->gravityLabelCheckbox->setChecked(proj->getFlagGravityLabels());
connect(ui->gravityLabelCheckbox, SIGNAL(toggled(bool)), StelApp::ge tInstance().getCore(), SLOT(setFlagGravityLabels(bool))); connect(ui->gravityLabelCheckbox, SIGNAL(toggled(bool)), StelApp::ge tInstance().getCore(), SLOT(setFlagGravityLabels(bool)));
ui->selectSingleConstellationButton->setChecked(cmgr->getFlagIsolate Selected()); ui->selectSingleConstellationButton->setChecked(cmgr->getFlagIsolate Selected());
connect(ui->selectSingleConstellationButton, SIGNAL(toggled(bool)), cmgr, SLOT(setFlagIsolateSelected(bool))); connect(ui->selectSingleConstellationButton, SIGNAL(toggled(bool)), cmgr, SLOT(setFlagIsolateSelected(bool)));
ui->discViewportCheckbox->setChecked(proj->getMaskType() == StelProj ector::MaskDisk); ui->discViewportCheckbox->setChecked(proj->getMaskType() == StelProj ector::MaskDisk);
connect(ui->discViewportCheckbox, SIGNAL(toggled(bool)), this, SLOT( setDiskViewport(bool))); connect(ui->discViewportCheckbox, SIGNAL(toggled(bool)), this, SLOT( setDiskViewport(bool)));
ui->autoZoomResetsDirectionCheckbox->setChecked(mvmgr->getFlagAutoZo omOutResetsDirection()); ui->autoZoomResetsDirectionCheckbox->setChecked(mvmgr->getFlagAutoZo omOutResetsDirection());
skipping to change at line 256 skipping to change at line 255
void ConfigurationDialog::setSphericMirror(bool b) void ConfigurationDialog::setSphericMirror(bool b)
{ {
if (b) if (b)
StelAppGraphicsScene::getInstance().setViewPortDistorterType ("fisheye_to_spheric_mirror"); StelAppGraphicsScene::getInstance().setViewPortDistorterType ("fisheye_to_spheric_mirror");
else else
StelAppGraphicsScene::getInstance().setViewPortDistorterType ("none"); StelAppGraphicsScene::getInstance().setViewPortDistorterType ("none");
} }
void ConfigurationDialog::setNoSelectedInfo(void) void ConfigurationDialog::setNoSelectedInfo(void)
{ {
StelGui* newGui = (StelGui*)GETSTELMODULE("StelGui"); StelGui* newGui = GETSTELMODULE(StelGui);
Q_ASSERT(newGui); Q_ASSERT(newGui);
newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(0)); newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(0));
} }
void ConfigurationDialog::setAllSelectedInfo(void) void ConfigurationDialog::setAllSelectedInfo(void)
{ {
StelGui* newGui = (StelGui*)GETSTELMODULE("StelGui"); StelGui* newGui = GETSTELMODULE(StelGui);
Q_ASSERT(newGui); Q_ASSERT(newGui);
newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(StelObject::AllInfo)); newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(StelObject::AllInfo));
} }
void ConfigurationDialog::setBriefSelectedInfo(void) void ConfigurationDialog::setBriefSelectedInfo(void)
{ {
StelGui* newGui = (StelGui*)GETSTELMODULE("StelGui"); StelGui* newGui = GETSTELMODULE(StelGui);
Q_ASSERT(newGui); Q_ASSERT(newGui);
newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(StelObject::ShortInfo)); newGui->getInfoPanel()->setInfoTextFilters(StelObject::InfoStringGro up(StelObject::ShortInfo));
} }
void ConfigurationDialog::cursorTimeOutChanged() void ConfigurationDialog::cursorTimeOutChanged()
{ {
StelAppGraphicsScene::getInstance().setFlagCursorTimeout(ui->mouseTi meoutCheckbox->isChecked()); StelAppGraphicsScene::getInstance().setFlagCursorTimeout(ui->mouseTi meoutCheckbox->isChecked());
StelAppGraphicsScene::getInstance().setCursorTimeout(ui->mouseTimeou tSpinBox->value()); StelAppGraphicsScene::getInstance().setCursorTimeout(ui->mouseTimeou tSpinBox->value());
} }
skipping to change at line 315 skipping to change at line 314
} }
} }
// Save the current viewing option including landscape, location and sky cu lture // Save the current viewing option including landscape, location and sky cu lture
// This doesn't include the current viewing direction, time and FOV since t hose have specific controls // This doesn't include the current viewing direction, time and FOV since t hose have specific controls
void ConfigurationDialog::saveCurrentViewOptions() void ConfigurationDialog::saveCurrentViewOptions()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
LandscapeMgr* lmgr = (LandscapeMgr*)GETSTELMODULE("LandscapeMgr"); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
Q_ASSERT(lmgr); Q_ASSERT(lmgr);
SolarSystem* ssmgr = (SolarSystem*)GETSTELMODULE("SolarSystem"); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
Q_ASSERT(ssmgr); Q_ASSERT(ssmgr);
MeteorMgr* mmgr = (MeteorMgr*)GETSTELMODULE("MeteorMgr"); MeteorMgr* mmgr = GETSTELMODULE(MeteorMgr);
Q_ASSERT(mmgr); Q_ASSERT(mmgr);
StelSkyDrawer* skyd = StelApp::getInstance().getCore()->getSkyDrawer (); StelSkyDrawer* skyd = StelApp::getInstance().getCore()->getSkyDrawer ();
Q_ASSERT(skyd); Q_ASSERT(skyd);
ConstellationMgr* cmgr = (ConstellationMgr*)GETSTELMODULE("Constella tionMgr"); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
Q_ASSERT(cmgr); Q_ASSERT(cmgr);
StarMgr* smgr = (StarMgr*)GETSTELMODULE("StarMgr"); StarMgr* smgr = GETSTELMODULE(StarMgr);
Q_ASSERT(smgr); Q_ASSERT(smgr);
NebulaMgr* nmgr = (NebulaMgr*)GETSTELMODULE("NebulaMgr"); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
Q_ASSERT(nmgr); Q_ASSERT(nmgr);
GridLinesMgr* glmgr = (GridLinesMgr*)GETSTELMODULE("GridLinesMgr"); GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr);
Q_ASSERT(glmgr); Q_ASSERT(glmgr);
StelGui* gui = (StelGui*)GETSTELMODULE("StelGui"); StelGui* gui = GETSTELMODULE(StelGui);
Q_ASSERT(gui); Q_ASSERT(gui);
StelMovementMgr* mvmgr = (StelMovementMgr*)GETSTELMODULE("StelMoveme ntMgr"); StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
Q_ASSERT(mvmgr); Q_ASSERT(mvmgr);
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( ); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( );
Q_ASSERT(nav); Q_ASSERT(nav);
const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(Mat4d()); const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(Mat4d());
Q_ASSERT(proj); Q_ASSERT(proj);
// view dialog / sky tab settings // view dialog / sky tab settings
conf->setValue("stars/absolute_scale", skyd->getAbsoluteStarScale()) ; conf->setValue("stars/absolute_scale", skyd->getAbsoluteStarScale()) ;
conf->setValue("stars/relative_scale", skyd->getRelativeStarScale()) ; conf->setValue("stars/relative_scale", skyd->getRelativeStarScale()) ;
conf->setValue("stars/flag_star_twinkle", skyd->getFlagTwinkle()); conf->setValue("stars/flag_star_twinkle", skyd->getFlagTwinkle());
 End of changes. 16 change blocks. 
18 lines changed or deleted 16 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/