void OnAbout(wxCommandEvent& event);
void OnHangUp(wxCommandEvent& event);
void OnDial(wxCommandEvent& event);
+ void OnEnumISPs(wxCommandEvent& event);
void OnUpdateUI(wxUpdateUIEvent& event);
NetTest_Quit = 1,
NetTest_About,
NetTest_HangUp,
- NetTest_Dial
+ NetTest_Dial,
+ NetTest_EnumISP,
+ NetTest_Max
};
// ----------------------------------------------------------------------------
EVT_MENU(NetTest_About, MyFrame::OnAbout)
EVT_MENU(NetTest_HangUp, MyFrame::OnHangUp)
EVT_MENU(NetTest_Dial, MyFrame::OnDial)
+ EVT_MENU(NetTest_EnumISP, MyFrame::OnEnumISPs)
EVT_UPDATE_UI(NetTest_Dial, MyFrame::OnUpdateUI)
return FALSE;
}
+ frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? "LAN" : "No LAN", 2);
+
return TRUE;
}
: "Disconnected";
}
- wxMessageBox(msg, "Dial Up Manager Notification",
- wxOK | wxICON_INFORMATION,
- GetTopWindow());
+ wxLogMessage(msg);
}
// ----------------------------------------------------------------------------
menuFile->Append(NetTest_Dial, "&Dial\tCtrl-D", "Dial default ISP");
menuFile->Append(NetTest_HangUp, "&HangUp\tCtrl-H", "Hang up modem");
menuFile->AppendSeparator();
+ menuFile->Append(NetTest_EnumISP, "&Enumerate ISPs...\tCtrl-E");
+ menuFile->AppendSeparator();
menuFile->Append(NetTest_About, "&About...\tCtrl-A", "Show about dialog");
menuFile->AppendSeparator();
menuFile->Append(NetTest_Quit, "E&xit\tAlt-X", "Quit this program");
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
- CreateStatusBar(2);
+ // create status bar and fill the LAN field
+ CreateStatusBar(3);
+ static const int widths[3] = { -1, 100, 60 };
+ SetStatusWidths(3, widths);
}
wxYield();
wxBeginBusyCursor();
- if ( wxGetApp().GetDialer()->Dial("Free", "zeitlin", "") )
+ if ( wxGetApp().GetDialer()->Dial() )
{
wxLogStatus(this, "Dialing...");
}
wxEndBusyCursor();
}
+void MyFrame::OnEnumISPs(wxCommandEvent& WXUNUSED(event))
+{
+ wxArrayString names;
+ size_t nCount = wxGetApp().GetDialer()->GetISPNames(names);
+ if ( nCount == 0 )
+ {
+ wxLogWarning("No ISPs found.");
+ }
+ else
+ {
+ wxString msg = "Known ISPs:\n";
+ for ( size_t n = 0; n < nCount; n++ )
+ {
+ msg << names[n] << '\n';
+ }
+
+ wxLogMessage(msg);
+ }
+}
+
void MyFrame::OnUpdateUI(wxUpdateUIEvent& event)
{
// disable this item while dialing