diff options
author | aunsane <aunsane@gmail.com> | 2018-04-11 23:37:53 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-04-11 23:38:18 +0300 |
commit | 98c8a49c029397c7e5b81e19292681f24a533e0e (patch) | |
tree | ace75eb705f679ed1e69742dcef85d1b2242f578 /plugins/CloudFile/src/Services | |
parent | 21fe9b80ff4030f76f68a90726bc29e49627414c (diff) |
CloudFile: Add "grant acess" link to CloudFile accounts (fixed #1260)
Diffstat (limited to 'plugins/CloudFile/src/Services')
8 files changed, 26 insertions, 9 deletions
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index 459983b935..34e779df1c 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -39,9 +39,11 @@ bool CDropboxService::IsLoggedIn() return true; } -void CDropboxService::Login() +void CDropboxService::Login(HWND owner) { - COAuthDlg(this, DROPBOX_API_AUTH, RequestAccessTokenThread).DoModal(); + COAuthDlg dlg(this, DROPBOX_API_AUTH, RequestAccessTokenThread); + dlg.SetParent(owner); + dlg.DoModal(); } void CDropboxService::Logout() @@ -104,6 +106,10 @@ unsigned CDropboxService::RevokeAccessTokenThread(void *param) DropboxAPI::RevokeAccessTokenRequest request(token); NLHR_PTR response(request.Send(service->m_hConnection)); + service->delSetting("ExpiresIn"); + service->delSetting("TokenSecret"); + service->delSetting("RefreshToken"); + return 0; } diff --git a/plugins/CloudFile/src/Services/dropbox_service.h b/plugins/CloudFile/src/Services/dropbox_service.h index fa481183c3..5289dc321c 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.h +++ b/plugins/CloudFile/src/Services/dropbox_service.h @@ -27,7 +27,7 @@ public: int GetIconId() const override; bool IsLoggedIn() override; - void Login() override; + void Login(HWND owner = nullptr) override; void Logout() override; UINT Upload(FileTransferParam *ftp) override; diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index 605d023200..fe5baa91e3 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -41,7 +41,7 @@ bool CGDriveService::IsLoggedIn() return now < expiresIn; } -void CGDriveService::Login() +void CGDriveService::Login(HWND owner) { ptrA token(getStringA("TokenSecret")); ptrA refreshToken(getStringA("RefreshToken")); @@ -62,6 +62,7 @@ void CGDriveService::Login() } COAuthDlg dlg(this, GOOGLE_AUTH, RequestAccessTokenThread); + dlg.SetParent(owner); dlg.DoModal(); } @@ -137,6 +138,10 @@ unsigned CGDriveService::RevokeAccessTokenThread(void *param) GDriveAPI::RevokeAccessTokenRequest request(token); NLHR_PTR response(request.Send(service->m_hConnection)); + service->delSetting("ExpiresIn"); + service->delSetting("TokenSecret"); + service->delSetting("RefreshToken"); + return 0; } diff --git a/plugins/CloudFile/src/Services/google_service.h b/plugins/CloudFile/src/Services/google_service.h index 9da2f14e5f..717e6314b0 100644 --- a/plugins/CloudFile/src/Services/google_service.h +++ b/plugins/CloudFile/src/Services/google_service.h @@ -26,7 +26,7 @@ public: int GetIconId() const override; bool IsLoggedIn() override; - void Login() override; + void Login(HWND owner = nullptr) override; void Logout() override; UINT Upload(FileTransferParam *ftp) override; diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp index 4b598e9bfb..05c4c5ca81 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.cpp +++ b/plugins/CloudFile/src/Services/microsoft_service.cpp @@ -41,7 +41,7 @@ bool COneDriveService::IsLoggedIn() return now < expiresIn; } -void COneDriveService::Login() +void COneDriveService::Login(HWND owner) { ptrA refreshToken(getStringA("RefreshToken")); if (refreshToken && refreshToken[0]) { @@ -61,6 +61,7 @@ void COneDriveService::Login() } COAuthDlg dlg(this, MICROSOFT_AUTH, RequestAccessTokenThread); + dlg.SetParent(owner); dlg.DoModal(); } diff --git a/plugins/CloudFile/src/Services/microsoft_service.h b/plugins/CloudFile/src/Services/microsoft_service.h index f9e41a93c5..8ae162d45e 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.h +++ b/plugins/CloudFile/src/Services/microsoft_service.h @@ -25,7 +25,7 @@ public: int GetIconId() const override; bool IsLoggedIn() override; - void Login() override; + void Login(HWND owner = nullptr) override; void Logout() override; UINT Upload(FileTransferParam *ftp) override; diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index f0b09adf4b..c3e32aa8c8 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -41,7 +41,7 @@ bool CYandexService::IsLoggedIn() return now < expiresIn; } -void CYandexService::Login() +void CYandexService::Login(HWND owner) { ptrA token(getStringA("TokenSecret")); ptrA refreshToken(getStringA("RefreshToken")); @@ -65,6 +65,7 @@ void CYandexService::Login() } COAuthDlg dlg(this, YANDEX_AUTH, RequestAccessTokenThread); + dlg.SetParent(owner); dlg.DoModal(); } @@ -139,6 +140,10 @@ unsigned CYandexService::RevokeAccessTokenThread(void *param) YandexAPI::RevokeAccessTokenRequest request(token); NLHR_PTR response(request.Send(service->m_hConnection)); + service->delSetting("ExpiresIn"); + service->delSetting("TokenSecret"); + service->delSetting("RefreshToken"); + return 0; } diff --git a/plugins/CloudFile/src/Services/yandex_service.h b/plugins/CloudFile/src/Services/yandex_service.h index 76a12feef0..fa18e0f2f2 100644 --- a/plugins/CloudFile/src/Services/yandex_service.h +++ b/plugins/CloudFile/src/Services/yandex_service.h @@ -26,7 +26,7 @@ public: int GetIconId() const override; bool IsLoggedIn() override; - void Login() override; + void Login(HWND owner = nullptr) override; void Logout() override; UINT Upload(FileTransferParam *ftp) override; |