MCPcopy Create free account
hub / github.com/amule-project/amule / OnRemoveServers

Method OnRemoveServers

src/ServerListCtrl.cpp:522–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520
521
522void CServerListCtrl::OnRemoveServers( wxCommandEvent& event )
523{
524 if ( event.GetId() == MP_REMOVEALL ) {
525 if ( GetItemCount() ) {
526 wxString question = _("Are you sure that you wish to delete all servers?");
527
528 if ( wxMessageBox( question, _("Cancel"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this) == wxYES ) {
529 if ( theApp->serverconnect->IsConnecting() ) {
530 theApp->downloadqueue->StopUDPRequests();
531 theApp->serverconnect->StopConnectionTry();
532 theApp->serverconnect->Disconnect();
533 }
534
535 RemoveAllServers(wxLIST_STATE_DONTCARE);
536 }
537 }
538 } else if ( event.GetId() == MP_REMOVE ) {
539 if ( GetSelectedItemCount() ) {
540 wxString question;
541 if (GetSelectedItemCount() == 1) {
542 question = _("Are you sure that you wish to delete the selected server?");
543 } else {
544 question = _("Are you sure that you wish to delete the selected servers?");
545 }
546
547 if ( wxMessageBox( question, _("Cancel"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this) == wxYES ) {
548 RemoveAllServers(wxLIST_STATE_SELECTED);
549 }
550 }
551 }
552}
553
554
555void CServerListCtrl::OnKeyPressed( wxKeyEvent& event )

Callers

nothing calls this directly

Calls 4

IsConnectingMethod · 0.45
StopUDPRequestsMethod · 0.45
StopConnectionTryMethod · 0.45
DisconnectMethod · 0.45

Tested by

no test coverage detected