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

Method OnRename

src/SharedFilesCtrl.cpp:709–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709void CSharedFilesCtrl::OnRename( wxCommandEvent& WXUNUSED(event) )
710{
711 int item = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
712 if ( item != -1 ) {
713 CKnownFile* file = reinterpret_cast<CKnownFile*>(GetItemData(item));
714
715 wxString strNewName = ::wxGetTextFromUser(
716 _("Enter new name for this file:"),
717 _("File rename"), file->GetFileName().GetPrintable());
718
719 CPath newName = CPath(strNewName);
720 if (newName.IsOk() && (newName != file->GetFileName())) {
721 theApp->sharedfiles->RenameFile(file, newName);
722 }
723 }
724}
725
726
727void CSharedFilesCtrl::OnKeyPressed( wxKeyEvent& event )

Callers

nothing calls this directly

Calls 4

GetPrintableMethod · 0.80
CPathClass · 0.70
IsOkMethod · 0.45
RenameFileMethod · 0.45

Tested by

no test coverage detected