13 #ifndef __LOGINMANAGER_H__ 14 #define __LOGINMANAGER_H__ 64 void onGetUserReply(QNetworkReply* reply,
int code,
const QJsonObject& replyContent);
65 void onLoginReply(QNetworkReply* reply,
int code,
const QJsonObject& replyContent);
67 void onUploadReply(QNetworkReply* reply,
int code,
const QJsonObject& replyContent);
69 void onGetMediaUrlReply(QNetworkReply* reply,
int code,
const QJsonObject& replyContent);
79 void getScoreSuccess(
const QString &title,
const QString &description,
bool priv,
const QString& license,
const QString& tags,
const QString& url);
81 void uploadSuccess(
const QString& url,
const QString& nid,
const QString& vid);
97 LoginManager(QAction* uploadAudioMenuAction, QObject* parent = 0);
100 void loginInteractive();
102 void upload(
const QString& path,
int nid,
const QString& title);
107 void getMediaUrl(
const QString& nid,
const QString& vid,
const QString& format);
void upload(const QString &path, int nid, const QString &title)
Definition: loginmanager.cpp:704
void onGetMediaUrlReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:603
ApiRequest * buildLoginRefreshRequest() const
Definition: loginmanager.cpp:427
void getScoreInfo(int nid)
Definition: loginmanager.cpp:525
QString _userName
Definition: loginmanager.h:48
LoginManager(QAction *uploadAudioMenuAction, QObject *parent=0)
Definition: loginmanager.cpp:154
void onLoginRefreshReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:462
static constexpr int MAX_UPLOAD_TRY_COUNT
Definition: loginmanager.h:40
void onGetScoreInfoReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:549
void mediaUploadFinished()
Definition: loginmanager.cpp:660
void onLoginReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:442
bool save()
Definition: loginmanager.cpp:169
void getUser()
Definition: loginmanager.cpp:481
bool hasAccessToken()
Definition: loginmanager.cpp:805
Definition: loginmanager_p.h:79
QString _updateScoreDataPath
Definition: loginmanager.h:52
void mediaUploadProgress(qint64, qint64)
Definition: loginmanager.cpp:691
QString _accessToken
Definition: loginmanager.h:46
Definition: loginmanager.h:26
bool logout()
Definition: loginmanager.cpp:814
void getScoreSuccess(const QString &title, const QString &description, bool priv, const QString &license, const QString &tags, const QString &url)
const QUrl & avatar() const
Definition: loginmanager.h:116
static QString getErrorString(QNetworkReply *, const QJsonObject &)
Definition: loginmanager.cpp:289
static constexpr int MAX_REFRESH_LOGIN_RETRY_COUNT
Definition: loginmanager.h:41
int _uid
Definition: loginmanager.h:50
void mediaUploadSuccess()
bool load()
Definition: loginmanager.cpp:189
void getScoreError(const QString &error)
QProgressDialog * _progressDialog
Definition: loginmanager.h:58
QNetworkAccessManager * _networkManager
Definition: loginmanager.h:43
void uploadSuccess(const QString &url, const QString &nid, const QString &vid)
RequestType
Definition: loginmanager.h:30
void loginError(const QString &error)
void updateScoreData(const QString &nid, bool newScore)
Definition: loginmanager.cpp:776
Definition: aeolus.cpp:26
void tryLogin()
Definition: loginmanager.cpp:304
void uploadMedia()
Definition: loginmanager.cpp:629
QString _refreshToken
Definition: loginmanager.h:47
QFile * _mp3File
Definition: loginmanager.h:55
QUrl _avatar
Definition: loginmanager.h:49
int _uploadTryCount
Definition: loginmanager.h:56
void uploadError(const QString &error)
void getMediaUrl(const QString &nid, const QString &vid, const QString &format)
Definition: loginmanager.cpp:583
void onReplyFinished(ApiRequest *, RequestType)
Definition: loginmanager.cpp:207
void handleReply(QNetworkReply *, RequestType)
Definition: loginmanager.cpp:248
QString _mediaUrl
Definition: loginmanager.h:54
void onUploadReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:754
QAction * _uploadAudioMenuAction
Definition: loginmanager.h:45
const QString & userName() const
Definition: loginmanager.h:114
void onGetUserReply(QNetworkReply *reply, int code, const QJsonObject &replyContent)
Definition: loginmanager.cpp:504
void onTryLoginError(const QString &)
Definition: loginmanager.cpp:327
void getUserError(const QString &error)
int uid() const
Definition: loginmanager.h:115
void login(QString login, QString password)
Definition: loginmanager.cpp:405
void onTryLoginSuccess()
Definition: loginmanager.cpp:316