- const Catalogue::VehicleMap &cat_vtypes = engineer.get_layout().get_catalogue().get_vehicles();
- for(Catalogue::VehicleMap::const_iterator i=cat_vtypes.begin(); i!=cat_vtypes.end(); ++i)
- if(i->second->is_locomotive())
- loco_types.append(i->second);
+ list<VehicleType *> veh_types = engineer.get_layout().get_catalogue().get_list<VehicleType>();
+ for(list<VehicleType *>::iterator i=veh_types.begin(); i!=veh_types.end(); ++i)
+ if((*i)->is_locomotive())
+ loco_types.append(*i);
+}
+
+void NewTrainDialog::prefill(const Driver::DetectedLocomotive &loco)
+{
+ drp_protocol->set_selected_index(protocols.find(loco.protocol));
+ ent_address->set_text(lexical_cast<string>(loco.address));
+ ent_name->set_text(loco.name);