bug fix: the command line argument "-c" did not work anymore

This commit is contained in:
Volker Fischer 2013-02-09 21:23:10 +00:00
parent e8e2e8f540
commit 43d3225936
2 changed files with 65 additions and 38 deletions

View file

@ -266,9 +266,8 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
if ( bNewConnectOnStartup )
{
// since the software starts up right now, the previous state was
// "not connected" so that a call to "OnConnectDisconBut()" will
// start the connection
OnConnectDisconBut();
// "not connected" so we start the connection
ConnectDisconnect ( true, true );
}
@ -743,10 +742,29 @@ void CLlconClientDlg::OnCLPingTimeWithNumClientsReceived ( CHostAddress InetAddr
iNumClients );
}
void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart,
const bool bConnectOnStartup )
{
// start/stop client, set button text
if ( bDoStart )
{
QString strSelectedAddress;
bool bConnectStateOK = false; // init flag
// only show connection dialog if this is not a connection on startup
if ( bConnectOnStartup )
{
// per definition use the last connection (first entry in the
// stored address list)
strSelectedAddress = pClient->vstrIPAddress[0];
// only if address is not empty, start the client
if ( !strSelectedAddress.isEmpty() )
{
bConnectStateOK = true;
}
}
else
{
// get the central server address string
const QString strCurCentServAddr =
@ -760,7 +778,7 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
// check if state is OK (e.g., no Cancel was pressed)
if ( ConnectDlg.GetStateOK() )
{
const QString strSelectedAddress = ConnectDlg.GetSelectedAddress();
strSelectedAddress = ConnectDlg.GetSelectedAddress();
// only store new host address in our data base if the address is
// not empty and it was not a server list item (only the addresses
@ -794,6 +812,14 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
pClient->vstrIPAddress = vstrTempList;
}
// everything was ok with the connection dialog, set flag
bConnectStateOK = true;
}
}
// only start connection action if the connection state is ok
if ( bConnectStateOK )
{
// set address and check if address is valid
if ( pClient->SetServerAddr ( strSelectedAddress ) )
{

View file

@ -82,7 +82,8 @@ protected:
void ShowChatWindow();
void UpdateAudioFaderSlider();
void UpdateRevSelection();
void ConnectDisconnect ( const bool bDoStart );
void ConnectDisconnect ( const bool bDoStart,
const bool bConnectOnStartup = false );
CClient* pClient;
CSettings* pSettings;