bug fix with combo box, add flag to show that server list item was chosen
This commit is contained in:
parent
c4818c55e0
commit
26e01e80be
1 changed files with 12 additions and 5 deletions
|
@ -30,7 +30,8 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
|||
: QDialog ( parent, f ),
|
||||
strSelectedAddress ( "" ),
|
||||
bServerListReceived ( false ),
|
||||
bCancelPressed ( false )
|
||||
bCancelPressed ( false ),
|
||||
bServerListItemWasChosen ( false )
|
||||
{
|
||||
setupUi ( this );
|
||||
|
||||
|
@ -87,6 +88,7 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
|||
void CConnectDlg::LoadStoredServers ( const CVector<QString>& vstrIPAddresses )
|
||||
{
|
||||
// load stored IP addresses in combo box
|
||||
LineEditServerAddr->clear();
|
||||
for ( int iLEIdx = 0; iLEIdx < MAX_NUM_SERVER_ADDR_ITEMS; iLEIdx++ )
|
||||
{
|
||||
if ( !vstrIPAddresses[iLEIdx].isEmpty() )
|
||||
|
@ -102,6 +104,7 @@ void CConnectDlg::showEvent ( QShowEvent* )
|
|||
// new updated server list per definition)
|
||||
bServerListReceived = false;
|
||||
bCancelPressed = false;
|
||||
bServerListItemWasChosen = false;
|
||||
|
||||
// clear current address
|
||||
strSelectedAddress = "";
|
||||
|
@ -139,8 +142,12 @@ void CConnectDlg::hideEvent ( QHideEvent* )
|
|||
|
||||
if ( CurSelListItemList.count() > 0 )
|
||||
{
|
||||
// get host address from selected list view item as a string
|
||||
strSelectedAddress =
|
||||
CurSelListItemList[0]->data ( 0, Qt::UserRole ).toString();
|
||||
|
||||
// set flag that a server list item was chosen to connect
|
||||
bServerListItemWasChosen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue