From: <st...@us...> - 2003-09-09 14:43:48
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv24151 Modified Files: wx.cc Log Message: make some defaults configurable at build-time via DEFINES fix problem where numCalls=1 and no callbox used. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- wx.cc 11 Jul 2003 17:40:26 -0000 1.41 +++ wx.cc 9 Sep 2003 14:43:45 -0000 1.42 @@ -27,6 +27,17 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" +#ifndef DEFAULT_NUM_CALLS +#define DEFAULT_NUM_CALLS 4 +#endif + +#ifndef DEFAULT_DESTSERV +#define DEFAULT_DESTSERV "gu...@mi..." +#endif + +#ifndef DEFAULT_DESTEXT +#define DEFAULT_DESTEXT "s@default" +#endif class IAXClient : public wxApp { @@ -339,7 +350,7 @@ IAXFrame::IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height) - : wxFrame((wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)) + : wxFrame((wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)), calls(NULL) { wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL); wxPanel *aPanel = new wxPanel(this); @@ -428,19 +439,19 @@ /* Server */ topsizer->Add(iaxServLabel = new wxStaticText(aPanel, -1, _T("Server:"))); - topsizer->Add(iaxServ = new wxComboBox(aPanel, -1, _T("gu...@mi..."), + topsizer->Add(iaxServ = new wxComboBox(aPanel, -1, _T(DEFAULT_DESTSERV), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); - iaxServ->Append("gu...@mi..."); + iaxServ->Append(DEFAULT_DESTSERV); iaxServ->Append("guest@ast1"); iaxServ->Append("guest@asterisk"); /* Destination */ topsizer->Add(iaxDestLabel = new wxStaticText(aPanel, -1, _T("Number:"))); - topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T("s@default"), + topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T(DEFAULT_DESTEXT), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); - iaxDest->Append("s@default"); + iaxDest->Append(DEFAULT_DESTEXT); iaxDest->Append("8068"); iaxDest->Append("208"); iaxDest->Append("600"); @@ -670,7 +681,8 @@ ret = HandleStatusEvent(e->ev.text.message); break; case IAXC_EVENT_STATE: - ret = theFrame->calls->HandleStateEvent(e->ev.call); + if(calls) + ret = theFrame->calls->HandleStateEvent(e->ev.call); break; default: break; // not handled @@ -759,7 +771,7 @@ bool IAXClient::OnInit() { optNoDialPad = false; - optNumCalls = 4; + optNumCalls = DEFAULT_NUM_CALLS; if(!wxApp::OnInit()) return false; |