[#836] Added import command user feedback

This commit is contained in:
Rsl1122 2018-12-09 14:20:55 +02:00
parent d7dce0ac34
commit 00a28e283b

View File

@ -78,14 +78,18 @@ public class ManageImportCommand extends CommandNode {
return; return;
} }
findImporter(sender, importArg); findAndProcessImporter(sender, importArg);
} }
private void findImporter(Sender sender, String importArg) { private void findAndProcessImporter(Sender sender, String importArg) {
Optional<Importer> foundImporter = importSystem.getImporter(importArg); Optional<Importer> foundImporter = importSystem.getImporter(importArg);
if (foundImporter.isPresent()) { if (foundImporter.isPresent()) {
Importer importer = foundImporter.get(); Importer importer = foundImporter.get();
processing.submitNonCritical(importer::processImport); processing.submitNonCritical(() -> {
sender.sendMessage(locale.getString(ManageLang.PROGRESS_START));
importer.processImport();
sender.sendMessage(locale.getString(ManageLang.PROGRESS_SUCCESS));
});
} else { } else {
sender.sendMessage(locale.getString(ManageLang.FAIL_IMPORTER_NOT_FOUND, importArg)); sender.sendMessage(locale.getString(ManageLang.FAIL_IMPORTER_NOT_FOUND, importArg));
} }