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,13 +338,29 @@ void CLlconClientDlg::OnConnectDisconBut()
// set address and check if address is valid
if ( pClient->SetServerAddr ( LineEditServerAddr->currentText() ) )
{
pClient->Start();
bool bStartOk = true;
try
{
pClient->Start();
}
catch ( CGenErr generr )
{
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
{
// Restart timer to ensure that the text is visible at