// read from stream
void NebulaMgr::init()
{
	// TODO: mechanism to specify which sets get loaded at start time.
	// candidate methods:
	// 1. config file option (list of sets to load at startup)
	// 2. load all
	// 3. flag in nebula_textures.fab (yuk)
	// 4. info.ini file in each set containing a "load at startup" item
	// For now (0.9.0), just load the default set
	loadNebulaSet("default");

	QSettings* conf = StelApp::getInstance().getSettings();
	Q_ASSERT(conf);

	nebulaFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
	Nebula::texCircle = StelApp::getInstance().getTextureManager().createTexture("textures/neb.png");   // Load circle texture
	Nebula::texOpenCluster = StelApp::getInstance().getTextureManager().createTexture("textures/ocl.png");   // Load open clister marker texture
	Nebula::texGlobularCluster = StelApp::getInstance().getTextureManager().createTexture("textures/gcl.png");   // Load globular clister marker texture
	Nebula::texPlanetNebula = StelApp::getInstance().getTextureManager().createTexture("textures/pnb.png");   // Load planetary nebula marker texture
	texPointer = StelApp::getInstance().getTextureManager().createTexture("textures/pointeur5.png");   // Load pointer texture

	setFlagShow(conf->value("astro/flag_nebula",true).toBool());
	setFlagHints(conf->value("astro/flag_nebula_name",false).toBool());
	setHintsAmount(conf->value("astro/nebula_hints_amount", 3).toFloat());
	setLabelsAmount(conf->value("astro/nebula_labels_amount", 3).toFloat());
	setCircleScale(conf->value("astro/nebula_scale",1.0f).toFloat());	

	updateI18n();
	
	StelApp *app = &StelApp::getInstance();
	connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
	connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(setStelStyle(const QString&)));
	GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this);
}
Esempio n. 2
0
// read from stream
void StelSkyLayerMgr::init()
{
	QString path = StelFileMgr::findFile("nebulae/default/textures.json");
	if (path.isEmpty())
		qWarning() << "ERROR while loading nebula texture set default";
	else
		insertSkyImage(path);
	QSettings* conf = StelApp::getInstance().getSettings();
	conf->beginGroup("skylayers");
	foreach (const QString& key, conf->childKeys())
	{
		QString uri = conf->value(key, "").toString();
		if (!uri.isEmpty())
		{
			if (key=="clilayer")
				insertSkyImage(uri, "Command-line layer");
			else
				insertSkyImage(uri);
		}
	}
	conf->endGroup();

	setFlagShow(!conf->value("astro/flag_nebula_display_no_texture", false).toBool());
	addAction("actionShow_DSS", N_("Display Options"), N_("Deep-sky objects background images"), "visible", "I");
}
Esempio n. 3
0
void ToastMgr::init()
{
	QSettings* conf = StelApp::getInstance().getSettings();
	Q_ASSERT(conf);

	QString toastHost = conf->value("astro/toast_survey_host", "http://dss.stellarium.org").toString();
	QString toastDir = conf->value("astro/toast_survey_directory", "survey").toString();
	int toastLevel = conf->value("astro/toast_survey_levels", 11).toInt();	
	survey = new ToastSurvey(toastHost+"/" + toastDir + "/{level}/{x}_{y}.jpg", toastLevel);
	survey->setParent(this);

	// Hide deep-sky survey by default
	setFlagShow(conf->value("astro/flag_toast_survey", false).toBool());

	addAction("actionShow_Toast_Survey", N_("Display Options"), N_("Digitized Sky Survey (TOAST)"), "surveyDisplayed");
}
Esempio n. 4
0
void ToastMgr::setFlagSurveyShow(bool displayed)
{
	qWarning() << "WARNING: ToastMgr.setFlagSurveyShow() is deprecated and will soon be removed. Use ToastMgr.setFlagShow() instead.";
	setFlagShow(displayed);
}