Showing the changes to interface/src/scripting/GlobalServicesScriptingInterface.h (1 of 3 files). Show all
Unified · Split
| @@ -31,20 +31,21 @@ Q_DECLARE_METATYPE(DownloadInfoResult) · 30 unmodified lines | |||
| 31 | QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result); | 31 | QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result); |
| 32 | void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoResult& result); | 32 | void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoResult& result); |
| 33 | 33 | ||
| 34 | |||
| 35 | class GlobalServicesScriptingInterface : public QObject { | 34 | class GlobalServicesScriptingInterface : public QObject { |
| 36 | Q_OBJECT | 35 | Q_OBJECT |
| 37 | Q_PROPERTY(QString myUsername READ getMyUsername) | 36 | |
| 38 | GlobalServicesScriptingInterface(); | 37 | Q_PROPERTY(QString username READ getUsername) |
| 39 | ~GlobalServicesScriptingInterface(); | 38 | |
| 40 | public: | 39 | public: |
| 41 | static GlobalServicesScriptingInterface* getInstance(); | 40 | static GlobalServicesScriptingInterface* getInstance(); |
| 42 | 41 | ||
| 43 | QString getMyUsername(); | 42 | const QString& getUsername() const { return AccountManager::getInstance().getAccountInfo().getUsername(); } |
| 44 | 43 | ||
| 45 | public slots: | 44 | public slots: |
| 46 | DownloadInfoResult getDownloadInfo(); | 45 | DownloadInfoResult getDownloadInfo(); |
| 47 | void updateDownloadInfo(); | 46 | void updateDownloadInfo(); |
| 47 | |||
| 48 | void setDiscoverability(const QString& discoverability); | ||
| 48 | 49 | ||
| 49 | private slots: | 50 | private slots: |
| 50 | void loggedOut(); | 51 | void loggedOut(); |
| @@ -53,12 +54,13 @@ private slots: · 2 unmodified lines | |||
| 53 | signals: | 54 | signals: |
| 54 | void connected(); | 55 | void connected(); |
| 55 | void disconnected(const QString& reason); | 56 | void disconnected(const QString& reason); |
| 56 | void incomingMessage(const QString& username, const QString& message); | ||
| 57 | void onlineUsersChanged(const QStringList& usernames); | ||
| 58 | void myUsernameChanged(const QString& username); | 57 | void myUsernameChanged(const QString& username); |
| 59 | void downloadInfoChanged(DownloadInfoResult info); | 58 | void downloadInfoChanged(DownloadInfoResult info); |
| 60 | 59 | ||
| 61 | private: | 60 | private: |
| 61 | GlobalServicesScriptingInterface(); | ||
| 62 | ~GlobalServicesScriptingInterface(); | ||
| 63 | |||
| 62 | bool _downloading; | 64 | bool _downloading; |
| 63 | }; | 65 | }; |
| 64 | 66 | ||