HelpDialog.hpp   HelpDialog.hpp 
skipping to change at line 31 skipping to change at line 31
#define _HELPDIALOG_HPP_ #define _HELPDIALOG_HPP_
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include <QSettings> #include <QSettings>
#include "StelDialog.hpp" #include "StelDialog.hpp"
class Ui_helpDialogForm; class Ui_helpDialogForm;
class QListWidgetItem; class QListWidgetItem;
class QNetworkAccessManager;
class QNetworkReply;
class HelpDialog : public StelDialog class HelpDialog : public StelDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
//! @enum UpdateState
//! Used for keeping for track of the download/update status
enum UpdateState {
Updating, //!< Update in progress
CompleteNoUpdates, //!< Update completed, there we no u
pdates
CompleteUpdates, //!< Update completed, there were up
dates
DownloadError, //!< Error during download phase
OtherError //!< Other error
};
HelpDialog(QObject* parent); HelpDialog(QObject* parent);
~HelpDialog(); ~HelpDialog();
//! Notify that the application style changed //! Notify that the application style changed
void styleChanged(); void styleChanged();
//! get whether or not the plugin will try to update data from the i
nternet
//! @return true if updates are set to be done, false otherwise
bool getUpdatesEnabled(void) {return updatesEnabled;}
//! set whether or not the plugin will try to update data from the i
nternet
//! @param b if true, updates will be enabled, else they will be dis
abled
void setUpdatesEnabled(bool b) {updatesEnabled=b;}
//! Get the current updateState
UpdateState getUpdateState(void) {return updateState;}
//! Get the version from the "latestVersion" value in the updates.js
on file
//! @return version string, e.g. "0.12.4"
QString getLatestVersionFromJson(void);
int getRequiredOpenGLVersionFromJson(void);
void setUpdatesMessage(bool hasUpdates, QString version="", int Open
GL=0);
QString getUpdatesMessage();
public slots: public slots:
void retranslate(); void retranslate();
//! Download JSON from web recources described in the module section
of the
//! module.ini file and update the local JSON file.
void updateJSON(void);
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots //! Initialize the dialog widgets and connect the signals/slots
virtual void createDialogContent(); virtual void createDialogContent();
Ui_helpDialogForm* ui; Ui_helpDialogForm* ui;
signals:
//! @param state the new update state.
void updateStateChanged(HelpDialog::UpdateState state);
private slots: private slots:
//! Show/bring to foreground the shortcut editor window. //! Show/bring to foreground the shortcut editor window.
void showShortcutsWindow(); void showShortcutsWindow();
//! On tab change, if the Log tab is selected, call refreshLog(). //! On tab change, if the Log tab is selected, call refreshLog().
void updateLog(int); void updateLog(int);
//! Sync the displayed log. //! Sync the displayed log.
void refreshLog(); void refreshLog();
void changePage(QListWidgetItem *current, QListWidgetItem *previous) ; void changePage(QListWidgetItem *current, QListWidgetItem *previous) ;
//! 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
//! done.
void updateDownloadComplete(QNetworkReply* reply);
private: private:
//! Return the help text with keys description and external links. //! Return the help text with keys description and external links.
QString getHelpText(void); QString getHelpText(void);
//! This function concatenates the header, key codes and footer to b uild //! This function concatenates the header, key codes and footer to b uild
//! up the help text. //! up the help text.
void updateText(void); void updateText(void);
//! replace the json file with the default from the compiled-in reso
urce
void restoreDefaultJsonFile(void);
//! read the json file.
void readJsonFile(void);
// variables and functions for the updater
UpdateState updateState;
QSettings* conf;
QNetworkAccessManager* downloadMgr;
QString updateUrl;
bool updatesEnabled;
QString jsonDataPath;
QString currentVersion;
QString updatesMessage;
}; };
#endif /*_HELPDIALOG_HPP_*/ #endif /*_HELPDIALOG_HPP_*/
 End of changes. 7 change blocks. 
66 lines changed or deleted 0 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/