2015-06-04 10:29:50 +00:00
|
|
|
#ifndef QMLMANAGER_H
|
|
|
|
#define QMLMANAGER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
|
2015-11-11 20:34:56 +00:00
|
|
|
#include "qt-mobile/gpslocation.h"
|
|
|
|
|
2015-11-11 19:16:59 +00:00
|
|
|
void qmlUiShowMessage(const char *errorString);
|
|
|
|
|
2015-06-04 10:29:50 +00:00
|
|
|
class QMLManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2015-07-10 07:47:26 +00:00
|
|
|
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
|
|
|
|
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
|
2015-07-21 08:57:10 +00:00
|
|
|
Q_PROPERTY(bool saveCloudPassword READ saveCloudPassword WRITE setSaveCloudPassword NOTIFY saveCloudPasswordChanged)
|
2015-08-19 07:17:52 +00:00
|
|
|
Q_PROPERTY(QString logText READ logText WRITE setLogText NOTIFY logTextChanged)
|
2015-11-11 20:34:56 +00:00
|
|
|
Q_PROPERTY(bool locationServiceEnabled READ locationServiceEnabled WRITE setLocationServiceEnabled NOTIFY locationServiceEnabledChanged)
|
2015-11-14 17:10:06 +00:00
|
|
|
Q_PROPERTY(int distanceThreshold READ distanceThreshold WRITE setDistanceThreshold NOTIFY distanceThresholdChanged)
|
|
|
|
Q_PROPERTY(int timeThreshold READ timeThreshold WRITE setTimeThreshold NOTIFY timeThresholdChanged)
|
2015-06-04 10:29:50 +00:00
|
|
|
public:
|
|
|
|
QMLManager();
|
|
|
|
~QMLManager();
|
|
|
|
|
2015-07-10 07:47:26 +00:00
|
|
|
QString cloudUserName() const;
|
|
|
|
void setCloudUserName(const QString &cloudUserName);
|
|
|
|
|
|
|
|
QString cloudPassword() const;
|
|
|
|
void setCloudPassword(const QString &cloudPassword);
|
|
|
|
|
2015-07-21 08:57:10 +00:00
|
|
|
bool saveCloudPassword() const;
|
|
|
|
void setSaveCloudPassword(bool saveCloudPassword);
|
|
|
|
|
2015-11-11 20:34:56 +00:00
|
|
|
bool locationServiceEnabled() const;
|
|
|
|
void setLocationServiceEnabled(bool locationServiceEnable);
|
|
|
|
|
2015-11-14 17:10:06 +00:00
|
|
|
int distanceThreshold() const;
|
|
|
|
void setDistanceThreshold(int distance);
|
|
|
|
|
|
|
|
int timeThreshold() const;
|
|
|
|
void setTimeThreshold(int time);
|
|
|
|
|
2015-08-19 07:17:52 +00:00
|
|
|
QString logText() const;
|
|
|
|
void setLogText(const QString &logText);
|
|
|
|
void appendTextToLog(const QString &newText);
|
|
|
|
|
2015-06-04 10:29:50 +00:00
|
|
|
public slots:
|
2015-07-10 07:47:26 +00:00
|
|
|
void savePreferences();
|
2015-07-10 08:31:24 +00:00
|
|
|
void loadDives();
|
2015-07-17 15:28:01 +00:00
|
|
|
void commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes);
|
|
|
|
void saveChanges();
|
2015-08-10 05:35:47 +00:00
|
|
|
void addDive();
|
2015-11-13 04:23:00 +00:00
|
|
|
void applyGpsData();
|
2015-11-14 01:14:22 +00:00
|
|
|
void sendGpsData();
|
|
|
|
void clearGpsData();
|
2015-11-11 20:34:56 +00:00
|
|
|
|
2015-06-04 10:29:50 +00:00
|
|
|
private:
|
2015-07-10 07:47:26 +00:00
|
|
|
QString m_cloudUserName;
|
|
|
|
QString m_cloudPassword;
|
2015-11-14 01:14:22 +00:00
|
|
|
QString m_ssrfGpsWebUserid;
|
2015-07-21 08:57:10 +00:00
|
|
|
bool m_saveCloudPassword;
|
2015-08-19 07:17:52 +00:00
|
|
|
QString m_logText;
|
2015-11-11 20:34:56 +00:00
|
|
|
bool m_locationServiceEnabled;
|
2015-11-14 17:10:06 +00:00
|
|
|
int m_distanceThreshold;
|
|
|
|
int m_timeThreshold;
|
2015-11-11 20:34:56 +00:00
|
|
|
GpsLocation *locationProvider;
|
2015-06-04 10:29:50 +00:00
|
|
|
|
|
|
|
signals:
|
2015-07-10 07:47:26 +00:00
|
|
|
void cloudUserNameChanged();
|
|
|
|
void cloudPasswordChanged();
|
2015-07-21 08:57:10 +00:00
|
|
|
void saveCloudPasswordChanged();
|
2015-11-11 20:34:56 +00:00
|
|
|
void locationServiceEnabledChanged();
|
2015-08-19 07:17:52 +00:00
|
|
|
void logTextChanged();
|
2015-11-14 17:10:06 +00:00
|
|
|
void timeThresholdChanged();
|
|
|
|
void distanceThresholdChanged();
|
2015-06-04 10:29:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|