GetHostname()->Enable(m_client == NULL);
GetTopic()->Enable(m_client == NULL);
- const bool isConnected = m_client->IsConnected();
+ const bool isConnected = (m_client != NULL && m_client->IsConnected());
GetDisconnect()->Enable(m_client != NULL && isConnected);
GetStartAdvise()->Enable(m_client != NULL && isConnected);
GetStopAdvise()->Enable(m_client != NULL && isConnected);
delete m_client;
m_client = NULL;
}
- Enable();
+ EnableControls();
}
void MyFrame::OnServername( wxCommandEvent& WXUNUSED(event) )
{
delete m_client;
m_client = NULL;
- Enable();
+ EnableControls();
}
void MyFrame::OnStartAdvise(wxCommandEvent& WXUNUSED(event))
m_connection->Disconnect();
delete m_connection;
m_connection = NULL;
- wxGetApp().GetFrame()->Enable();
+ wxGetApp().GetFrame()->EnableControls();
wxLogMessage(_T("Client disconnected from server"));
}
}