fix for connect dialog and selected items in the list view when the combo box is changed
This commit is contained in:
parent
50cf3e54dc
commit
44ff64cc48
2 changed files with 19 additions and 1 deletions
|
@ -73,6 +73,11 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
||||||
SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ),
|
SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ),
|
||||||
this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) );
|
this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) );
|
||||||
|
|
||||||
|
// combo boxes
|
||||||
|
QObject::connect ( LineEditServerAddr,
|
||||||
|
SIGNAL ( editTextChanged ( const QString& ) ),
|
||||||
|
this, SLOT ( OnLineEditServerAddrEditTextChanged ( const QString& ) ) );
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
QObject::connect ( CancelButton, SIGNAL ( clicked() ),
|
QObject::connect ( CancelButton, SIGNAL ( clicked() ),
|
||||||
this, SLOT ( close() ) );
|
this, SLOT ( close() ) );
|
||||||
|
@ -268,9 +273,14 @@ void CConnectDlg::OnServerListItemClicked ( QTreeWidgetItem* Item,
|
||||||
{
|
{
|
||||||
// if an item is clicked, copy the server name to the combo box
|
// if an item is clicked, copy the server name to the combo box
|
||||||
if ( Item != 0 )
|
if ( Item != 0 )
|
||||||
|
{
|
||||||
|
// make sure no signals are send when we change the text
|
||||||
|
LineEditServerAddr->blockSignals ( true );
|
||||||
{
|
{
|
||||||
LineEditServerAddr->setEditText ( Item->text ( 0 ) );
|
LineEditServerAddr->setEditText ( Item->text ( 0 ) );
|
||||||
}
|
}
|
||||||
|
LineEditServerAddr->blockSignals ( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
|
void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
|
||||||
|
@ -284,6 +294,13 @@ void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CConnectDlg::OnLineEditServerAddrEditTextChanged ( const QString& )
|
||||||
|
{
|
||||||
|
// in the server address combo box, a text was changed, remove selection
|
||||||
|
// in the server list (if any)
|
||||||
|
ListViewServers->clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
void CConnectDlg::OnConnectButtonClicked()
|
void CConnectDlg::OnConnectButtonClicked()
|
||||||
{
|
{
|
||||||
// set state OK flag
|
// set state OK flag
|
||||||
|
|
|
@ -86,6 +86,7 @@ protected:
|
||||||
public slots:
|
public slots:
|
||||||
void OnServerListItemClicked ( QTreeWidgetItem* Item, int );
|
void OnServerListItemClicked ( QTreeWidgetItem* Item, int );
|
||||||
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
|
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
|
||||||
|
void OnLineEditServerAddrEditTextChanged ( const QString& );
|
||||||
void OnConnectButtonClicked();
|
void OnConnectButtonClicked();
|
||||||
void OnTimerPing();
|
void OnTimerPing();
|
||||||
void OnTimerReRequestServList();
|
void OnTimerReRequestServList();
|
||||||
|
|
Loading…
Reference in a new issue