MeteorShowersMgr.hpp   MeteorShowersMgr.hpp 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef METEORSHOWERSMGR_HPP_ #ifndef METEORSHOWERSMGR_HPP_
#define METEORSHOWERSMGR_HPP_ #define METEORSHOWERSMGR_HPP_
#include <QNetworkReply> #include <QNetworkReply>
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelTextureMgr.hpp"
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#define MS_CATALOG_VERSION 1 #define MS_CATALOG_VERSION 1
#define MS_CONFIG_PREFIX QString("MeteorShowers") #define MS_CONFIG_PREFIX QString("MeteorShowers")
class MeteorShowers; class MeteorShowers;
class MSConfigDialog; class MSConfigDialog;
class MSSearchDialog; class MSSearchDialog;
/*! @defgroup meteorShowers Meteor Showers Plug-in /*! @defgroup meteorShowers Meteor Showers Plug-in
skipping to change at line 55 skipping to change at line 56
@} @}
*/ */
//! @class MeteorShowersMgr //! @class MeteorShowersMgr
//! Main class of the %Meteor Showers plugin, inherits from StelObjectModul e. //! Main class of the %Meteor Showers plugin, inherits from StelObjectModul e.
//! @author Marcos Cardinot <mcardinot@gmail.com> //! @author Marcos Cardinot <mcardinot@gmail.com>
//! @ingroup meteorShowers //! @ingroup meteorShowers
class MeteorShowersMgr : public StelObjectModule class MeteorShowersMgr : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool enablePlugin READ getEnablePlugin WRITE actionEnable Q_PROPERTY(bool enablePlugin READ getEnablePlugin WRITE actionEnable
Plugin) Plugin NOTIFY enablePluginChanged)
Q_PROPERTY(bool enableLabels READ getEnableLabels WRITE setEnableLab Q_PROPERTY(bool enableLabels READ getEnableLabels WRITE setEnableLab
els) els NOTIFY enableLabelsChanged)
public: public:
//! @enum DownloadStatus //! @enum DownloadStatus
enum DownloadStatus { enum DownloadStatus {
OUTDATED, OUTDATED,
UPDATING, UPDATING,
UPDATED, UPDATED,
FAILED FAILED
}; };
skipping to change at line 96 skipping to change at line 97
StelTextureSP getRadiantTexture() { return m_radiantTexture; } StelTextureSP getRadiantTexture() { return m_radiantTexture; }
//! Gets the MeteorShowers instance //! Gets the MeteorShowers instance
//! @return MeteorShowers instance //! @return MeteorShowers instance
MeteorShowers* getMeteorShowers() { return m_meteorShowers; } MeteorShowers* getMeteorShowers() { return m_meteorShowers; }
//! Enable/disable the meteor showers plugin. //! Enable/disable the meteor showers plugin.
void setEnablePlugin(const bool& b); void setEnablePlugin(const bool& b);
bool getEnablePlugin() { return m_enablePlugin; } bool getEnablePlugin() { return m_enablePlugin; }
//! True if user wants to see the active radiants only.
bool getActiveRadiantOnly() { return m_activeRadiantOnly; }
//! Get the status of the enable button on the toolbar.
//! @return true if it's visible
bool getShowEnableButton() { return m_showEnableButton; }
//! Get the status of the search button on the toolbar.
//! @return true if it's visible
bool getShowSearchButton() { return m_showSearchButton; }
//! Set the color of the active radiant based on generic data.
void setColorARG(const Vec3f& rgb);
Vec3f getColorARG() { return m_colorARG; }
//! Set the color of the active radiant based on confirmed data.
void setColorARC(const Vec3f& rgb);
Vec3f getColorARC() { return m_colorARC; }
//! Set the color of the inactive radiant.
void setColorIR(const Vec3f& rgb);
Vec3f getColorIR() { return m_colorIR; }
//! True if the plugin is enabled at Stellarium startup.
bool getEnableAtStartup() { return m_enableAtStartup; }
//! Set the font size (used on radiant labels).
int getFontSize() { return m_font.pixelSize(); }
//! Get the font. //! Get the font.
QFont getFont() { return m_font; } QFont getFont() { return m_font; }
//! Enable/disable radiant labels
bool getEnableLabels() { return m_enableLabels; }
//! Enable/disable radiant marker.
bool getEnableMarker() { return m_enableMarker; }
//! Gets the update frequency in hours.
int getUpdateFrequencyHours() { return m_updateFrequencyHours; }
//! Enable/disable catalog updates from the internet.
bool getEnableAutoUpdates() { return m_enableAutoUpdates; }
//! Set the URL for downloading the meteor showers catalog. //! Set the URL for downloading the meteor showers catalog.
void setUrl(const QString& url); void setUrl(const QString& url);
QString getUrl() { return m_url; } QString getUrl() { return m_url; }
//! Set the date and time of last update. //! Set the date and time of last update.
void setLastUpdate(const QDateTime& datetime); void setLastUpdate(const QDateTime& datetime);
QDateTime getLastUpdate() { return m_lastUpdate; } QDateTime getLastUpdate() { return m_lastUpdate; }
//! Set the status of the last update //! Set the status of the last update
void setStatusOfLastUpdate(const int &downloadStatus); void setStatusOfLastUpdate(const int &downloadStatus);
skipping to change at line 174 skipping to change at line 134
virtual void draw(StelCore* core); virtual void draw(StelCore* core);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
// //
// Methods defined in StelObjectModule class // Methods defined in StelObjectModule class
// //
virtual QList<StelObjectP> searchAround(const Vec3d&, double, const StelCore*) const { return QList<StelObjectP>(); } virtual QList<StelObjectP> searchAround(const Vec3d&, double, const StelCore*) const { return QList<StelObjectP>(); }
virtual StelObjectP searchByNameI18n(const QString&) const { return StelObjectP(); } virtual StelObjectP searchByNameI18n(const QString&) const { return StelObjectP(); }
virtual StelObjectP searchByName(const QString&) const { return Stel ObjectP(); } virtual StelObjectP searchByName(const QString&) const { return Stel ObjectP(); }
virtual QStringList listMatchingObjectsI18n(const QString&, int, boo virtual QStringList listMatchingObjects(const QString&, int, bool, b
l) const { return QStringList(); } ool) const { return QStringList(); }
virtual QStringList listMatchingObjects(const QString&, int, bool) c
onst { return QStringList(); }
virtual QStringList listAllObjects(bool) const { return QStringList( ); } virtual QStringList listAllObjects(bool) const { return QStringList( ); }
virtual QStringList listAllObjectsByType(const QString&, bool) const { return QStringList(); }
virtual QString getName() const { return QString(); } virtual QString getName() const { return QString(); }
signals: signals:
void downloadStatusChanged(DownloadStatus); void downloadStatusChanged(DownloadStatus);
void enablePluginChanged(bool b);
void enableLabelsChanged(bool b);
public slots: public slots:
//! Enable the meteor showers plugin at Stellarium startup. //! Enable the meteor showers plugin at Stellarium startup.
//! @param b boolean flag
void setEnableAtStartup(const bool& b); void setEnableAtStartup(const bool& b);
//! True if the plugin is enabled at Stellarium startup.
//! @return true if it's enabled at startup
bool getEnableAtStartup() { return m_enableAtStartup; }
//! Show/hide the button that enable/disable the meteor showers plug in. //! Show/hide the button that enable/disable the meteor showers plug in.
//! @param b boolean flag
void setShowEnableButton(const bool& show); void setShowEnableButton(const bool& show);
//! Get the status of the enable button on the toolbar.
//! @return true if it's visible
bool getShowEnableButton() { return m_showEnableButton; }
//! Show/hide the button that opens the search dialog. //! Show/hide the button that opens the search dialog.
//! @param b boolean flag
void setShowSearchButton(const bool& show); void setShowSearchButton(const bool& show);
//! Get the status of the search button on the toolbar.
//! @return true if it's visible
bool getShowSearchButton() { return m_showSearchButton; }
//! Enable/disable radiant marker. //! Enable/disable radiant marker.
//! @param b boolean flag
//! @code
//! // example of usage in scripts
//! MeteorShowers.setEnableMarker(true);
//! @endcode
void setEnableMarker(const bool& b); void setEnableMarker(const bool& b);
//! Enable/disable radiant marker.
//! @return true if radiant markers visible
//! @code
//! // example of usage in scripts
//! var flag = MeteorShowers.getEnableMarker();
//! @endcode
bool getEnableMarker() { return m_enableMarker; }
//! True if user wants to see the active radiants only. //! True if user wants to see the active radiants only.
//! @param b boolean flag
//! @code
//! // example of usage in scripts
//! MeteorShowers.setActiveRadiantOnly(true);
//! @endcode
void setActiveRadiantOnly(const bool& b); void setActiveRadiantOnly(const bool& b);
//! True if user wants to see the active radiants only.
//! @return true if only active radiants are visible
//! @code
//! // example of usage in scripts
//! var flag = MeteorShowers.getActiveRadiantOnly();
//! @endcode
bool getActiveRadiantOnly() { return m_activeRadiantOnly; }
//! Enable/disable radiant labels //! Enable/disable radiant labels
//! @param b boolean flag
//! @code
//! // example of usage in scripts
//! MeteorShowers.setEnableLabels(true);
//! @endcode
void setEnableLabels(const bool& b); void setEnableLabels(const bool& b);
//! Enable/disable radiant labels
//! @return true if radiant labels visible
//! @code
//! // example of usage in scripts
//! var flag = MeteorShowers.getEnableLabels();
//! @endcode
bool getEnableLabels() { return m_enableLabels; }
//! Set the font size (used on radiant labels). //! Set the font size (used on radiant labels).
//! @param pixelSize size of font
//! @code
//! // example of usage in scripts
//! MeteorShowers.setFontSize(15);
//! @endcode
void setFontSize(int pixelSize); void setFontSize(int pixelSize);
//! Set the font size (used on radiant labels).
//! @return size of font
//! @code
//! // example of usage in scripts
//! var size = MeteorShowers.getFontSize();
//! @endcode
int getFontSize() { return m_font.pixelSize(); }
//! Set the update frequency in hours. //! Set the update frequency in hours.
//! @param hours update frequency in hours
void setUpdateFrequencyHours(const int& hours); void setUpdateFrequencyHours(const int& hours);
//! Gets the update frequency in hours.
//! @return update frequency in hours
int getUpdateFrequencyHours() { return m_updateFrequencyHours; }
//! Enable/disable automatic catalog updates from the internet. //! Enable/disable automatic catalog updates from the internet.
//! @param b boolean flag
void setEnableAutoUpdates(const bool& b); void setEnableAutoUpdates(const bool& b);
//! Enable/disable catalog updates from the internet.
//! @return true if auto updates is enabled
bool getEnableAutoUpdates() { return m_enableAutoUpdates; }
//! Set the color of the active radiant based on generic data.
//! @code
//! // example of usage in scripts
//! MeteorShowers.setColorARG(Vec3f(1.0,0.0,0.0));
//! @endcode
void setColorARG(const Vec3f& rgb);
//! @return color of markers of the active radiants based on generic
data.
//! @code
//! // example of usage in scripts
//! color = MeteorShowers.getColorARG();
//! @endcode
Vec3f getColorARG() { return m_colorARG; }
//! Set the color of the active radiant based on confirmed data.
//! @code
//! // example of usage in scripts
//! MeteorShowers.setColorARC(Vec3f(1.0,0.0,0.0));
//! @endcode
void setColorARC(const Vec3f& rgb);
//! @return color of markers of the active radiants based on confirm
ed data.
//! @code
//! // example of usage in scripts
//! color = MeteorShowers.getColorARC();
//! @endcode
Vec3f getColorARC() { return m_colorARC; }
//! Set the color of the inactive radiant.
//! @code
//! // example of usage in scripts
//! MeteorShowers.setColorIR(Vec3f(1.0,0.0,0.0));
//! @endcode
void setColorIR(const Vec3f& rgb);
//! @return color of markers of the inactive radiants.
//! @code
//! // example of usage in scripts
//! color = MeteorShowers.getColorIR();
//! @endcode
Vec3f getColorIR() { return m_colorIR; }
//! Download the Meteor Showers catalog from the Internet. //! Download the Meteor Showers catalog from the Internet.
void updateCatalog(); void updateCatalog();
//! Restore default settings. //! Restore default settings.
void restoreDefaultSettings(); void restoreDefaultSettings();
//! Display a message. This is used for plugin-specific warnings and such //! Display a message. This is used for plugin-specific warnings and such
void displayMessage(const QString& message, const QString hexColor=" #999999"); void displayMessage(const QString& message, const QString hexColor=" #999999");
void messageTimeout(); void messageTimeout();
skipping to change at line 271 skipping to change at line 338
QNetworkAccessManager* m_downloadMgr; QNetworkAccessManager* m_downloadMgr;
class StelProgressController* m_progressBar; class StelProgressController* m_progressBar;
void createActions(); void createActions();
void loadConfig(); void loadConfig();
void loadTextures(); void loadTextures();
bool loadCatalog(const QString& jsonPath); bool loadCatalog(const QString& jsonPath);
//! Enable/disable the Meteor Showers plugin. //! Enable/disable the Meteor Showers plugin.
//! It'll be triggered by a StelAction! So, it should NOT be called directly! //! It'll be triggered by a StelAction! So, it should NOT be called directly!
void actionEnablePlugin(const bool& b) { m_enablePlugin = b; } void actionEnablePlugin(const bool& b) { if (m_enablePlugin != b) { m_enablePlugin = b; emit enablePluginChanged(b);} }
}; };
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
class MeteorShowersStelPluginInterface : public QObject, public StelPluginI nterface class MeteorShowersStelPluginInterface : public QObject, public StelPluginI nterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID StelPluginInterface_iid) Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
 End of changes. 26 change blocks. 
51 lines changed or deleted 119 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/