GtkWidget *dialog;
GtkWidget *w_comment;
GtkWidget *w_description;
+ GtkWidget *w_source;
+ GtkWidget *w_type;
GtkWidget *w_track_length;
GtkWidget *w_tp_count;
GtkWidget *w_segment_count;
if ( widgets->speeds == NULL )
return;
- widgets->duration = vik_track_get_duration ( tr );
+ widgets->duration = vik_track_get_duration ( tr, TRUE );
// Negative time or other problem
if ( widgets->duration <= 0 )
return;
break;
}
- widgets->duration = vik_track_get_duration ( widgets->tr );
+ widgets->duration = vik_track_get_duration ( widgets->tr, TRUE );
// Negative time or other problem
if ( widgets->duration <= 0 )
return;
// Assign locally
gdouble mina = widgets->draw_min_altitude_time;
- widgets->duration = vik_track_get_duration ( widgets->tr );
+ widgets->duration = vik_track_get_duration ( widgets->tr, TRUE );
// Negative time or other problem
if ( widgets->duration <= 0 )
return;
case GTK_RESPONSE_ACCEPT:
vik_track_set_comment(tr, gtk_entry_get_text(GTK_ENTRY(widgets->w_comment)));
vik_track_set_description(tr, gtk_entry_get_text(GTK_ENTRY(widgets->w_description)));
+ vik_track_set_source(tr, gtk_entry_get_text(GTK_ENTRY(widgets->w_source)));
+ vik_track_set_type(tr, gtk_entry_get_text(GTK_ENTRY(widgets->w_type)));
gtk_color_button_get_color ( GTK_COLOR_BUTTON(widgets->w_color), &(tr->color) );
tr->draw_name_mode = gtk_combo_box_get_active ( GTK_COMBO_BOX(widgets->w_namelabel) );
tr->max_number_dist_labels = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(widgets->w_number_distlabels) );
static gchar *label_texts[] = {
N_("<b>Comment:</b>"),
N_("<b>Description:</b>"),
+ N_("<b>Source:</b>"),
+ N_("<b>Type:</b>"),
N_("<b>Color:</b>"),
N_("<b>Draw Name:</b>"),
N_("<b>Distance Labels:</b>"),
widgets->w_comment = gtk_entry_new ();
if ( tr->comment )
gtk_entry_set_text ( GTK_ENTRY(widgets->w_comment), tr->comment );
- g_signal_connect_swapped ( widgets->w_comment, "activate", G_CALLBACK(a_dialog_response_accept), GTK_DIALOG(dialog) );
content_prop[cnt_prop++] = widgets->w_comment;
widgets->w_description = gtk_entry_new ();
if ( tr->description )
gtk_entry_set_text ( GTK_ENTRY(widgets->w_description), tr->description );
- g_signal_connect_swapped ( widgets->w_description, "activate", G_CALLBACK(a_dialog_response_accept), GTK_DIALOG(dialog) );
content_prop[cnt_prop++] = widgets->w_description;
+ widgets->w_source = gtk_entry_new ();
+ if ( tr->source )
+ gtk_entry_set_text ( GTK_ENTRY(widgets->w_source), tr->source );
+ content_prop[cnt_prop++] = widgets->w_source;
+
+ widgets->w_type = gtk_entry_new ();
+ if ( tr->type )
+ gtk_entry_set_text ( GTK_ENTRY(widgets->w_type), tr->type );
+ content_prop[cnt_prop++] = widgets->w_type;
+
widgets->w_color = content_prop[cnt_prop++] = gtk_color_button_new_with_color ( &(tr->color) );
static gchar *draw_name_labels[] = {
widgets->w_time_end = content[cnt++] = ui_label_new_selectable(msg);
g_free ( msg );
- g_snprintf(tmp_buf, sizeof(tmp_buf), _("%d minutes"), (int)(t2-t1)/60);
+ gint total_duration_s = (gint)(t2-t1);
+ gint segments_duration_s = (gint)vik_track_get_duration(tr,FALSE);
+ gint total_duration_m = total_duration_s/60;
+ gint segments_duration_m = segments_duration_s/60;
+ g_snprintf(tmp_buf, sizeof(tmp_buf), _("%d minutes - %d minutes moving"), total_duration_m, segments_duration_m);
widgets->w_time_dur = content[cnt++] = ui_label_new_selectable(tmp_buf);
+
+ // A tooltip to show in more readable hours:minutes
+ gchar tip_buf_total[20];
+ guint h_tot = total_duration_s/3600;
+ guint m_tot = (total_duration_s - h_tot*3600)/60;
+ g_snprintf(tip_buf_total, sizeof(tip_buf_total), "%d:%02d", h_tot, m_tot);
+ gchar tip_buf_segments[20];
+ guint h_seg = segments_duration_s/3600;
+ guint m_seg = (segments_duration_s - h_seg*3600)/60;
+ g_snprintf(tip_buf_segments, sizeof(tip_buf_segments), "%d:%02d", h_seg, m_seg);
+ gchar *tip = g_strdup_printf (_("%s total - %s in segments"), tip_buf_total, tip_buf_segments);
+ gtk_widget_set_tooltip_text ( GTK_WIDGET(widgets->w_time_dur), tip );
+ g_free (tip);
} else {
widgets->w_time_start = content[cnt++] = gtk_label_new(_("No Data"));
widgets->w_time_end = content[cnt++] = gtk_label_new(_("No Data"));