summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-10 19:56:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-10 19:56:54 +0300
commit83402fe2934d403c8d3a436baed5261cd315dc85 (patch)
tree029a931b63a04bb6c9f4e45f5a797f5108da120c /protocols/Discord/src
parent9a31e2054ab52d1e6704acf3c93750448f8944ca (diff)
account manager dialog for Discord
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/options.cpp14
-rw-r--r--protocols/Discord/src/proto.cpp1
-rw-r--r--protocols/Discord/src/proto.h2
-rw-r--r--protocols/Discord/src/resource.h13
4 files changed, 20 insertions, 10 deletions
diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp
index 2114e47af9..c52424ce6f 100644
--- a/protocols/Discord/src/options.cpp
+++ b/protocols/Discord/src/options.cpp
@@ -25,8 +25,8 @@ class CDiscardAccountOptions : public CProtoDlgBase<CDiscordProto>
ptrW m_wszOldGroup;
public:
- CDiscardAccountOptions(CDiscordProto *ppro) :
- CProtoDlgBase<CDiscordProto>(ppro, IDD_OPTIONS_ACCOUNT),
+ CDiscardAccountOptions(CDiscordProto *ppro, int iDlgID) :
+ CProtoDlgBase<CDiscordProto>(ppro, iDlgID, false),
m_edGroup(this, IDC_GROUP),
m_edUserName(this, IDC_USERNAME),
m_edPassword(this, IDC_PASSWORD),
@@ -55,6 +55,14 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
+INT_PTR CDiscordProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent)
+{
+ CDiscardAccountOptions *pDlg = new CDiscardAccountOptions(this, IDD_OPTIONS_ACCMGR);
+ pDlg->SetParent((HWND)hwndParent);
+ pDlg->Create();
+ return (INT_PTR)pDlg->GetHwnd();
+}
+
int CDiscordProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
@@ -65,7 +73,7 @@ int CDiscordProto::OnOptionsInit(WPARAM wParam, LPARAM)
odp.position = 1;
odp.szTab.w = LPGENW("Account");
- odp.pDialog = new CDiscardAccountOptions(this);
+ odp.pDialog = new CDiscardAccountOptions(this, IDD_OPTIONS_ACCOUNT);
Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index 5d72ea501a..e8ac7c269c 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -37,6 +37,7 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) :
{
// Services
CreateProtoService(PS_GETSTATUS, &CDiscordProto::GetStatus);
+ CreateProtoService(PS_CREATEACCMGRUI, &CDiscordProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETAVATARINFO, &CDiscordProto::GetAvatarInfo);
CreateProtoService(PS_GETAVATARCAPS, &CDiscordProto::GetAvatarCaps);
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index c3cbae6d4a..21f59e3377 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -210,7 +210,9 @@ public:
virtual int __cdecl OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM) override;
// Services
+ INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl GetStatus(WPARAM, LPARAM);
+
INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM);
diff --git a/protocols/Discord/src/resource.h b/protocols/Discord/src/resource.h
index 840b444d17..20a3000f8c 100644
--- a/protocols/Discord/src/resource.h
+++ b/protocols/Discord/src/resource.h
@@ -1,17 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by twitter.rc
+// Used by w:\miranda-ng\protocols\Discord\res\discord.rc
//
-
#define IDI_MAIN 101
#define IDI_OFFLINE 102
#define IDD_OPTIONS_ACCOUNT 103
#define IDD_EXTSEARCH 104
-
-#define IDC_PASSWORD 1001
-#define IDC_USERNAME 1002
-#define IDC_GROUP 1003
-#define IDC_NICK 1004
+#define IDD_OPTIONS_ACCMGR 105
+#define IDC_PASSWORD 1001
+#define IDC_USERNAME 1002
+#define IDC_GROUP 1003
+#define IDC_NICK 1004
// Next default values for new objects
//