| 124 | } |
| 125 | |
| 126 | bool LayerAnnotatorBase::annotateWithFilename(LayerDataBase& layer, LogWindow& log, const String& fname) const |
| 127 | { |
| 128 | if (fname.empty()) |
| 129 | { |
| 130 | return false; |
| 131 | } |
| 132 | FileTypes::Type type = FileHandler::getType(fname); |
| 133 | |
| 134 | if (!supported_types_.contains(type)) |
| 135 | { |
| 136 | log.appendNewHeader(LogWindow::LogState::NOTICE, "Error", String("Filename '" + fname + "' has unsupported file type. No annotation performed.").toQString()); |
| 137 | return false; |
| 138 | } |
| 139 | |
| 140 | GUIHelpers::GUILock glock(gui_lock_); |
| 141 | bool success = annotateWorker_(layer, fname, log); |
| 142 | |
| 143 | if (success) |
| 144 | { |
| 145 | log.appendNewHeader(LogWindow::LogState::NOTICE, "Done", "Annotation finished. Open the corresponding view to see results!"); |
| 146 | } |
| 147 | return success; |
| 148 | } |
| 149 | |
| 150 | std::unique_ptr<LayerAnnotatorBase> LayerAnnotatorBase::getAnnotatorWhichSupports(const FileTypes::Type& type) |
| 151 | { |