create function for getting the central server address (default or custom)
This commit is contained in:
parent
4ca03d9244
commit
49b67e193d
5 changed files with 13 additions and 36 deletions
|
@ -528,15 +528,9 @@ void CClientSettingsDlg::UpdateCentralServerDependency()
|
||||||
// fire signals when we update the text.
|
// fire signals when we update the text.
|
||||||
edtCentralServerAddress->blockSignals ( true );
|
edtCentralServerAddress->blockSignals ( true );
|
||||||
{
|
{
|
||||||
if ( bCurUseDefCentServAddr )
|
edtCentralServerAddress->setText (
|
||||||
{
|
SELECT_SERVER_ADDRESS ( bCurUseDefCentServAddr,
|
||||||
edtCentralServerAddress->setText ( DEFAULT_SERVER_ADDRESS );
|
pClient->GetServerListCentralServerAddress() ) );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
edtCentralServerAddress->setText (
|
|
||||||
pClient->GetServerListCentralServerAddress() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
edtCentralServerAddress->blockSignals ( false );
|
edtCentralServerAddress->blockSignals ( false );
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ LED bar: lbr
|
||||||
|
|
||||||
// default server address
|
// default server address
|
||||||
#define DEFAULT_SERVER_ADDRESS "llcon.dyndns.org"
|
#define DEFAULT_SERVER_ADDRESS "llcon.dyndns.org"
|
||||||
|
#define SELECT_SERVER_ADDRESS(a, b) ((a) ? (DEFAULT_SERVER_ADDRESS) : (b))
|
||||||
|
|
||||||
// download URL
|
// download URL
|
||||||
#define LLCON_DOWNLOAD_URL "http://sourceforge.net/projects/llcon/files"
|
#define LLCON_DOWNLOAD_URL "http://sourceforge.net/projects/llcon/files"
|
||||||
|
|
|
@ -711,15 +711,9 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
|
||||||
if ( bDoStart )
|
if ( bDoStart )
|
||||||
{
|
{
|
||||||
// get the central server address string
|
// get the central server address string
|
||||||
QString strCurCentServAddr;
|
const QString strCurCentServAddr =
|
||||||
if ( pClient->GetUseDefaultCentralServerAddress() )
|
SELECT_SERVER_ADDRESS ( pClient->GetUseDefaultCentralServerAddress(),
|
||||||
{
|
pClient->GetServerListCentralServerAddress() );
|
||||||
strCurCentServAddr = DEFAULT_SERVER_ADDRESS;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strCurCentServAddr = pClient->GetServerListCentralServerAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
// init the connect dialog and execute it (modal dialog)
|
// init the connect dialog and execute it (modal dialog)
|
||||||
ConnectDlg.Init ( strCurCentServAddr, pClient->vstrIPAddress );
|
ConnectDlg.Init ( strCurCentServAddr, pClient->vstrIPAddress );
|
||||||
|
|
|
@ -479,15 +479,9 @@ void CLlconServerDlg::UpdateGUIDependencies()
|
||||||
// fire signals when we update the text.
|
// fire signals when we update the text.
|
||||||
edtCentralServerAddress->blockSignals ( true );
|
edtCentralServerAddress->blockSignals ( true );
|
||||||
{
|
{
|
||||||
if ( bCurUseDefCentServAddr )
|
edtCentralServerAddress->setText (
|
||||||
{
|
SELECT_SERVER_ADDRESS ( bCurUseDefCentServAddr,
|
||||||
edtCentralServerAddress->setText ( DEFAULT_SERVER_ADDRESS );
|
pServer->GetServerListCentralServerAddress() ) );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
edtCentralServerAddress->setText (
|
|
||||||
pServer->GetServerListCentralServerAddress() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
edtCentralServerAddress->blockSignals ( false );
|
edtCentralServerAddress->blockSignals ( false );
|
||||||
|
|
||||||
|
|
|
@ -399,15 +399,9 @@ void CServerListManager::SlaveServerRegisterServer ( const bool bIsRegister )
|
||||||
QMutexLocker locker ( &Mutex );
|
QMutexLocker locker ( &Mutex );
|
||||||
|
|
||||||
// get the correct central server address
|
// get the correct central server address
|
||||||
QString strCurCentrServAddr;
|
const QString strCurCentrServAddr =
|
||||||
if ( bUseDefaultCentralServerAddress )
|
SELECT_SERVER_ADDRESS ( bUseDefaultCentralServerAddress,
|
||||||
{
|
strCentralServerAddress );
|
||||||
strCurCentrServAddr = DEFAULT_SERVER_ADDRESS;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strCurCentrServAddr = strCentralServerAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For the slave server, the slave server properties are store in the
|
// For the slave server, the slave server properties are store in the
|
||||||
// very first item in the server list (which is actually no server list
|
// very first item in the server list (which is actually no server list
|
||||||
|
|
Loading…
Reference in a new issue