summaryrefslogtreecommitdiff
path: root/protocols/CloudFile
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-04 17:03:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-04 17:03:28 +0300
commitf531ff887729783a7fe7a3e12ad12f658eefc7b0 (patch)
tree9e1844429448b6527ef7ca87163e44eafce250d8 /protocols/CloudFile
parent1c2e5d128a7176ae827dda1e2a8fcc64e772a148 (diff)
UI classes:
- CDlgBase::m_bSucceeded variable introduced to check whether IDOK was pressed or not; - unused/useless buttons with id=IDOK or IDCANCEL removed; - brnOk.OnClick replaced with OnApply calls; - unused/useless calls of EndDialog/EndModal removed; - minor code cleaning
Diffstat (limited to 'protocols/CloudFile')
-rw-r--r--protocols/CloudFile/src/oauth.cpp12
-rw-r--r--protocols/CloudFile/src/oauth.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/protocols/CloudFile/src/oauth.cpp b/protocols/CloudFile/src/oauth.cpp
index e62629fcd8..aeeba741c4 100644
--- a/protocols/CloudFile/src/oauth.cpp
+++ b/protocols/CloudFile/src/oauth.cpp
@@ -8,7 +8,6 @@ COAuthDlg::COAuthDlg(CCloudService *service, const char *authUrl, CCloudService:
{
m_autoClose = CLOSE_ON_CANCEL;
m_code.OnChange = Callback(this, &COAuthDlg::Code_OnChange);
- m_ok.OnClick = Callback(this, &COAuthDlg::Ok_OnClick);
}
bool COAuthDlg::OnInitDialog()
@@ -21,13 +20,14 @@ bool COAuthDlg::OnInitDialog()
return true;
}
+bool COAuthDlg::OnApply()
+{
+ m_service->ForkThread(m_requestAccessTokenThread, m_hwnd);
+ return true;
+}
+
void COAuthDlg::Code_OnChange(CCtrlBase*)
{
ptrA requestToken(m_code.GetTextA());
m_ok.Enable(mir_strlen(requestToken) != 0);
}
-
-void COAuthDlg::Ok_OnClick(CCtrlButton*)
-{
- m_service->ForkThread(m_requestAccessTokenThread, m_hwnd);
-} \ No newline at end of file
diff --git a/protocols/CloudFile/src/oauth.h b/protocols/CloudFile/src/oauth.h
index 2b32ecbd9b..24f755fc79 100644
--- a/protocols/CloudFile/src/oauth.h
+++ b/protocols/CloudFile/src/oauth.h
@@ -6,15 +6,15 @@ class COAuthDlg : public CDlgBase
CCloudService *m_service;
CCloudService::MyThreadFunc m_requestAccessTokenThread;
+ CCtrlButton m_ok;
CCtrlHyperlink m_authorize;
CCtrlEdit m_code;
- CCtrlButton m_ok;
protected:
bool OnInitDialog() override;
+ bool OnApply() override;
void Code_OnChange(CCtrlBase*);
- void Ok_OnClick(CCtrlButton*);
public:
COAuthDlg(CCloudService *service, const char *authUrl, CCloudService::MyThreadFunc requestAccessTokenThread);