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

Method OnKeyPressed

src/DownloadListCtrl.cpp:794–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792
793
794void CDownloadListCtrl::OnKeyPressed( wxKeyEvent& event )
795{
796 // Check if delete was pressed
797 switch (event.GetKeyCode()) {
798 case WXK_NUMPAD_DELETE:
799 case WXK_DELETE: {
800 wxCommandEvent evt;
801 OnCancelFile( evt );
802 break;
803 }
804 case WXK_F2: {
805 ItemList files = ::GetSelectedItems( this );
806 if (files.size() == 1) {
807 CPartFile* file = files.front()->GetFile();
808
809 // Currently renaming of completed files causes problem with kad
810 if (file->IsPartFile()) {
811 wxString strNewName = ::wxGetTextFromUser(
812 _("Enter new name for this file:"),
813 _("File rename"), file->GetFileName().GetPrintable());
814
815 CPath newName = CPath(strNewName);
816 if (newName.IsOk() && (newName != file->GetFileName())) {
817 theApp->sharedfiles->RenameFile(file, newName);
818 }
819 }
820 }
821 break;
822 }
823 default:
824 event.Skip();
825 }
826}
827
828
829void CDownloadListCtrl::OnDrawItem(

Callers

nothing calls this directly

Calls 8

GetPrintableMethod · 0.80
GetSelectedItemsFunction · 0.70
CPathClass · 0.70
sizeMethod · 0.45
GetFileMethod · 0.45
IsPartFileMethod · 0.45
IsOkMethod · 0.45
RenameFileMethod · 0.45

Tested by

no test coverage detected