- if (*desc) {
- /* There's a description. Add a waypoint. */
- MACRO_PATH_INCREMENT_TAIL(*_route);
- _route->tail->unitx = unitx;
- _route->tail->unity = unity;
- _route->tail->time = 0;
- _route->tail->altitude = NAN;
-
- MACRO_PATH_INCREMENT_WTAIL(*_route);
- _route->wtail->point = _route->tail;
- _route->wtail->desc = gtk_text_buffer_get_text(tbuf, &ti1, &ti2, TRUE);
- } else {
- GtkWidget *confirm;
-
- g_free(desc);
-
- confirm = hildon_note_new_confirmation(GTK_WINDOW(dialog),
- _("Creating a \"waypoint\" with no description actually "
- "adds a break point. Is that what you want?"));
-
- if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) {
- /* There's no description. Add a break by adding a (0, 0)
- * point (if necessary), and then the ordinary route point. */
- if (_route->tail->unity) {
- MACRO_PATH_INCREMENT_TAIL(*_route);
- *_route->tail = _point_null;
- }
-
- MACRO_PATH_INCREMENT_TAIL(*_route);
- _route->tail->unitx = unitx;
- _route->tail->unity = unity;
- _route->tail->time = 0;
- _route->tail->altitude = NAN;
-
- gtk_widget_destroy(confirm);
- } else {
- gtk_widget_destroy(confirm);
- continue;
- }
- }
-
- route_find_nearest_point(_route);
- map_render_paths();
- MACRO_QUEUE_DRAW_AREA();