| 1037 | } |
| 1038 | |
| 1039 | void GitPlugin::discard( const std::vector<std::string>& files ) { |
| 1040 | UIMessageBox* msgBox = UIMessageBox::New( |
| 1041 | UIMessageBox::OK_CANCEL, |
| 1042 | i18n( "git_confirm_discard_changes", "Are you sure you want to discard all file changes?" ) |
| 1043 | .toUtf8() ); |
| 1044 | |
| 1045 | msgBox->on( Event::OnConfirm, [this, files]( auto ) { |
| 1046 | runAsync( |
| 1047 | [this, files]() { |
| 1048 | return mGit->restore( fixFilePaths( files ), mGit->repoPath( files[0] ) ); |
| 1049 | }, |
| 1050 | true, true ); |
| 1051 | } ); |
| 1052 | msgBox->setCloseShortcut( { KEY_ESCAPE, KEYMOD_NONE } ); |
| 1053 | msgBox->setTitle( i18n( "git_confirm", "Confirm" ) ); |
| 1054 | msgBox->center(); |
| 1055 | msgBox->showWhenReady(); |
| 1056 | } |
| 1057 | |
| 1058 | void GitPlugin::discard( const std::string& file ) { |
| 1059 | UIMessageBox* msgBox = UIMessageBox::New( |
nothing calls this directly
no test coverage detected