File: GetUserInfoDlg.cpp

package info (click to toggle)
openmohaa 0.81.1%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 29,124 kB
  • sloc: ansic: 270,865; cpp: 250,173; sh: 234; asm: 141; xml: 64; makefile: 7
file content (80 lines) | stat: -rw-r--r-- 1,875 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// GetUserInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "chatty.h"
#include "GetUserInfoDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGetUserInfoDlg dialog


CGetUserInfoDlg::CGetUserInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGetUserInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGetUserInfoDlg)
	m_address = _T("");
	m_name = _T("");
	m_user = _T("");
	m_nick = _T("");
	//}}AFX_DATA_INIT
}


void CGetUserInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGetUserInfoDlg)
	DDX_Control(pDX, IDC_CHANNELS, m_channels);
	DDX_Text(pDX, IDC_ADDRESS, m_address);
	DDX_Text(pDX, IDC_NAME, m_name);
	DDX_Text(pDX, IDC_USER, m_user);
	DDX_Text(pDX, IDC_NICK, m_nick);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGetUserInfoDlg, CDialog)
	//{{AFX_MSG_MAP(CGetUserInfoDlg)
	ON_BN_CLICKED(ID_GET_INFO, OnGetInfo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGetUserInfoDlg message handlers

void GetUserInfoCallback(CHAT chat, CHATBool success, const char * nick, const char * user, const char * name, const char * address, int numChannels, const char ** channels, void * param)
{
	CGetUserInfoDlg * dlg = (CGetUserInfoDlg *)param;
	
	if(success)
	{
		dlg->m_user = user;
		dlg->m_name = name;
		dlg->m_address = address;
		dlg->UpdateData(FALSE);
		dlg->m_channels.ResetContent();
		for(int i = 0 ; i < numChannels ; i++)
			dlg->m_channels.AddString(channels[i]);
	}

	dlg->MessageBox("done");
   
	GSI_UNUSED(nick);
	GSI_UNUSED(chat);
}

void CGetUserInfoDlg::OnGetInfo() 
{
	if(theApp.m_chat != NULL)
	{
		UpdateData();
		chatGetUserInfo(theApp.m_chat, m_nick, GetUserInfoCallback, this, CHATTrue);
	}
}