Pulsars.hpp   Pulsars.hpp 
skipping to change at line 76 skipping to change at line 76
//! @ingroup pulsars //! @ingroup pulsars
typedef QSharedPointer<Pulsar> PulsarP; typedef QSharedPointer<Pulsar> PulsarP;
//! @class Pulsars //! @class Pulsars
//! Main class of the %Pulsars plugin. //! Main class of the %Pulsars plugin.
//! @author Alexander Wolf //! @author Alexander Wolf
//! @ingroup pulsars //! @ingroup pulsars
class Pulsars : public StelObjectModule class Pulsars : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool pulsarsVisible READ getFlagShowPulsars WRITE setFlag Q_PROPERTY(bool pulsarsVisible
ShowPulsars) READ getFlagShowPulsars
WRITE setFlagShowPulsars
NOTIFY flagPulsarsVisibilityChanged
)
public: public:
//! @enum UpdateState //! @enum UpdateState
//! Used for keeping for track of the download/update status //! Used for keeping for track of the download/update status
enum UpdateState { enum UpdateState {
Updating, //!< Update in progress Updating, //!< Update in progress
CompleteNoUpdates, //!< Update completed, there we no u pdates CompleteNoUpdates, //!< Update completed, there we no u pdates
CompleteUpdates, //!< Update completed, there were up dates CompleteUpdates, //!< Update completed, there were up dates
DownloadError, //!< Error during download phase DownloadError, //!< Error during download phase
OtherError //!< Other error OtherError //!< Other error
}; };
skipping to change at line 117 skipping to change at line 121
virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const; virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const;
//! Return the matching satellite object's pointer if exists or NULL . //! Return the matching satellite object's pointer if exists or NULL .
//! @param nameI18n The case in-sensistive satellite name //! @param nameI18n The case in-sensistive satellite name
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
//! Return the matching satellite if exists or NULL. //! Return the matching satellite if exists or NULL.
//! @param name The case in-sensistive standard program name //! @param name The case in-sensistive standard program name
virtual StelObjectP searchByName(const QString& name) const; virtual StelObjectP searchByName(const QString& name) const;
//! Find and return the list of at most maxNbItem objects auto-compl eting the passed object I18n name. //! Find and return the list of at most maxNbItem objects auto-compl eting the passed object name.
//! @param objPrefix the case insensitive first letters of the searc hed object //! @param objPrefix the case insensitive first letters of the searc hed object
//! @param maxNbItem the maximum number of returned object names //! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na mes //! @param useStartOfWords the autofill mode for returned objects na mes
//! @return a list of matching object name by order of relevance, or an empty list if nothing match //! @return a list of matching object name by order of relevance, or an empty list if nothing match
virtual QStringList listMatchingObjectsI18n(const QString& objPrefix virtual QStringList listMatchingObjects(const QString& objPrefix, in
, int maxNbItem=5, bool useStartOfWords=false) const; t maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const;
//! Find and return the list of at most maxNbItem objects auto-compl
eting the passed object English name.
//! @param objPrefix the case insensitive first letters of the searc
hed object
//! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na
mes
//! @return a list of matching object name by order of relevance, or
an empty list if nothing match
virtual QStringList listMatchingObjects(const QString& objPrefix, in
t maxNbItem=5, bool useStartOfWords=false) const;
virtual QStringList listAllObjects(bool inEnglish) const; virtual QStringList listAllObjects(bool inEnglish) const;
virtual QStringList listAllObjectsByType(const QString& objType, boo l inEnglish) const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringLi st(); }
virtual QString getName() const { return "Pulsars"; } virtual QString getName() const { return "Pulsars"; }
//! get a Pulsar object by identifier //! get a Pulsar object by identifier
PulsarP getByID(const QString& id); PulsarP getByID(const QString& id);
//! Implement this to tell the main Stellarium GUI that there is a G UI element to configure this //! Implement this to tell the main Stellarium GUI that there is a G UI element to configure this
//! plugin. //! plugin.
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
//! Set up the plugin with default values. This means clearing out the Pulsars section in the //! Set up the plugin with default values. This means clearing out the Pulsars section in the
skipping to change at line 159 skipping to change at line 156
//! Save the settings to the main configuration file. //! Save the settings to the main configuration file.
void saveSettingsToConfig(void); void saveSettingsToConfig(void);
//! get whether or not the plugin will try to update catalog data fr om the internet //! get whether or not the plugin will try to update catalog data fr om the internet
//! @return true if updates are set to be done, false otherwise //! @return true if updates are set to be done, false otherwise
bool getUpdatesEnabled(void) {return updatesEnabled;} bool getUpdatesEnabled(void) {return updatesEnabled;}
//! set whether or not the plugin will try to update catalog data fr om the internet //! set whether or not the plugin will try to update catalog data fr om the internet
//! @param b if true, updates will be enabled, else they will be dis abled //! @param b if true, updates will be enabled, else they will be dis abled
void setUpdatesEnabled(bool b) {updatesEnabled=b;} void setUpdatesEnabled(bool b) {updatesEnabled=b;}
bool getDisplayMode(void);
void setDisplayMode(bool b);
bool getGlitchFlag(void);
void setGlitchFlag(bool b);
QString getMarkerColor(bool mtype = true);
void setMarkerColor(QString c, bool mtype = true);
void setEnableAtStartup(bool b) { enableAtStartup=b; } void setEnableAtStartup(bool b) { enableAtStartup=b; }
bool getEnableAtStartup(void) { return enableAtStartup; } bool getEnableAtStartup(void) { return enableAtStartup; }
//! get the date and time the pulsars were updated //! get the date and time the pulsars were updated
QDateTime getLastUpdate(void) {return lastUpdate;} QDateTime getLastUpdate(void) {return lastUpdate;}
//! get the update frequency in days //! get the update frequency in days
int getUpdateFrequencyDays(void) {return updateFrequencyDays;} int getUpdateFrequencyDays(void) {return updateFrequencyDays;}
void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;} void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;}
//! get the number of seconds till the next update //! get the number of seconds till the next update
int getSecondsToUpdate(void); int getSecondsToUpdate(void);
//! Get the current updateState //! Get the current updateState
UpdateState getUpdateState(void) {return updateState;} UpdateState getUpdateState(void) {return updateState;}
//! Get count of pulsars from catalog
int getCountPulsars(void) {return PsrCount;}
signals: signals:
//! @param state the new update state. //! @param state the new update state.
void updateStateChanged(Pulsars::UpdateState state); void updateStateChanged(Pulsars::UpdateState state);
//! emitted after a JSON update has run. //! emitted after a JSON update has run.
void jsonUpdateComplete(void); void jsonUpdateComplete(void);
void flagPulsarsVisibilityChanged(bool b);
public slots: public slots:
//! Download JSON from web recources described in the module section //! Define whether the button toggling pulsars should be visible
of the void setFlagShowPulsarsButton(bool b);
//! module.ini file and update the local JSON file. bool getFlagShowPulsarsButton(void) { return flagShowPulsarsButton;
void updateJSON(void); }
void setFlagShowPulsars(bool b) { flagShowPulsars=b; } //! Enable/disable display of markers of pulsars
//! @param b boolean flag
void setFlagShowPulsars(bool b);
//! Get status to display of markers of pulsars
//! @return true if it's visible
bool getFlagShowPulsars(void) { return flagShowPulsars; } bool getFlagShowPulsars(void) { return flagShowPulsars; }
//! Display a message. This is used for plugin-specific warnings and //! Get status to display of distribution of pulsars
such //! @return true if distribution of pulsars is enabled
void displayMessage(const QString& message, const QString hexColor=" bool getDisplayMode(void);
#999999"); //! Enable/disable display of distribution of pulsars
void messageTimeout(void); //! @param b
void setDisplayMode(bool b);
//! Define whether the button toggling pulsars should be visible //! Get status for usage of separate color for pulsars with glitches
void setFlagShowPulsarsButton(bool b); //! @return true if separate color is used for pulsars with glitches
bool getFlagShowPulsarsButton(void) { return flagShowPulsarsButton; bool getGlitchFlag(void);
} //! Enable/disable the use of a separate color for pulsars with glit
ches
//! @param boolean flag
void setGlitchFlag(bool b);
//! Get color for pulsars markers
//! @param mtype set false if you want get color of pulsars with gli
tches
//! @return color
Vec3f getMarkerColor(bool mtype = true);
//! Set color for pulsars markers
//! @param c color
//! @param mtype set false if you want set color for pulsars with gl
itches
//! @code
//! // example of usage in scripts
//! Pulsars.setMarkerColor(Vec3f(1.0,0.0,0.0), true);
//! @endcode
void setMarkerColor(const Vec3f& c, bool mtype = true);
//! Get count of pulsars from catalog
//! @return count of pulsars
int getCountPulsars(void) {return PsrCount;}
//! Download JSON from web recources described in the module section
of the
//! module.ini file and update the local JSON file.
void updateJSON(void);
private: private:
// Font used for displaying our text // Font used for displaying our text
QFont font; QFont font;
// if existing, delete Satellites section in main config.ini, then c reate with default values // if existing, delete Satellites section in main config.ini, then c reate with default values
void restoreDefaultConfigIni(void); void restoreDefaultConfigIni(void);
// Upgrade config.ini: rename old key settings to new // Upgrade config.ini: rename old key settings to new
void upgradeConfigIni(void); void upgradeConfigIni(void);
skipping to change at line 283 skipping to change at line 301
StelButton* toolbarButton; StelButton* toolbarButton;
class StelProgressController* progressBar; class StelProgressController* progressBar;
private slots: private slots:
//! check to see if an update is required. This is called periodica lly by a timer //! check to see if an update is required. This is called periodica lly by a timer
//! if the last update was longer than updateFrequencyHours ago then the update is //! if the last update was longer than updateFrequencyHours ago then the update is
//! done. //! done.
void checkForUpdate(void); void checkForUpdate(void);
void updateDownloadComplete(QNetworkReply* reply); void updateDownloadComplete(QNetworkReply* reply);
void reloadCatalog(void);
//! Display a message. This is used for plugin-specific warnings and
such
void displayMessage(const QString& message, const QString hexColor="
#999999");
void messageTimeout(void);
}; };
#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 PulsarsStelPluginInterface : public QObject, public StelPluginInterfa ce class PulsarsStelPluginInterface : public QObject, public StelPluginInterfa ce
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID StelPluginInterface_iid) Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
 End of changes. 12 change blocks. 
43 lines changed or deleted 63 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/