]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/newtraindialog.cpp
Add a missing function for the locomotive import UI
[r2c2.git] / source / engineer / newtraindialog.cpp
index 006a819b50d5a631ee86ef945858e4e709c92e5a..ef9fbf82b6dfe79a58924f65f5e34b610b31acd2 100644 (file)
@@ -49,6 +49,13 @@ NewTrainDialog::NewTrainDialog(Engineer &e):
                                loco_types.append(vt);
 }
 
+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);
+}
+
 void NewTrainDialog::on_response(int code)
 {
        if(code)