catch errors on sound card starting in main dialog and show error message without the need to terminate the software immediately (as it was before)

This commit is contained in:
Volker Fischer 2009-08-16 00:48:33 +00:00
parent c549ae90f0
commit bb3404b21c

View file

@ -338,12 +338,28 @@ void CLlconClientDlg::OnConnectDisconBut()
// set address and check if address is valid // set address and check if address is valid
if ( pClient->SetServerAddr ( LineEditServerAddr->currentText() ) ) if ( pClient->SetServerAddr ( LineEditServerAddr->currentText() ) )
{ {
pClient->Start(); bool bStartOk = true;
PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT ); try
{
pClient->Start();
}
// start timer for level meter bar catch ( CGenErr generr )
TimerSigMet.start ( LEVELMETER_UPDATE_TIME ); {
QMessageBox::critical (
this, APP_NAME, generr.GetErrorText(), "Close", 0 );
bStartOk = false;
}
if ( bStartOk )
{
PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT );
// start timer for level meter bar
TimerSigMet.start ( LEVELMETER_UPDATE_TIME );
}
} }
else else
{ {