| 481 | } |
| 482 | |
| 483 | void DrawWidget::CreateFeature() |
| 484 | { |
| 485 | auto cats = m_framework.GetEditorCategories(); |
| 486 | CreateFeatureDialog dlg(this, cats); |
| 487 | if (dlg.exec() == QDialog::Accepted) |
| 488 | { |
| 489 | osm::EditableMapObject emo; |
| 490 | if (m_framework.CreateMapObject(m_framework.GetViewportCenter(), dlg.GetSelectedType(), emo)) |
| 491 | { |
| 492 | EditorDialog dlg(this, emo); |
| 493 | int const result = dlg.exec(); |
| 494 | if (result == QDialog::Accepted) |
| 495 | m_framework.SaveEditedMapObject(emo); |
| 496 | } |
| 497 | else |
| 498 | { |
| 499 | LOG(LWARNING, ("Error creating new map object.")); |
| 500 | } |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | void DrawWidget::OnLocationUpdate(location::GpsInfo const & info) |
| 505 | { |
no test coverage detected