From df73a896acdae7c5a8f4f73e81b9d1437d2a415d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 20 Oct 2013 12:41:42 +0000 Subject: options page added git-svn-id: http://svn.miranda-ng.org/main/trunk@6551 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/res/whatsapp.rc | 24 ++++++++++++++++++++++++ protocols/WhatsApp/src/proto.cpp | 18 ++++++++++++++++++ protocols/WhatsApp/src/proto.h | 3 ++- protocols/WhatsApp/src/resource.h | 3 ++- protocols/WhatsApp/src/version.h | 4 ++-- 5 files changed, 48 insertions(+), 4 deletions(-) (limited to 'protocols/WhatsApp') diff --git a/protocols/WhatsApp/res/whatsapp.rc b/protocols/WhatsApp/res/whatsapp.rc index 89ff6d221b..f9f45597b7 100644 --- a/protocols/WhatsApp/res/whatsapp.rc +++ b/protocols/WhatsApp/res/whatsapp.rc @@ -94,6 +94,30 @@ BEGIN LTEXT "Use WART utility from Plugins folder for registering your number and generating password",IDC_STATIC,6,85,174,22 END +IDD_WHATSAPOPTIONS DIALOGEX 0, 0, 185, 168 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 400, 0, 0x0 +BEGIN + LTEXT "Phone-Number",IDC_STATIC,6,6,48,8 + EDITTEXT IDC_LOGIN,84,6,95,12,ES_AUTOHSCROLL + LTEXT "Including country code, without '+' or '00'",IDC_STATIC,66,21,118,17 + LTEXT "Password",IDC_STATIC,6,60,47,8 + EDITTEXT IDC_PW,60,60,119,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Nickname",IDC_STATIC,6,42,48,12 + EDITTEXT IDC_NICK,60,42,120,12,ES_AUTOHSCROLL + PUSHBUTTON "Request Code",IDC_BUTTON_REQUEST_CODE,6,150,54,17,NOT WS_VISIBLE | WS_DISABLED + PUSHBUTTON "Register Code",IDC_BUTTON_REGISTER,66,149,60,18,NOT WS_VISIBLE | WS_DISABLED + EDITTEXT IDC_CC,60,6,24,12,ES_AUTOHSCROLL + LTEXT "SMS-Code:",IDC_STATIC,6,120,36,8,NOT WS_VISIBLE | WS_DISABLED + EDITTEXT IDC_REG_CODE_1,60,120,24,12,ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED + LTEXT "-",IDC_STATIC,86,122,8,12,NOT WS_VISIBLE | WS_DISABLED + EDITTEXT IDC_REG_CODE_2,90,120,24,12,ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED + LTEXT "Will only be used for registration",IDC_STATIC,66,134,108,10,NOT WS_VISIBLE | WS_DISABLED + CONTROL "Use SSL connection (443 port)",IDC_SSL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,108,120,10 + LTEXT "Paste password from WART utility",IDC_STATIC,65,76,111,8 + LTEXT "Use WART utility from Plugins folder for registering your number and generating password",IDC_STATIC,6,85,174,22 +END + IDD_INPUTBOX DIALOGEX 0, 0, 300, 66 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOPMOST diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 648accab5b..69f5931026 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -16,6 +16,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::OnChatOutgoing); HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu); + HookProtoEvent(ME_OPT_INITIALISE, &WhatsAppProto::OnOptionsInit); this->InitContactMenus(); @@ -282,6 +283,23 @@ INT_PTR WhatsAppProto::SvcCreateAccMgrUI(WPARAM wParam,LPARAM lParam) (HWND)lParam, WhatsAppAccountProc, (LPARAM)this ); } +int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = {sizeof(odp)}; + odp.hInstance = g_hInstance; + odp.ptszTitle = m_tszUserName; + odp.dwInitParam = LPARAM(this); + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + + odp.position = 1; + odp.ptszGroup = LPGENT("Network"); + odp.ptszTab = LPGENT("Account"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_WHATSAPOPTIONS); + odp.pfnDlgProc = WhatsAppAccountProc; + Options_AddPage(wParam, &odp); + return 0; +} + int WhatsAppProto::RefreshBuddyList(WPARAM, LPARAM ) { debugLogA(""); diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 10969f44fb..0afa3e3a55 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -81,10 +81,11 @@ public: //////////////////////// // Services - INT_PTR __cdecl SvcCreateAccMgrUI( WPARAM, LPARAM); + INT_PTR __cdecl SvcCreateAccMgrUI( WPARAM, LPARAM); INT_PTR __cdecl OnJoinChat(WPARAM, LPARAM); INT_PTR __cdecl OnLeaveChat(WPARAM, LPARAM); INT_PTR __cdecl OnCreateGroup(WPARAM,LPARAM); + int __cdecl OnOptionsInit(WPARAM, LPARAM); int __cdecl RefreshBuddyList(WPARAM, LPARAM); int __cdecl RequestFriendship(WPARAM, LPARAM); diff --git a/protocols/WhatsApp/src/resource.h b/protocols/WhatsApp/src/resource.h index 1c2d4f26a9..764ea8dd5f 100644 --- a/protocols/WhatsApp/src/resource.h +++ b/protocols/WhatsApp/src/resource.h @@ -5,6 +5,7 @@ #define IDD_WHATSAPPACCOUNT 101 #define IDD_INPUTBOX 102 #define IDR_REGISTERUTILITY 103 +#define IDD_WHATSAPOPTIONS 104 #define IDI_WHATSAPP 203 #define IDI_ADD_GROUP 206 #define IDI_ADD_USER_TO_GROUP 207 @@ -32,7 +33,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 112 +#define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1019 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/protocols/WhatsApp/src/version.h b/protocols/WhatsApp/src/version.h index c3d1f6f9c6..9146119e20 100644 --- a/protocols/WhatsApp/src/version.h +++ b/protocols/WhatsApp/src/version.h @@ -7,10 +7,10 @@ #define __TOSTRING(x) #x #define __VERSION_STRING __TOSTRING(__FILEVERSION_STRING) -#define __PLUGIN_NAME "WhatsApp" +#define __PLUGIN_NAME "WhatsApp protocol" #define __FILENAME "WhatsApp.dll" #define __DESCRIPTION "WhatsApp protocol support for Miranda NG." #define __AUTHOR "Uli Hecht" #define __AUTHOREMAIL "" #define __AUTHORWEB "http://miranda-ng.org/p/WhatsApp/" -#define __COPYRIGHT "© 2013 Uli Hecht" +#define __COPYRIGHT "© 2013 Uli Hecht" -- cgit v1.2.3