UserInterface::~UserInterface()
{
while(!dyn_dialogs.empty())
- delete dyn_dialogs.front();
+ delete *dyn_dialogs.begin();
delete root_arrangement;
}
void UserInterface::add_dynamic_dialog(DynamicDialog &dd)
{
- dyn_dialogs.push_back(&dd);
+ dyn_dialogs.insert(&dd);
}
void UserInterface::remove_dynamic_dialog(DynamicDialog &dd)
{
- dyn_dialogs.erase(remove(dyn_dialogs.begin(), dyn_dialogs.end(), &dd), dyn_dialogs.end());
+ dyn_dialogs.erase(&dd);
}
void UserInterface::show_train(Train &train)
{
TrainDialog *dlg = new TrainDialog(engineer, train);
root.add(*dlg);
- dlg->autosize();
}
void UserInterface::show_zone(Zone &zone)
status_timeout = Time::TimeStamp();
}
- for(list<DynamicDialog *>::iterator i=dyn_dialogs.begin(); i!=dyn_dialogs.end(); ++i)
+ for(set<DynamicDialog *>::iterator i=dyn_dialogs.begin(); i!=dyn_dialogs.end(); ++i)
(*i)->update();
}
Msp::GLtk::Arrangement *root_arrangement;
MainWindow main_wnd;
- std::list<DynamicDialog *> dyn_dialogs;
+ std::set<DynamicDialog *> dyn_dialogs;
bool import_active;
Msp::Time::TimeStamp status_timeout;