support for connect on double click a list item
This commit is contained in:
parent
7392762f6c
commit
356ecff831
2 changed files with 24 additions and 4 deletions
|
@ -64,6 +64,11 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
|||
|
||||
|
||||
// Connections -------------------------------------------------------------
|
||||
// list view
|
||||
QObject::connect ( ListViewServers,
|
||||
SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ),
|
||||
this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) );
|
||||
|
||||
// buttons
|
||||
QObject::connect ( CancelButton, SIGNAL ( clicked() ),
|
||||
this, SLOT ( OnCancelButtonClicked() ) );
|
||||
|
@ -101,6 +106,9 @@ void CConnectDlg::showEvent ( QShowEvent* )
|
|||
// clear current address
|
||||
strSelectedAddress = "";
|
||||
|
||||
// clear server list view
|
||||
ListViewServers->clear();
|
||||
|
||||
|
||||
// TEST
|
||||
QString strNAddr = "llcon.dyndns.org:22122";
|
||||
|
@ -157,8 +165,9 @@ void CConnectDlg::OnTimerReRequestServList()
|
|||
void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
|
||||
const CVector<CServerInfo>& vecServerInfo )
|
||||
{
|
||||
// set flag
|
||||
// set flag and disable timer for resend server list request
|
||||
bServerListReceived = true;
|
||||
TimerReRequestServList.stop();
|
||||
|
||||
// first clear list
|
||||
ListViewServers->clear();
|
||||
|
@ -232,6 +241,16 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
|
|||
TimerPing.start ( PING_UPDATE_TIME_SERVER_LIST_MS );
|
||||
}
|
||||
|
||||
void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
|
||||
int )
|
||||
{
|
||||
// if a server list item was double clicked, close dialog and connect
|
||||
if ( Item != 0 )
|
||||
{
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
void CConnectDlg::OnCancelButtonClicked()
|
||||
{
|
||||
// set cancel flag
|
||||
|
|
|
@ -81,6 +81,7 @@ protected:
|
|||
bool bCancelPressed;
|
||||
|
||||
public slots:
|
||||
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
|
||||
void OnCancelButtonClicked();
|
||||
void OnTimerPing();
|
||||
void OnTimerReRequestServList();
|
||||
|
|
Loading…
Reference in a new issue