22 #include "StelObjectModule.hpp"
23 #include "StelObject.hpp"
24 #include "StelFader.hpp"
28 #include <QVariantMap>
31 #include <QSharedPointer>
34 class QNetworkAccessManager;
60 typedef QSharedPointer<Nova> NovaP;
87 virtual void update(
double) {;}
90 virtual double getCallOrder(StelModuleActionName actionName)
const;
99 virtual QList<StelObjectP>
searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
114 virtual QStringList
listMatchingObjectsI18n(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
120 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
121 virtual QStringList listAllObjects(
bool inEnglish)
const;
122 virtual QStringList listAllObjectsByType(
const QString& objType,
bool inEnglish)
const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringList(); }
123 virtual QString getName()
const {
return "Bright Novae"; }
126 NovaP
getByID(
const QString&
id);
156 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
188 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
189 void messageTimeout(
void);
196 void restoreDefaultConfigIni(
void);
199 void restoreDefaultJsonFile(
void);
202 void readJsonFile(
void);
207 bool backupJsonFile(
bool deleteOriginal=
false);
211 int getJsonFileVersion(
void);
215 bool checkJsonFileFormat(
void);
218 QVariantMap loadNovaeMap(QString path=QString());
221 void setNovaeMap(
const QVariantMap& map);
223 QString novaeJsonPath;
229 QHash<QString, double> novalist;
233 QNetworkAccessManager* downloadMgr;
237 QTimer* messageTimer;
238 QList<int> messageIDs;
240 QDateTime lastUpdate;
241 int updateFrequencyDays;
252 void checkForUpdate(
void);
253 void updateDownloadComplete(QNetworkReply* reply);
259 #include "StelPluginInterface.hpp"
265 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void setUpdatesEnabled(bool b)
Set whether or not the plugin will try to update catalog data from the internet.
virtual QStringList listMatchingObjectsI18n(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name...
Update completed, there were updates.
QString getNovaeList()
Get list of novae.
void restoreDefaults(void)
Set up the plugin with default values.
void jsonUpdateComplete(void)
Emitted after a JSON update has run.
QDateTime getLastUpdate(void)
Get the date and time the novae were updated.
Main class of the Bright Novae plugin.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object English name...
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
UpdateState getUpdateState(void)
Get the current updateState.
float getLowerLimitBrightness()
Get lower limit of brightness for displayed novae.
NovaP getByID(const QString &id)
get a nova object by identifier
int getCountNovae(void)
Get count of novae from catalog.
virtual QList< StelObjectP > searchAround(const Vec3d &v, double limitFov, const StelCore *core) const
Used to get a list of objects which are near to some position.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
void updateStateChanged(Novae::UpdateState state)
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
int getSecondsToUpdate(void)
Get the number of seconds till the next update.
Error during download phase.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
This class is used by Qt to manage a plug-in interface.
bool getUpdatesEnabled(void)
Get whether or not the plugin will try to update catalog data from the internet.
int getUpdateFrequencyDays(void)
Get the update frequency in days.
UpdateState
Used for keeping for track of the download/update status.
Update completed, there we no updates.
QSharedPointer< StelTexture > StelTextureSP