bug fix, added GUI controls for server info, added some server info init code, removed server selection in main window, changed connect dialog server list columns

This commit is contained in:
Volker Fischer 2011-04-26 20:31:30 +00:00
parent 328dbd2b1c
commit ead06da44d
6 changed files with 124 additions and 63 deletions

View file

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>584</width>
<height>256</height>
<width>464</width>
<height>255</height>
</rect>
</property>
<property name="windowTitle" >
@ -34,7 +34,7 @@
</column>
<column>
<property name="text" >
<string>Country</string>
<string>Ping Time</string>
</property>
</column>
<column>
@ -44,12 +44,7 @@
</column>
<column>
<property name="text" >
<string>Ping Time</string>
</property>
</column>
<column>
<property name="text" >
<string>Address</string>
<string>Location</string>
</property>
</column>
</widget>

View file

@ -748,20 +748,25 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
if ( !strSelectedAddress.isEmpty() &&
!ConnectDlg.GetServerListItemWasChosen() )
{
CVector<QString> vstrTempList ( 0 );
CVector<QString> 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++;
}
}

View file

@ -452,35 +452,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="TextLabelServerAddr" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Server Address</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="LineEditServerAddr" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
@ -779,7 +750,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>LineEditServerAddr</tabstop>
<tabstop>PushButtonConnect</tabstop>
<tabstop>LineEditFaderTag</tabstop>
<tabstop>SliderAudInFader</tabstop>

View file

@ -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<int> ( QLocale::AnyCountry );
iCurCntry < static_cast<int> ( QLocale::LastCountry ); iCurCntry++ )
{
// add all countries except of the "Default" country
if ( static_cast<QLocale::Country> ( 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<QLocale::Country> ( 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<int> ( pServer->GetServerCountry() ) ) );
// Main menu bar -----------------------------------------------------------

View file

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>580</width>
<height>315</height>
<width>588</width>
<height>438</height>
</rect>
</property>
<property name="windowTitle" >
@ -19,21 +19,6 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QTreeWidget" name="ListViewClients" >
<property name="rootIsDecorated" >
@ -66,6 +51,81 @@
</column>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBoxRegisterServer" >
<property name="text" >
<string>Register Server</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="LabelCentralServerAddress" >
<property name="text" >
<string>Central Server Address:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBoxDefaultCentralServer" >
<property name="text" >
<string>Default</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="LineEditCentralServerAddress" />
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Server Info</string>
</property>
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="LabelServerName" >
<property name="text" >
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="LabelLocationCity" >
<property name="text" >
<string>Location: City</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="LabelLocationCountry" >
<property name="text" >
<string>Location: Country</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QLineEdit" name="LineEditServerName" />
</item>
<item>
<widget class="QLineEdit" name="LineEditLocationCity" />
</item>
<item>
<widget class="QComboBox" name="ComboBoxLocationCountry" />
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >

View file

@ -62,7 +62,7 @@ CServerListManager::CServerListManager ( const QString& sNCentServAddr,
CHostAddress(),
"",
"",
QLocale::AnyCountry,
QLocale::system().country(),
"",
USED_NUM_CHANNELS,
false );