|
|
|
|
// DlgDevListImpl.cpp: implementation of the CDlgDevListImpl class.
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#include "DlgDevListImpl.h"
|
|
|
|
|
#include <qvariant.h>
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
#include <qtable.h>
|
|
|
|
|
#include <qlayout.h>
|
|
|
|
|
#include <qtooltip.h>
|
|
|
|
|
#include <qwhatsthis.h>
|
|
|
|
|
|
|
|
|
|
#include "qt_public.h"
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Construction/Destruction
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
const char* gColumnName[MAX_NET_NUM+1] = {"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>","IP<EFBFBD><EFBFBD>ַ1","IP<EFBFBD><EFBFBD>ַ2","IP<EFBFBD><EFBFBD>ַ3"};
|
|
|
|
|
|
|
|
|
|
CDlgDevListImpl::CDlgDevListImpl(DEV_DEF *pDevParam, int iDevNum, int iCurSel, QWidget* parent, const char* name, bool modal, WFlags fl)
|
|
|
|
|
: DevList(parent, name, modal, fl)
|
|
|
|
|
{
|
|
|
|
|
int i, j;
|
|
|
|
|
char sztmp[128];
|
|
|
|
|
|
|
|
|
|
m_iCurSelect = 0;
|
|
|
|
|
languageChange();
|
|
|
|
|
|
|
|
|
|
m_CTableDevList->setNumRows(iDevNum);
|
|
|
|
|
m_CTableDevList->setNumCols(MAX_NET_NUM+1);
|
|
|
|
|
|
|
|
|
|
QHeader *pHorHeader = m_CTableDevList->horizontalHeader();
|
|
|
|
|
for(i=0; i<(MAX_NET_NUM+1); i++)
|
|
|
|
|
{
|
|
|
|
|
pHorHeader->setLabel(i, CHS(gColumnName[i]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(i=0; i<iDevNum; i++)
|
|
|
|
|
{
|
|
|
|
|
sprintf(sztmp, "%d", i+1);
|
|
|
|
|
m_CTableDevList->setText(i, 0, CHS(sztmp));
|
|
|
|
|
|
|
|
|
|
for(j=0; j<MAX_NET_NUM; j++)
|
|
|
|
|
{
|
|
|
|
|
sprintf(sztmp, "%d.%d.%d.%d",
|
|
|
|
|
((pDevParam[i].IpAddr[j]>>24)&0xFF),
|
|
|
|
|
((pDevParam[i].IpAddr[j]>>16)&0xFF),
|
|
|
|
|
((pDevParam[i].IpAddr[j]>>8)&0xFF),
|
|
|
|
|
(pDevParam[i].IpAddr[j]&0xFF));
|
|
|
|
|
m_CTableDevList->setText(i, j+1, CHS(sztmp));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(i=0; i<(MAX_NET_NUM+1); i++)
|
|
|
|
|
{
|
|
|
|
|
m_CTableDevList->adjustColumn( i );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_CTableDevList->selectRow(iCurSel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CDlgDevListImpl::~CDlgDevListImpl()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CDlgDevListImpl::languageChange()
|
|
|
|
|
{
|
|
|
|
|
setCaption(CHS("<EFBFBD>豸<EFBFBD>б<EFBFBD>"));
|
|
|
|
|
m_BtnChange->setText(CHS("ѡ<EFBFBD><EFBFBD>"));
|
|
|
|
|
m_BtnCancel->setText(CHS("ȡ<EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDlgDevListImpl::ChangeSelectSlot()
|
|
|
|
|
{
|
|
|
|
|
m_iCurSelect = m_CTableDevList->currentRow();
|
|
|
|
|
}
|