X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Fvehiclespanel.cpp;h=cd3b7cf25fa3be207edaa6c6c1db80f9ab887c34;hb=64a4768a48db0f8fde3bf93c512024698f12e3ca;hp=d906f6cb4218e5976a0b0d468941a12553c1d049;hpb=b261812f040caed52bc3de783e8bcb86b222a9ed;p=r2c2.git diff --git a/source/engineer/vehiclespanel.cpp b/source/engineer/vehiclespanel.cpp index d906f6c..cd3b7cf 100644 --- a/source/engineer/vehiclespanel.cpp +++ b/source/engineer/vehiclespanel.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include "libr2c2/layout.h" #include "libr2c2/vehicle.h" @@ -40,12 +41,8 @@ VehiclesPanel::VehiclesPanel(Train &t): void VehiclesPanel::add_clicked() { - GLtk::Container *root = parent; - while(root->get_parent()) - root = root->get_parent(); - NewVehicleDialog *dlg = new NewVehicleDialog(train); - root->add(*dlg); + find_ancestor()->add(*dlg); dlg->autosize(); }