load stored IP addresses in connect dialog
This commit is contained in:
parent
f2d4229a88
commit
0dae88285a
3 changed files with 1381 additions and 1368 deletions
|
@ -53,19 +53,6 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
||||||
LineEditServerAddr->setMaxCount ( MAX_NUM_SERVER_ADDR_ITEMS );
|
LineEditServerAddr->setMaxCount ( MAX_NUM_SERVER_ADDR_ITEMS );
|
||||||
LineEditServerAddr->setInsertPolicy ( QComboBox::InsertAtTop );
|
LineEditServerAddr->setInsertPolicy ( QComboBox::InsertAtTop );
|
||||||
|
|
||||||
// load data from ini file
|
|
||||||
for ( int iLEIdx = 0; iLEIdx < MAX_NUM_SERVER_ADDR_ITEMS; iLEIdx++ )
|
|
||||||
{
|
|
||||||
// if ( !pClient->vstrIPAddress[iLEIdx].isEmpty() )
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// LineEditServerAddr->addItem ( pClient->vstrIPAddress[iLEIdx] );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up list view for connected clients
|
// set up list view for connected clients
|
||||||
ListViewServers->setColumnWidth ( 0, 170 );
|
ListViewServers->setColumnWidth ( 0, 170 );
|
||||||
ListViewServers->setColumnWidth ( 1, 130 );
|
ListViewServers->setColumnWidth ( 1, 130 );
|
||||||
|
@ -91,6 +78,18 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
||||||
this, SLOT ( OnTimerReRequestServList() ) );
|
this, SLOT ( OnTimerReRequestServList() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CConnectDlg::LoadStoredServers ( const CVector<QString>& vstrIPAddress )
|
||||||
|
{
|
||||||
|
// load stored IP addresses in combo box
|
||||||
|
for ( int iLEIdx = 0; iLEIdx < MAX_NUM_SERVER_ADDR_ITEMS; iLEIdx++ )
|
||||||
|
{
|
||||||
|
if ( !vstrIPAddress[iLEIdx].isEmpty() )
|
||||||
|
{
|
||||||
|
LineEditServerAddr->addItem ( vstrIPAddress[iLEIdx] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CConnectDlg::showEvent ( QShowEvent* )
|
void CConnectDlg::showEvent ( QShowEvent* )
|
||||||
{
|
{
|
||||||
// reset flag (on opening the connect dialg, we always want to request a new
|
// reset flag (on opening the connect dialg, we always want to request a new
|
||||||
|
@ -122,6 +121,17 @@ void CConnectDlg::hideEvent ( QHideEvent* )
|
||||||
// if window is closed, stop timers
|
// if window is closed, stop timers
|
||||||
TimerPing.stop();
|
TimerPing.stop();
|
||||||
TimerReRequestServList.stop();
|
TimerReRequestServList.stop();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
/*
|
||||||
|
// store IP addresses
|
||||||
|
for ( int iLEIdx = 0; iLEIdx < LineEditServerAddr->count(); iLEIdx++ )
|
||||||
|
{
|
||||||
|
pClient->vstrIPAddress[iLEIdx] =
|
||||||
|
LineEditServerAddr->itemText ( iLEIdx );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConnectDlg::OnTimerReRequestServList()
|
void CConnectDlg::OnTimerReRequestServList()
|
||||||
|
|
|
@ -59,6 +59,8 @@ public:
|
||||||
void SetServerList ( const CHostAddress& InetAddr,
|
void SetServerList ( const CHostAddress& InetAddr,
|
||||||
const CVector<CServerInfo>& vecServerInfo );
|
const CVector<CServerInfo>& vecServerInfo );
|
||||||
|
|
||||||
|
void LoadStoredServers ( const CVector<QString>& vstrIPAddress );
|
||||||
|
|
||||||
void SetPingTimeResult ( CHostAddress& InetAddr,
|
void SetPingTimeResult ( CHostAddress& InetAddr,
|
||||||
const int iPingTime,
|
const int iPingTime,
|
||||||
const int iPingTimeLEDColor );
|
const int iPingTimeLEDColor );
|
||||||
|
|
|
@ -456,6 +456,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
|
||||||
|
|
||||||
|
|
||||||
// TEST
|
// TEST
|
||||||
|
ConnectDlg.LoadStoredServers ( pClient->vstrIPAddress );
|
||||||
ConnectDlg.show();
|
ConnectDlg.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue