~treaves/stellarium/SearchGoto

« back to all changes in this revision

Viewing changes to src/core/StelApp.cpp

  • Committer: Timothy Reaves
  • Date: 2011-02-01 13:17:34 UTC
  • mfrom: (4870.1.4 signalsAndSlots)
  • Revision ID: treaves@silverfieldstech.com-20110201131734-dlixznpj88f2bmyk
Refactoring to use signals/slots for module-related functionality.

Show diffs side-by-side

added added

removed removed

Lines of Context:
467
467
}
468
468
 
469
469
 
470
 
// Set the colorscheme for all the modules
471
 
void StelApp::setColorScheme(const QString& section)
472
 
{
473
 
        if (getGui())
474
 
                getGui()->setStelStyle(section);
475
 
        // Send the event to every StelModule
476
 
        foreach (StelModule* iter, moduleMgr->getAllModules())
477
 
        {
478
 
                iter->setStelStyle(section);
479
 
        }
480
 
}
481
 
 
482
470
//! Set flag for activating night vision mode
483
471
void StelApp::setVisionModeNight(bool b)
484
472
{
485
473
        if (flagNightVision!=b)
486
474
        {
487
475
                flagNightVision=b;
488
 
                setColorScheme(b ? "night_color" : "color");
 
476
                emit(colorSchemeChanged(b ? "night_color" : "color"));
489
477
        }
490
478
}
491
479
 
493
481
void StelApp::updateI18n()
494
482
{
495
483
#ifdef ENABLE_NLS
496
 
        // Send the event to every StelModule
497
 
        foreach (StelModule* iter, moduleMgr->getAllModules())
498
 
        {
499
 
                iter->updateI18n();
500
 
        }
501
 
        if (getGui())
502
 
                getGui()->updateI18n();
 
484
        emit(languageChanged());
503
485
#endif
504
486
}
505
487
 
507
489
void StelApp::updateSkyCulture()
508
490
{
509
491
        QString skyCultureDir = getSkyCultureMgr().getCurrentSkyCultureID();
510
 
        // Send the event to every StelModule
511
 
        foreach (StelModule* iter, moduleMgr->getAllModules())
512
 
        {
513
 
                iter->updateSkyCulture(skyCultureDir);
514
 
        }
 
492
        emit(skyCultureChanged(skyCultureDir));
515
493
}
516
494
 
517
495
// Return the time since when stellarium is running in second.