diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/stat/desktop/source/desktop/src/statmanageconnection.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testtoolsconn/stat/desktop/source/desktop/src/statmanageconnection.cpp Mon Mar 08 15:04:18 2010 +0800 @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + +#include "stdafx.h" +#include "statdesktop.h" +#include "STATManageConnection.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +// global var to hold our selection when we exit the dialog +CString cConnectionInfo; + +///////////////////////////////////////////////////////////////////////////// +// STATManageConnection dialog + + +STATManageConnection::STATManageConnection(CWnd* pParent /*=NULL*/) + : CDialog(STATManageConnection::IDD, pParent) +{ + //{{AFX_DATA_INIT(STATManageConnection) + //}}AFX_DATA_INIT +} + + +void STATManageConnection::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(STATManageConnection) + DDX_Control(pDX, IDC_ADDRESS, m_Address); + DDX_Control(pDX, IDC_TRANSPORT, m_Transport); + DDX_Control(pDX, IDC_LISTCONNECTIONS, m_ListConnections); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(STATManageConnection, CDialog) + //{{AFX_MSG_MAP(STATManageConnection) + ON_BN_CLICKED(IDC_REMOVE, OnRemove) + ON_BN_CLICKED(IDC_ADD, OnAdd) + ON_LBN_SELCHANGE(IDC_LISTCONNECTIONS, OnSelchangeListconnections) + ON_CBN_SELCHANGE(IDC_TRANSPORT, OnSelchangeTransport) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// STATManageConnection message handlers + +BOOL STATManageConnection::OnInitDialog() +{ + CDialog::OnInitDialog(); + + cConnectionInfo.ReleaseBuffer(); + m_Transport.SetCurSel(2); + statIniFile.SetIniFileName(STAT_INI_NAME); + CString setting; +// lCount = 0; + if(statIniFile.SectionExists(ST_TEST_KEY) ) + { + + lCount = 0; + setting.Empty(); + setting=statIniFile.GetKeyValue(ST_CONNECTIONIDX,ST_TEST_KEY); + if(!setting.IsEmpty()) + { + lCount = _ttol(setting); + m_ListConnections.SetCurSel(lCount); + OnSelchangeListconnections(); + } + } + + if(statIniFile.SectionExists(ST_CONNECTION_LIST) ) + { + for( int i=0;i