diff --git a/src/connectdlgbase.ui b/src/connectdlgbase.ui index a9710ac0..75509c9d 100755 --- a/src/connectdlgbase.ui +++ b/src/connectdlgbase.ui @@ -5,8 +5,8 @@ 0 0 - 584 - 256 + 464 + 255 @@ -34,7 +34,7 @@ - Country + Ping Time @@ -44,12 +44,7 @@ - Ping Time - - - - - Address + Location diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 81396b39..ea001e29 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -748,20 +748,25 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart ) if ( !strSelectedAddress.isEmpty() && !ConnectDlg.GetServerListItemWasChosen() ) { - CVector vstrTempList ( 0 ); + CVector vstrTempList ( MAX_NUM_SERVER_ADDR_ITEMS, "" ); // store the new address in the current server storage list at // the top, make sure we do not have more than allowed stored // servers - vstrTempList.Add ( strSelectedAddress ); - for ( int iIdx = 0; ( iIdx < pClient->vstrIPAddress.Size() ) && - ( iIdx < ( MAX_NUM_SERVER_ADDR_ITEMS - 1 ) ); iIdx++ ) + vstrTempList[0] = strSelectedAddress; + int iTempListCnt = 1; + + for ( int iIdx = 0; iIdx < MAX_NUM_SERVER_ADDR_ITEMS; iIdx++ ) { // only add old server address if it is not the same as the // selected one - if ( pClient->vstrIPAddress[iIdx].compare ( strSelectedAddress ) ) + if ( ( pClient->vstrIPAddress[iIdx].compare ( strSelectedAddress ) ) && + ( iTempListCnt < MAX_NUM_SERVER_ADDR_ITEMS ) ) { - vstrTempList.Add ( pClient->vstrIPAddress[iIdx] ); + vstrTempList[iTempListCnt] = + pClient->vstrIPAddress[iIdx]; + + iTempListCnt++; } } diff --git a/src/llconclientdlgbase.ui b/src/llconclientdlgbase.ui index 036b63f4..59cb398f 100755 --- a/src/llconclientdlgbase.ui +++ b/src/llconclientdlgbase.ui @@ -452,35 +452,6 @@ - - - - - 0 - 0 - - - - Server Address - - - false - - - - - - - - 0 - 0 - - - - true - - - @@ -779,7 +750,6 @@ - LineEditServerAddr PushButtonConnect LineEditFaderTag SliderAudInFader diff --git a/src/llconserverdlg.cpp b/src/llconserverdlg.cpp index 529af7dd..7e9a02b3 100755 --- a/src/llconserverdlg.cpp +++ b/src/llconserverdlg.cpp @@ -49,6 +49,37 @@ CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent ) vecpListViewItems[i] = new CServerListViewItem ( ListViewClients ); vecpListViewItems[i]->setHidden ( true ); } + + // update server name line edit + LineEditServerName->setText ( pServer->GetServerName() ); + + // update server city line edit + LineEditLocationCity->setText ( pServer->GetServerCity() ); + + // load country combo box with all available countries + ComboBoxLocationCountry->setInsertPolicy ( QComboBox::NoInsert ); + ComboBoxLocationCountry->clear(); + + for ( int iCurCntry = static_cast ( QLocale::AnyCountry ); + iCurCntry < static_cast ( QLocale::LastCountry ); iCurCntry++ ) + { + // add all countries except of the "Default" country + if ( static_cast ( iCurCntry ) != QLocale::AnyCountry ) + { + // store the country enum index together with the string (this is + // important since we sort the combo box items later on) + ComboBoxLocationCountry->addItem ( QLocale::countryToString ( + static_cast ( iCurCntry ) ), iCurCntry ); + } + } + + // sort country combo box items in alphabetical order + ComboBoxLocationCountry->model()->sort ( 0, Qt::AscendingOrder ); + + // select current country + ComboBoxLocationCountry->setCurrentIndex ( + ComboBoxLocationCountry->findData ( + static_cast ( pServer->GetServerCountry() ) ) ); // Main menu bar ----------------------------------------------------------- diff --git a/src/llconserverdlgbase.ui b/src/llconserverdlgbase.ui index acfd8f4b..a42b7a84 100755 --- a/src/llconserverdlgbase.ui +++ b/src/llconserverdlgbase.ui @@ -5,8 +5,8 @@ 0 0 - 580 - 315 + 588 + 438 @@ -19,21 +19,6 @@ true - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - @@ -66,6 +51,81 @@ + + + + Register Server + + + + + + + + + Central Server Address: + + + + + + + Default + + + + + + + + + + + + Server Info + + + + + + + + Name + + + + + + + Location: City + + + + + + + Location: Country + + + + + + + + + + + + + + + + + + + + + diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 2b4f0d9e..0f02d31b 100755 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -62,7 +62,7 @@ CServerListManager::CServerListManager ( const QString& sNCentServAddr, CHostAddress(), "", "", - QLocale::AnyCountry, + QLocale::system().country(), "", USED_NUM_CHANNELS, false );