20 #ifndef METEORSHOWERSMGR_HPP_ 21 #define METEORSHOWERSMGR_HPP_ 23 #include <QNetworkReply> 25 #include "StelGuiItems.hpp" 26 #include "StelTextureMgr.hpp" 27 #include "StelObjectModule.hpp" 29 #define MS_CATALOG_VERSION 1 30 #define MS_CONFIG_PREFIX QString("MeteorShowers") 56 Q_PROPERTY(
bool enablePlugin READ getEnablePlugin WRITE actionEnablePlugin NOTIFY enablePluginChanged)
95 bool getEnablePlugin() {
return m_enablePlugin; }
101 void setUrl(
const QString& url);
102 QString getUrl() {
return m_url; }
106 QDateTime getLastUpdate() {
return m_lastUpdate; }
110 DownloadStatus getStatusOfLastUpdate() {
return m_statusOfLastUpdate; }
123 virtual void update(
double deltaTime);
129 void downloadStatusChanged(DownloadStatus);
130 void enablePluginChanged(
bool b);
131 void enableLabelsChanged(
bool b);
275 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
276 void messageTimeout();
279 void checkForUpdates();
280 void updateFinished(QNetworkReply* reply);
290 QString m_catalogPath;
294 bool m_activeRadiantOnly;
295 bool m_enableAtStartup;
298 bool m_showEnableButton;
299 bool m_showSearchButton;
305 QTimer* m_messageTimer;
306 QList<int> m_messageIDs;
313 bool m_enableAutoUpdates;
314 int m_updateFrequencyHours;
316 QDateTime m_lastUpdate;
317 DownloadStatus m_statusOfLastUpdate;
318 QNetworkAccessManager* m_downloadMgr;
321 void createActions();
324 bool loadCatalog(
const QString& jsonPath);
328 void actionEnablePlugin(
const bool& b) {
if (m_enablePlugin != b) { m_enablePlugin = b; emit enablePluginChanged(b);} }
332 #include "StelPluginInterface.hpp" 338 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void setColorARG(const Vec3f &rgb)
Set the color of the active radiant based on generic data.
StelTextureSP getBolideTexture()
Gets the bolide texture.
QFont getFont()
Get the font.
void setShowEnableButton(const bool &show)
Show/hide the button that enable/disable the meteor showers plugin.
bool getEnableAutoUpdates()
Enable/disable catalog updates from the internet.
bool getActiveRadiantOnly()
True if user wants to see the active radiants only.
Store the informations for a location on a planet.
void setEnableAutoUpdates(const bool &b)
Enable/disable automatic catalog updates from the internet.
void setLastUpdate(const QDateTime &datetime)
Set the date and time of last update.
void setColorARC(const Vec3f &rgb)
Set the color of the active radiant based on confirmed data.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
Define the interface to implement when creating a plugin.
void restoreDefaultSettings()
Restore default settings.
StelTextureSP getPointerTexture()
Gets the pointer texture.
void setFontSize(int pixelSize)
Set the font size (used on radiant labels).
void setUrl(const QString &url)
Set the URL for downloading the meteor showers catalog.
This class manages a collection of MeteorShower objects.
Main class for Stellarium core processing.
void setEnableMarker(const bool &b)
Enable/disable radiant marker.
bool getShowEnableButton()
Get the status of the enable button on the toolbar.
bool getShowSearchButton()
Get the status of the search button on the toolbar.
void setEnableLabels(const bool &b)
Enable/disable radiant labels.
virtual bool configureGui(bool show=true)
Detect or show the configuration GUI elements for the module.
Main class of the Meteor Showers plugin, inherits from StelModule.
bool getEnableLabels()
Enable/disable radiant labels.
void setActiveRadiantOnly(const bool &b)
True if user wants to see the active radiants only.
void setEnablePlugin(const bool &b)
Enable/disable the meteor showers plugin.
bool restoreDefaultCatalog(const QString &destination)
Restore default catalog.
StelTextureSP getRadiantTexture()
Gets the radiant texture.
void setShowSearchButton(const bool &show)
Show/hide the button that opens the search dialog.
virtual void init()
Initialize itself.
virtual void deinit()
Called before the module will be delete, and before the openGL context is suppressed.
MeteorShowersMgr()
Constructor.
void setStatusOfLastUpdate(const int &downloadStatus)
Set the status of the last update.
void setUpdateFrequencyHours(const int &hours)
Set the update frequency in hours.
StelModuleActionName
Define the possible action for which an order is defined.
Maintain the state of a progress bar.
MeteorShowers * getMeteorShowers()
Gets the MeteorShowers instance.
void repaint()
It's useful to force the update() and draw().
void updateCatalog()
Download the Meteor Showers catalog from the Internet.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
virtual ~MeteorShowersMgr()
Destructor.
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
void setEnableAtStartup(const bool &b)
Enable the meteor showers plugin at Stellarium startup.
bool getEnableAtStartup()
True if the plugin is enabled at Stellarium startup.
int getUpdateFrequencyHours()
Gets the update frequency in hours.
QDateTime getNextUpdate()
Gets the date of the next update.
This is the common base class for all the main components of stellarium.
bool getEnableMarker()
Enable/disable radiant marker.
virtual void update(double deltaTime)
Update the module with respect to the time.
int getFontSize()
Set the font size (used on radiant labels).
Contains information about a Stellarium plugin.
void setColorIR(const Vec3f &rgb)
Set the color of the inactive radiant.