summaryrefslogtreecommitdiff
path: root/protocols/Discord
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
parent9a31e2054ab52d1e6704acf3c93750448f8944ca (diff)
account manager dialog for Discord
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/res/discord.rc26
-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
5 files changed, 40 insertions, 16 deletions
diff --git a/protocols/Discord/res/discord.rc b/protocols/Discord/res/discord.rc
index fc31363075..b8b5e4ae5a 100644
--- a/protocols/Discord/res/discord.rc
+++ b/protocols/Discord/res/discord.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +32,7 @@ END
2 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winres.h""\r\n"
"\0"
END
@@ -44,6 +44,7 @@ END
#endif // APSTUDIO_INVOKED
+
/////////////////////////////////////////////////////////////////////////////
//
// Icon
@@ -51,9 +52,8 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-
-IDI_MAIN ICON "discord.ico"
-IDI_OFFLINE ICON "offline.ico"
+IDI_MAIN ICON "discord.ico"
+IDI_OFFLINE ICON "offline.ico"
/////////////////////////////////////////////////////////////////////////////
//
@@ -70,12 +70,26 @@ BEGIN
EDITTEXT IDC_USERNAME,84,18,123,13,ES_AUTOHSCROLL
LTEXT "Password:",IDC_STATIC,17,36,61,8,0,WS_EX_RIGHT
EDITTEXT IDC_PASSWORD,84,34,123,13,ES_PASSWORD | ES_AUTOHSCROLL
-
GROUPBOX "Contacts",IDC_STATIC,7,77,291,88
LTEXT "Default group:",IDC_STATIC,17,91,61,8,0,WS_EX_RIGHT
EDITTEXT IDC_GROUP,84,89,123,13,ES_AUTOHSCROLL
END
+IDD_OPTIONS_ACCMGR DIALOGEX 0, 0, 200, 88
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "User details",IDC_STATIC,7,7,178,46
+ LTEXT "E-mail:",IDC_STATIC,17,20,69,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_USERNAME,92,18,86,13,ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,17,36,69,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_PASSWORD,92,34,86,13,ES_PASSWORD | ES_AUTOHSCROLL
+ GROUPBOX "Contacts",IDC_STATIC,7,56,178,28
+ LTEXT "Default group:",IDC_STATIC,17,67,69,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_GROUP,92,65,86,13,ES_AUTOHSCROLL
+END
+
IDD_EXTSEARCH DIALOGEX 0, 0, 114, 55
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
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
//