+class wxDialProcess : public wxProcess
+{
+public:
+ wxDialProcess(wxDialUpManagerImpl *dupman)
+ {
+ m_DupMan = dupman;
+ }
+ void OnTerminate(int WXUNUSED(pid), int WXUNUSED(status)) const
+ {
+ m_DupMan->m_DialProcess = NULL;
+ m_DupMan->CheckStatus(TRUE);
+ }
+private:
+ wxDialUpManagerImpl *m_DupMan;
+};
+
+
+wxDialUpManagerImpl::wxDialUpManagerImpl()
+{
+ m_IsOnline = -1; // unknown
+ m_DialProcess = NULL;
+ m_timer = NULL;
+ m_CanUseIfconfig = -1; // unknown
+ m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST;
+ m_BeaconPort = 80;
+ SetConnectCommand("pon", "poff"); // default values for Debian/GNU linux
+ wxChar * dial = wxGetenv(_T("WXDIALUP_DIALCMD"));
+ wxChar * hup = wxGetenv(_T("WXDIALUP_HUPCMD"));
+ if(dial || hup)
+ SetConnectCommand(dial ? wxString(dial) : m_ConnectCommand,
+ hup ? wxString(hup) : m_HangUpCommand);
+}
+
+wxDialUpManagerImpl::~wxDialUpManagerImpl()
+{
+ if(m_timer) delete m_timer;
+ if(m_DialProcess) m_DialProcess->Detach();
+}
+