- gtk_combo_box_append_text(visibility, vis_t->combostr);
- /* Set identifiable by default */
- gtk_combo_box_set_active(visibility, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dia)->vbox), GTK_WIDGET(visibility), FALSE, FALSE, 0);
+ 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);