diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-15 09:41:03 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-15 09:41:03 +0000 |
commit | 1aa8530b2d4dfa6d6f424903fc67c87682a0267e (patch) | |
tree | 2ec9f4348c09bbd1a53c153863cd7aaa063ddd30 /protocols/SkypeWeb | |
parent | c59762e958cc7f412379ce4b90d378f0c6b62022 (diff) |
SkypeWeb: Invite dialog -> core ui
git-svn-id: http://svn.miranda-ng.org/main/trunk@14563 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 44 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.h | 20 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 1 |
4 files changed, 26 insertions, 41 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index a5f8d4aa61..275f86437f 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -178,7 +178,12 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) switch (gch->dwData)
{
case 10: {
- MCONTACT hContact = (MCONTACT)DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_GC_INVITE), NULL, InviteDlgProc, (LPARAM)this);
+ CSkypeInviteDlg dlg(this);
+ if(!dlg.DoModal())
+ {
+ break;
+ }
+ MCONTACT hContact = dlg.m_hContact;
if (hContact != NULL)
{
ptrA username(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID));
@@ -668,43 +673,6 @@ INT_PTR CSkypeProto::GcCreateDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
}
-INT_PTR CSkypeProto::InviteDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- CSkypeProto *ppro = (CSkypeProto*)lParam;
- HWND hwndCombo = GetDlgItem(hwndDlg, IDC_CONTACT);
- for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
- if (ppro->isChatRoom(hContact)) continue;
- TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
- int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, LPARAM(ptszNick));
- SendMessage(hwndCombo, CB_SETITEMDATA, idx, hContact);
- }
- SendMessage(hwndCombo, CB_SETCURSEL, 0, 0);
- }
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDCANCEL:
- EndDialog(hwndDlg, 0);
- return TRUE;
-
- case IDOK:
- int idx = SendDlgItemMessage(hwndDlg, IDC_CONTACT, CB_GETCURSEL, 0, 0);
- if (idx != -1)
- EndDialog(hwndDlg, SendDlgItemMessage(hwndDlg, IDC_CONTACT, CB_GETITEMDATA, idx, 0));
- else
- EndDialog(hwndDlg, 0);
- return TRUE;
- }
- }
-
- return 0;
-}
-
void CSkypeProto::FilterContacts(HWND hwndDlg, CSkypeProto *ppro)
{
HWND hwndClist = GetDlgItem(hwndDlg, IDC_CLIST);
diff --git a/protocols/SkypeWeb/src/skype_dialogs.h b/protocols/SkypeWeb/src/skype_dialogs.h index 1fbc7ec80c..cf6f5df671 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.h +++ b/protocols/SkypeWeb/src/skype_dialogs.h @@ -55,4 +55,24 @@ public: }
};
+class CSkypeInviteDlg : public CSkypeDlgBase
+{
+private:
+ typedef CSkypeDlgBase CSuper;
+ CCtrlButton m_ok;
+ CCtrlButton m_cancel;
+ CCtrlCombo m_combo;
+
+protected:
+
+ void OnInitDialog();
+ void btnOk_OnOk(CCtrlButton*);
+
+public:
+ MCONTACT m_hContact;
+
+ CSkypeInviteDlg(CSkypeProto *proto);
+};
+
+
#endif //_SKYPE_DIALOGS_H_
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index b02cfcde83..edc211f175 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -134,8 +134,6 @@ MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT hDbEvent) char *lastName = firstName + mir_strlen(firstName) + 1;
char *skypename = lastName + mir_strlen(lastName) + 1;
- debugLogA(__FUNCTION__ " %s", mir_utf8decodeA(skypename));
-
MCONTACT hContact = AddContact(skypename);
return hContact;
}
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 166d6fa3a8..e52021a1e9 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -285,7 +285,6 @@ private: void RenameChat(const char *chat_id, const char *name);
void ChangeChatTopic(const char * chat_id, const char *topic, const char *initiator);
- static INT_PTR CALLBACK InviteDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK GcCreateDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static void ResetOptions(HWND hwndDlg);
|