| 520 | |
| 521 | |
| 522 | void 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 | |
| 555 | void CServerListCtrl::OnKeyPressed( wxKeyEvent& event ) |
nothing calls this directly
no test coverage detected