void CompassMarks::init() { // Because the plug-in has no configuration GUI, users rely on what's // written in the configuration file to know what can be configured. Q_ASSERT(conf); if (!conf->childGroups().contains("CompassMarks")) restoreDefaultConfiguration(); loadConfiguration(); try { addAction("actionShow_Compass_Marks", N_("Compass Marks"), N_("Compass marks"), "marksVisible"); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui != Q_NULLPTR) { toolbarButton = new StelButton(Q_NULLPTR, QPixmap(":/compassMarks/bt_compass_on.png"), QPixmap(":/compassMarks/bt_compass_off.png"), QPixmap(":/graphicGui/glow32x32.png"), "actionShow_Compass_Marks"); gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGroup"); } connect(GETSTELMODULE(LandscapeMgr), SIGNAL(cardinalsPointsDisplayedChanged(bool)), this, SLOT(cardinalPointsChanged(bool))); cardinalPointsState = false; setCompassMarks(displayedAtStartup); } catch (std::runtime_error& e) { qWarning() << "WARNING: unable create toolbar button for CompassMarks plugin: " << e.what(); } }
void PointerCoordinates::init() { if (!conf->childGroups().contains("PointerCoordinates")) { qDebug() << "PointerCoordinates: no coordinates section exists in main config file - creating with defaults"; restoreDefaultConfiguration(); } // populate settings from main config file. loadConfiguration(); addAction("actionShow_MousePointer_Coordinates", N_("Pointer Coordinates"), N_("Show coordinates of the mouse pointer"), "enabled", ""); enableCoordinates(getFlagEnableAtStartup()); setFlagShowCoordinatesButton(flagShowCoordinatesButton); }
void NavStars::init() { if (!conf->childGroups().contains("NavigationalStars")) { qDebug() << "[NavStars] no coordinates section exists in main config file - creating with defaults"; restoreDefaultConfiguration(); } // populate settings from main config file. loadConfiguration(); // populate list of navigational stars populateNavigationalStarsSet(); // Marker texture - using the same texture as the planet hints. QString path = StelFileMgr::findFile("textures/planet-indicator.png"); markerTexture = StelApp::getInstance().getTextureManager().createTexture(path); // key bindings and other actions addAction("actionShow_NavStars", N_("Navigational Stars"), N_("Mark the navigational stars"), "navStarsVisible", ""); // Toolbar button StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui!=NULL) { if (toolbarButton == NULL) { // Create the nav. stars button toolbarButton = new StelButton(NULL, QPixmap(":/NavStars/btNavStars-on.png"), QPixmap(":/NavStars/btNavStars-off.png"), QPixmap(":/graphicGui/glow32x32.png"), "actionShow_NavStars"); } gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGroup"); } // Sync global settings for stars labels connect(smgr, SIGNAL(starLabelsDisplayedChanged(bool)), this, SLOT(starNamesChanged(bool))); starNamesState = false; }