summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/oauth.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-04-16 01:32:19 +0300
committeraunsane <aunsane@gmail.com>2017-04-16 01:32:58 +0300
commit0b9fa1d90f8d0aff7118837ceb1211b578a5a9c8 (patch)
tree3b8be7b839a98a3a52a38d713c2d708ada015510 /plugins/CloudFile/src/oauth.cpp
parent008fb731e3e3b587f596afba1cfe7446de7f0cac (diff)
CloudFile: initial commit
- Dropbox (worked) - Yandex.Disk (worked) - GDrive (not worked)
Diffstat (limited to 'plugins/CloudFile/src/oauth.cpp')
-rw-r--r--plugins/CloudFile/src/oauth.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/oauth.cpp b/plugins/CloudFile/src/oauth.cpp
new file mode 100644
index 0000000000..7815c27771
--- /dev/null
+++ b/plugins/CloudFile/src/oauth.cpp
@@ -0,0 +1,23 @@
+#include "stdafx.h"
+
+COAuthDlg::COAuthDlg(CCloudService *service, const char *authUrl, pThreadFuncOwner requestAccessTokenThread)
+ : CDlgBase(hInstance, IDD_OAUTH), m_service(service),
+ m_requestAccessTokenThread(requestAccessTokenThread),
+ m_auth(this, IDC_OAUTH_AUTHORIZE, authUrl),
+ m_code(this, IDC_OAUTH_CODE), m_ok(this, IDOK)
+{
+ m_autoClose = CLOSE_ON_CANCEL;
+ m_code.OnChange = Callback(this, &COAuthDlg::Code_OnChange);
+ m_ok.OnClick = Callback(this, &COAuthDlg::Ok_OnClick);
+}
+
+void COAuthDlg::Code_OnChange(CCtrlBase*)
+{
+ ptrA requestToken(m_code.GetTextA());
+ m_ok.Enable(mir_strlen(requestToken) != 0);
+}
+
+void COAuthDlg::Ok_OnClick(CCtrlButton*)
+{
+ mir_forkthreadowner(m_requestAccessTokenThread, m_service, m_hwnd);
+} \ No newline at end of file