- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dia)->vbox), tags_label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dia)->vbox), tags_entry, FALSE, FALSE, 0);
- gtk_widget_show_all ( tags_label );
- gtk_widget_show_all ( tags_entry );
- gtk_tooltips_set_tip (dialog_tips, tags_entry,
- _("The tags associated to the trace"),
- "");
-
- public = gtk_check_button_new_with_label(_("Public"));
- /* Set public by default */
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(public), TRUE);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dia)->vbox), public, FALSE, FALSE, 0);
- gtk_widget_show_all ( public );
- gtk_tooltips_set_tip (dialog_tips, public,
- _("Indicates if the trace is public or not"),
- "");
+ VikTRWMetadata *md = vik_trw_layer_get_metadata (vtl);
+ if (md->keywords)
+ gtk_entry_set_text(GTK_ENTRY(tags_entry), md->keywords);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dia))), tags_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dia))), tags_entry, FALSE, FALSE, 0);
+ gtk_widget_set_tooltip_text(GTK_WIDGET(tags_entry),
+ _("The tags associated to the trace"));
+
+ visibility = vik_combo_box_text_new();
+ for (vis_t = OsmTraceVis; vis_t->combostr != NULL; vis_t++)
+ vik_combo_box_text_append (visibility, vis_t->combostr);
+
+ // Set identifiable by default or use the settings for the value
+ if ( last_active < 0 ) {
+ gint find_entry = -1;
+ gint wanted_entry = -1;
+ gchar *vis = NULL;
+ if ( a_settings_get_string ( VIK_SETTINGS_OSM_TRACE_VIS, &vis ) ) {
+ // Use setting
+ if ( vis ) {
+ for (vis_t = OsmTraceVis; vis_t->apistr != NULL; vis_t++) {
+ find_entry++;
+ if (!strcmp(vis, vis_t->apistr)) {
+ wanted_entry = find_entry;
+ }
+ }
+ }
+ // If not found set it to the first entry, otherwise use the entry
+ last_active = ( wanted_entry < 0 ) ? 0 : wanted_entry;
+ }
+ else
+ last_active = 0;
+ }
+ gtk_combo_box_set_active(GTK_COMBO_BOX(visibility), last_active);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dia))), GTK_WIDGET(visibility), FALSE, FALSE, 0);
+
+ /* User should think about it first... */
+ gtk_dialog_set_default_response ( GTK_DIALOG(dia), GTK_RESPONSE_REJECT );
+
+ gtk_widget_show_all ( dia );
+ gtk_widget_grab_focus ( description_entry );