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
|
@ -28,9 +28,10 @@
|
|||
/* Implementation *************************************************************/
|
||||
CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
||||
: QDialog ( parent, f ),
|
||||
strSelectedAddress ( "" ),
|
||||
bServerListReceived ( false ),
|
||||
bCancelPressed ( false )
|
||||
strSelectedAddress ( "" ),
|
||||
bServerListReceived ( 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() )
|
||||
|
@ -100,8 +102,9 @@ void CConnectDlg::showEvent ( QShowEvent* )
|
|||
{
|
||||
// reset flags (on opening the connect dialg, we always want to request a
|
||||
// new updated server list per definition)
|
||||
bServerListReceived = false;
|
||||
bCancelPressed = false;
|
||||
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