X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Ftrainproperties.cpp;h=d26cec08b649524606f23c232bf2e98d28a10fc7;hb=f9254f57b736927a57a2fd793ee18f6c9766dd43;hp=9eaf8d37255c55c3cd81fa0532cf14850136ed54;hpb=3e9c210ddc036cd015228504cc0803c909e27f84;p=r2c2.git diff --git a/source/engineer/trainproperties.cpp b/source/engineer/trainproperties.cpp index 9eaf8d3..d26cec0 100644 --- a/source/engineer/trainproperties.cpp +++ b/source/engineer/trainproperties.cpp @@ -28,7 +28,7 @@ TrainProperties::TrainProperties(Engineer &e, GLtk::Resources &r, Train *t): add(*(drp_type=new GLtk::Dropdown(res))); drp_type->set_geometry(GLtk::Geometry(60, geom.h-30, geom.w-70, 20)); - const map &locos=engineer.get_catalogue().get_locomotives(); + const map &locos = engineer.get_catalogue().get_locomotives(); for(map::const_iterator i=locos.begin(); i!=locos.end(); ++i) drp_type->append(format("%d %s", i->second->get_article_number(), i->second->get_name())); @@ -52,10 +52,10 @@ void TrainProperties::ok_clicked() { if(!train) { - const map &locos=engineer.get_catalogue().get_locomotives(); - map::const_iterator i=locos.begin(); + const map &locos = engineer.get_catalogue().get_locomotives(); + map::const_iterator i = locos.begin(); advance(i, drp_type->get_selected_index()); - train=engineer.add_train(*i->second, lexical_cast(ent_addr->get_text())); + train = engineer.add_train(*i->second, lexical_cast(ent_addr->get_text())); } train->set_name(ent_name->get_text()); @@ -64,4 +64,5 @@ void TrainProperties::ok_clicked() void TrainProperties::cancel_clicked() { + signal_cancel.emit(); }