bug fix: the welcome message may appear twice if a list item of the server list was double clicked

This commit is contained in:
Volker Fischer 2020-04-13 07:46:28 +02:00
parent 765cb7d266
commit 5d63aa590f
2 changed files with 64 additions and 52 deletions

View File

@ -36,6 +36,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
QDialog ( parent, f ),
pClient ( pNCliP ),
pSettings ( pNSetP ),
bConnectDlgWasShown ( false ),
ClientSettingsDlg ( pNCliP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ),
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ),
@ -654,6 +655,11 @@ void CClientDlg::OnAudioPanValueChanged ( int value )
void CClientDlg::OnConnectDlgAccepted()
{
// We had an issue that the accepted signal was emit twice if a list item was double
// clicked in the connect dialog. To avoid this we introduced a flag which makes sure
// we process the accepted signal only once after the dialog was initially shown.
if ( bConnectDlgWasShown )
{
// get the address from the connect dialog
QString strSelectedAddress = ConnectDlg.GetSelectedAddress();
@ -704,6 +710,10 @@ void CClientDlg::OnConnectDlgAccepted()
// initiate connection
Connect ( strSelectedAddress, strMixerBoardLabel );
// reset flag
bConnectDlgWasShown = false;
}
}
void CClientDlg::OnConnectDisconBut()
@ -836,6 +846,7 @@ void CClientDlg::ShowConnectionSetupDialog()
pClient->GetServerListCentralServerAddress() ) );
// show connect dialog
bConnectDlgWasShown = true;
ConnectDlg.show();
// make sure dialog is upfront and has focus

View File

@ -96,6 +96,7 @@ protected:
CSettings* pSettings;
bool bConnected;
bool bConnectDlgWasShown;
QTimer TimerSigMet;
QTimer TimerBuffersLED;
QTimer TimerStatus;