ViewDialog.cpp   ViewDialog.cpp 
skipping to change at line 38 skipping to change at line 38
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelSkyLayerMgr.hpp"
#include "StelGuiBase.hpp"
#include <QDebug> #include <QDebug>
#include <QFrame> #include <QFrame>
#include <QFile> #include <QFile>
#include <QSettings> #include <QSettings>
#include <QTimer> #include <QTimer>
#include "StelMainGraphicsView.hpp"
#include <QDialog> #include <QDialog>
ViewDialog::ViewDialog() ViewDialog::ViewDialog()
{ {
ui = new Ui_viewDialogForm; ui = new Ui_viewDialogForm;
} }
ViewDialog::~ViewDialog() ViewDialog::~ViewDialog()
{ {
delete ui; delete ui;
skipping to change at line 82 skipping to change at line 82
{ {
populateLists(); populateLists();
} }
} }
void ViewDialog::createDialogContent() void ViewDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
// Set the Sky tab activated by default // Set the Sky tab activated by default
ui->viewTabWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
ui->stackListWidget->setCurrentRow(0);
ui->viewTabWidget->removeTab(4); //ui->viewTabWidget->removeTab(4);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
populateLists(); populateLists();
connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyCultureChanged(const QString&))); connect(ui->culturesListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyCultureChanged(const QString&)));
connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS tring&)), this, SLOT(projectionChanged(const QString&))); connect(ui->projectionListWidget, SIGNAL(currentTextChanged(const QS tring&)), this, SLOT(projectionChanged(const QString&)));
connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(landscapeChanged(QListWidgetItem*))); connect(ui->landscapesListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(landscapeChanged(QListWidgetItem*)));
// Connect and initialize checkboxes and other widgets // Connect and initialize checkboxes and other widgets
skipping to change at line 153 skipping to change at line 154
connect(ui->zhr10, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha nged())); connect(ui->zhr10, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha nged()));
connect(ui->zhr80, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha nged())); connect(ui->zhr80, SIGNAL(clicked()), this, SLOT(shootingStarsZHRCha nged()));
connect(ui->zhr10000, SIGNAL(clicked()), this, SLOT(shootingStarsZHR Changed())); connect(ui->zhr10000, SIGNAL(clicked()), this, SLOT(shootingStarsZHR Changed()));
connect(ui->zhr144000, SIGNAL(clicked()), this, SLOT(shootingStarsZH RChanged())); connect(ui->zhr144000, SIGNAL(clicked()), this, SLOT(shootingStarsZH RChanged()));
// Labels section // Labels section
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
ui->starLabelCheckBox->setChecked(smgr->getFlagLabels()); ui->starLabelCheckBox->setChecked(smgr->getFlagLabels());
connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(set FlagLabels(bool))); connect(ui->starLabelCheckBox, SIGNAL(toggled(bool)), smgr, SLOT(set FlagLabels(bool)));
StelGuiBase* gui = StelApp::getInstance().getGui();
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
ui->nebulaLabelCheckBox->setChecked(nmgr->getFlagHints()); ui->nebulaLabelCheckBox->setChecked(nmgr->getFlagHints());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Nebulas"); a = gui->getGuiActions("actionShow_Nebulas");
connect(a, SIGNAL(toggled(bool)), ui->nebulaLabelCheckBox, SLOT(setC hecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->nebulaLabelCheckBox, SLOT(setC hecked(bool)));
connect(ui->nebulaLabelCheckBox, SIGNAL(toggled(bool)), a, SLOT(setC hecked(bool))); connect(ui->nebulaLabelCheckBox, SIGNAL(toggled(bool)), a, SLOT(setC hecked(bool)));
ui->planetLabelCheckBox->setChecked(ssmgr->getFlagLabels()); ui->planetLabelCheckBox->setChecked(ssmgr->getFlagLabels());
connect(ui->planetLabelCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT( setFlagLabels(bool))); connect(ui->planetLabelCheckBox, SIGNAL(toggled(bool)), ssmgr, SLOT( setFlagLabels(bool)));
ui->starsLabelsHorizontalSlider->setValue((int)(smgr->getLabelsAmoun t()*10.f)); ui->starsLabelsHorizontalSlider->setValue((int)(smgr->getLabelsAmoun t()*10.f));
connect(ui->starsLabelsHorizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(starsLabelsValueChanged(int))); connect(ui->starsLabelsHorizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(starsLabelsValueChanged(int)));
ui->planetsLabelsHorizontalSlider->setValue((int)(ssmgr->getLabelsAm ount()*10.f)); ui->planetsLabelsHorizontalSlider->setValue((int)(ssmgr->getLabelsAm ount()*10.f));
connect(ui->planetsLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(planetsLabelsValueChanged(int))); connect(ui->planetsLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(planetsLabelsValueChanged(int)));
ui->nebulasLabelsHorizontalSlider->setValue((int)(nmgr->getHintsAmou nt()*10.f)); ui->nebulasLabelsHorizontalSlider->setValue((int)(nmgr->getHintsAmou nt()*10.f));
connect(ui->nebulasLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(nebulasLabelsValueChanged(int))); connect(ui->nebulasLabelsHorizontalSlider, SIGNAL(valueChanged(int)) , this, SLOT(nebulasLabelsValueChanged(int)));
// Landscape section // Landscape section
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
ui->showGroundCheckBox->setChecked(lmgr->getFlagLandscape()); ui->showGroundCheckBox->setChecked(lmgr->getFlagLandscape());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Ground"); a = gui->getGuiActions("actionShow_Ground");
connect(a, SIGNAL(toggled(bool)), ui->showGroundCheckBox, SLOT(setCh ecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showGroundCheckBox, SLOT(setCh ecked(bool)));
connect(ui->showGroundCheckBox, SIGNAL(toggled(bool)), a, SLOT(setCh ecked(bool))); connect(ui->showGroundCheckBox, SIGNAL(toggled(bool)), a, SLOT(setCh ecked(bool)));
ui->showFogCheckBox->setChecked(lmgr->getFlagFog()); ui->showFogCheckBox->setChecked(lmgr->getFlagFog());
connect(ui->showFogCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFl agFog(bool))); connect(ui->showFogCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFl agFog(bool)));
ui->showAtmosphereCheckBox->setChecked(lmgr->getFlagAtmosphere()); ui->showAtmosphereCheckBox->setChecked(lmgr->getFlagAtmosphere());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Atmosphere"); a = gui->getGuiActions("actionShow_Atmosphere");
connect(a, SIGNAL(toggled(bool)), ui->showAtmosphereCheckBox, SLOT(s etChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showAtmosphereCheckBox, SLOT(s etChecked(bool)));
connect(ui->showAtmosphereCheckBox, SIGNAL(toggled(bool)), a, SLOT(s etChecked(bool))); connect(ui->showAtmosphereCheckBox, SIGNAL(toggled(bool)), a, SLOT(s etChecked(bool)));
ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSets Location()); ui->landscapePositionCheckBox->setChecked(lmgr->getFlagLandscapeSets Location());
connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFlagLandscapeSetsLocation(bool))); connect(ui->landscapePositionCheckBox, SIGNAL(toggled(bool)), lmgr, SLOT(setFlagLandscapeSetsLocation(bool)));
ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore() ->getSkyDrawer()->getBortleScale()); ui->lightPollutionSpinBox->setValue(StelApp::getInstance().getCore() ->getSkyDrawer()->getBortleScale());
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), lmgr, SLOT(setAtmosphereBortleLightPollution(int))); connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), lmgr, SLOT(setAtmosphereBortleLightPollution(int)));
connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), StelAp p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScale(int))); connect(ui->lightPollutionSpinBox, SIGNAL(valueChanged(int)), StelAp p::getInstance().getCore()->getSkyDrawer(), SLOT(setBortleScale(int)));
ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getCurrentLandsc apeID()==lmgr->getDefaultLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setChecked(lmgr->getCurrentLandsc apeID()==lmgr->getDefaultLandscapeID());
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID());
connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault())); connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault()));
// Grid and lines // Grid and lines
GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr); GridLinesMgr* glmgr = GETSTELMODULE(GridLinesMgr);
ui->showEquatorLineCheckBox->setChecked(glmgr->getFlagEquatorLine()) ; ui->showEquatorLineCheckBox->setChecked(glmgr->getFlagEquatorLine()) ;
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Equator_Line"); a = gui->getGuiActions("actionShow_Equator_Line");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorLineCheckBox, SLOT( setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEquatorLineCheckBox, SLOT( setChecked(bool)));
connect(ui->showEquatorLineCheckBox, SIGNAL(toggled(bool)), a, SLOT( setChecked(bool))); connect(ui->showEquatorLineCheckBox, SIGNAL(toggled(bool)), a, SLOT( setChecked(bool)));
ui->showEclipticLineCheckBox->setChecked(glmgr->getFlagEclipticLine( )); ui->showEclipticLineCheckBox->setChecked(glmgr->getFlagEclipticLine( ));
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Ecliptic_Line"); a = gui->getGuiActions("actionShow_Ecliptic_Line");
connect(a, SIGNAL(toggled(bool)), ui->showEclipticLineCheckBox, SLOT (setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEclipticLineCheckBox, SLOT (setChecked(bool)));
connect(ui->showEclipticLineCheckBox, SIGNAL(toggled(bool)), a, SLOT (setChecked(bool))); connect(ui->showEclipticLineCheckBox, SIGNAL(toggled(bool)), a, SLOT (setChecked(bool)));
ui->showMeridianLineCheckBox->setChecked(glmgr->getFlagMeridianLine( )); ui->showMeridianLineCheckBox->setChecked(glmgr->getFlagMeridianLine( ));
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Meridian_Line"); a = gui->getGuiActions("actionShow_Meridian_Line");
connect(a, SIGNAL(toggled(bool)), ui->showMeridianLineCheckBox, SLOT (setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showMeridianLineCheckBox, SLOT (setChecked(bool)));
connect(ui->showMeridianLineCheckBox, SIGNAL(toggled(bool)), a, SLOT (setChecked(bool))); connect(ui->showMeridianLineCheckBox, SIGNAL(toggled(bool)), a, SLOT (setChecked(bool)));
ui->showEquatorialGridCheckBox->setChecked(glmgr->getFlagEquatorGrid ()); ui->showEquatorialGridCheckBox->setChecked(glmgr->getFlagEquatorGrid ());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Equatorial_Grid"); a = gui->getGuiActions("actionShow_Equatorial_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialGridCheckBox, SL OT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEquatorialGridCheckBox, SL OT(setChecked(bool)));
connect(ui->showEquatorialGridCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool))); connect(ui->showEquatorialGridCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool)));
ui->showAzimuthalGridCheckBox->setChecked(glmgr->getFlagAzimuthalGri d()); ui->showAzimuthalGridCheckBox->setChecked(glmgr->getFlagAzimuthalGri d());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Azimuthal_Grid"); a = gui->getGuiActions("actionShow_Azimuthal_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showAzimuthalGridCheckBox, SLO T(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showAzimuthalGridCheckBox, SLO T(setChecked(bool)));
connect(ui->showAzimuthalGridCheckBox, SIGNAL(toggled(bool)), a, SLO T(setChecked(bool))); connect(ui->showAzimuthalGridCheckBox, SIGNAL(toggled(bool)), a, SLO T(setChecked(bool)));
ui->showEquatorialJ2000GridCheckBox->setChecked(glmgr->getFlagEquato rJ2000Grid()); ui->showEquatorialJ2000GridCheckBox->setChecked(glmgr->getFlagEquato rJ2000Grid());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Equatorial_J2000_Grid"); a = gui->getGuiActions("actionShow_Equatorial_J2000_Grid");
connect(a, SIGNAL(toggled(bool)), ui->showEquatorialJ2000GridCheckBo x, SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showEquatorialJ2000GridCheckBo x, SLOT(setChecked(bool)));
connect(ui->showEquatorialJ2000GridCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool))); connect(ui->showEquatorialJ2000GridCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool)));
ui->showCardinalPointsCheckBox->setChecked(lmgr->getFlagCardinalsPoi nts()); ui->showCardinalPointsCheckBox->setChecked(lmgr->getFlagCardinalsPoi nts());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Cardinal_Points"); a = gui->getGuiActions("actionShow_Cardinal_Points");
connect(a, SIGNAL(toggled(bool)), ui->showCardinalPointsCheckBox, SL OT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showCardinalPointsCheckBox, SL OT(setChecked(bool)));
connect(ui->showCardinalPointsCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool))); connect(ui->showCardinalPointsCheckBox, SIGNAL(toggled(bool)), a, SL OT(setChecked(bool)));
// Constellations // Constellations
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
ui->showConstellationLinesCheckBox->setChecked(cmgr->getFlagLines()) ; ui->showConstellationLinesCheckBox->setChecked(cmgr->getFlagLines()) ;
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Constellation_Lines"); a = gui->getGuiActions("actionShow_Constellation_Lines");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationLinesCheckBox , SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showConstellationLinesCheckBox , SLOT(setChecked(bool)));
connect(ui->showConstellationLinesCheckBox, SIGNAL(toggled(bool)), a , SLOT(setChecked(bool))); connect(ui->showConstellationLinesCheckBox, SIGNAL(toggled(bool)), a , SLOT(setChecked(bool)));
ui->showConstellationLabelsCheckBox->setChecked(cmgr->getFlagLabels( )); ui->showConstellationLabelsCheckBox->setChecked(cmgr->getFlagLabels( ));
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Constellation_Labels"); a = gui->getGuiActions("actionShow_Constellation_Labels");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationLabelsCheckBo x, SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showConstellationLabelsCheckBo x, SLOT(setChecked(bool)));
connect(ui->showConstellationLabelsCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool))); connect(ui->showConstellationLabelsCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool)));
ui->showConstellationBoundariesCheckBox->setChecked(cmgr->getFlagBou ndaries()); ui->showConstellationBoundariesCheckBox->setChecked(cmgr->getFlagBou ndaries());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Constellation_Boundaries"); a = gui->getGuiActions("actionShow_Constellation_Boundaries");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationBoundariesChe ckBox, SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showConstellationBoundariesChe ckBox, SLOT(setChecked(bool)));
connect(ui->showConstellationBoundariesCheckBox, SIGNAL(toggled(bool )), a, SLOT(setChecked(bool))); connect(ui->showConstellationBoundariesCheckBox, SIGNAL(toggled(bool )), a, SLOT(setChecked(bool)));
ui->showConstellationArtCheckBox->setChecked(cmgr->getFlagArt()); ui->showConstellationArtCheckBox->setChecked(cmgr->getFlagArt());
a = StelMainGraphicsView::getInstance().findChild<QAction*>("actionS how_Constellation_Art"); a = gui->getGuiActions("actionShow_Constellation_Art");
connect(a, SIGNAL(toggled(bool)), ui->showConstellationArtCheckBox, SLOT(setChecked(bool))); connect(a, SIGNAL(toggled(bool)), ui->showConstellationArtCheckBox, SLOT(setChecked(bool)));
connect(ui->showConstellationArtCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool))); connect(ui->showConstellationArtCheckBox, SIGNAL(toggled(bool)), a, SLOT(setChecked(bool)));
ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y()); ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y());
connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double))); connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double)));
// Starlore // Starlore
connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault())); connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault()));
const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID(); const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b); ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b); ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
// Sky layers
populateSkyLayersList();
connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateSkyLa
yersList()));
connect(ui->skyLayerListWidget, SIGNAL(currentTextChanged(const QStr
ing&)), this, SLOT(skyLayersSelectionChanged(const QString&)));
connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt
em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi
dgetItem*)));
connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this,
SLOT(skyLayersEnabledChanged(int)));
QTimer* refreshTimer = new QTimer(this); QTimer* refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m()));
refreshTimer->start(200); refreshTimer->start(200);
} }
void ViewDialog::populateLists() void ViewDialog::populateLists()
{ {
// Fill the culture list widget from the available list // Fill the culture list widget from the available list
QListWidget* l = ui->culturesListWidget; QListWidget* l = ui->culturesListWidget;
l->blockSignals(true); l->blockSignals(true);
skipping to change at line 306 skipping to change at line 315
l = ui->landscapesListWidget; l = ui->landscapesListWidget;
l->blockSignals(true); l->blockSignals(true);
l->clear(); l->clear();
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
l->addItems(lmgr->getAllLandscapeNames()); l->addItems(lmgr->getAllLandscapeNames());
l->setCurrentItem(l->findItems(lmgr->getCurrentLandscapeName(), Qt:: MatchExactly).at(0)); l->setCurrentItem(l->findItems(lmgr->getCurrentLandscapeName(), Qt:: MatchExactly).at(0));
l->blockSignals(false); l->blockSignals(false);
ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption()); ui->landscapeTextBrowser->setHtml(lmgr->getCurrentLandscapeHtmlDescr iption());
} }
void ViewDialog::populateSkyLayersList()
{
ui->skyLayerListWidget->clear();
StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr);
ui->skyLayerListWidget->addItems(skyLayerMgr->getAllKeys());
}
void ViewDialog::skyLayersSelectionChanged(const QString& s)
{
StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr);
StelSkyLayerP l = skyLayerMgr->getSkyLayer(s);
if (l.isNull())
return;
QString html = "<html><head></head><body>";
html += "<h2>" + l->getShortName()+ "</h2>";
html += "<p>" + l->getLayerDescriptionHtml() + "</p>";
if (!l->getShortServerCredits().isEmpty())
html += "<h3>" + q_("Contact") + ": " + l->getShortServerCre
dits() + "</h3>";
html += "</body></html>";
ui->skyLayerTextBrowser->setHtml(html);
ui->skyLayerEnableCheckBox->setChecked(skyLayerMgr->getShowLayer(s))
;
}
void ViewDialog::skyLayersEnabledChanged(int state)
{
StelSkyLayerMgr* skyLayerMgr = GETSTELMODULE(StelSkyLayerMgr);
skyLayerMgr->showLayer(ui->skyLayerListWidget->currentItem()->text()
, state);
}
void ViewDialog::skyCultureChanged(const QString& cultureName) void ViewDialog::skyCultureChanged(const QString& cultureName)
{ {
StelApp::getInstance().getSkyCultureMgr().setCurrentSkyCultureNameI1 8(cultureName); StelApp::getInstance().getSkyCultureMgr().setCurrentSkyCultureNameI1 8(cultureName);
updateSkyCultureText(); updateSkyCultureText();
const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID(); const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b); ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b); ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
} }
void ViewDialog::updateSkyCultureText() void ViewDialog::updateSkyCultureText()
{ {
StelFileMgr& fileMan(StelApp::getInstance().getFileMgr());
QString descPath; QString descPath;
try try
{ {
descPath = fileMan.findFile("skycultures/" + StelApp::getIns tance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description."+StelA pp::getInstance().getLocaleMgr().getAppLanguage()+".utf8"); descPath = StelFileMgr::findFile("skycultures/" + StelApp::g etInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description."+ StelApp::getInstance().getLocaleMgr().getAppLanguage()+".utf8");
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
try try
{ {
descPath = fileMan.findFile("skycultures/" + StelApp ::getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description .en.utf8"); descPath = StelFileMgr::findFile("skycultures/" + St elApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/descri ption.en.utf8");
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: can't find description for s kyculture" << StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultur eID(); qWarning() << "WARNING: can't find description for s kyculture" << StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultur eID();
} }
} }
QStringList searchPaths;
try
{
searchPaths << StelFileMgr::findFile("skycultures/" + StelAp
p::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
}
catch (std::runtime_error& e) {}
ui->skyCultureTextBrowser->setSearchPaths(searchPaths);
ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString( StelApp::getInstance().getCurrentStelStyle()->htmlStyleSheet)); ui->skyCultureTextBrowser->document()->setDefaultStyleSheet(QString( StelApp::getInstance().getCurrentStelStyle()->htmlStyleSheet));
if (descPath.isEmpty()) if (descPath.isEmpty())
{ {
ui->skyCultureTextBrowser->setHtml(q_("No description")); ui->skyCultureTextBrowser->setHtml(q_("No description"));
} }
else else
{ {
QFile f(descPath); QFile f(descPath);
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
skipping to change at line 476 skipping to change at line 523
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
Q_ASSERT(lmgr); Q_ASSERT(lmgr);
b = lmgr->getCurrentLandscapeID()==lmgr->getDefaultLandscapeID(); b = lmgr->getCurrentLandscapeID()==lmgr->getDefaultLandscapeID();
if (b!=ui->useAsDefaultLandscapeCheckBox->isChecked()) if (b!=ui->useAsDefaultLandscapeCheckBox->isChecked())
{ {
ui->useAsDefaultLandscapeCheckBox->setChecked(b); ui->useAsDefaultLandscapeCheckBox->setChecked(b);
ui->useAsDefaultLandscapeCheckBox->setEnabled(!b); ui->useAsDefaultLandscapeCheckBox->setEnabled(!b);
} }
} }
void ViewDialog::changePage(QListWidgetItem *current, QListWidgetItem *prev
ious)
{
if (!current)
current = previous;
ui->stackedWidget->setCurrentIndex(ui->stackListWidget->row(current)
);
}
 End of changes. 26 change blocks. 
21 lines changed or deleted 77 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/