diff options
Diffstat (limited to 'src/gui/MachinaGUI.cpp')
-rw-r--r-- | src/gui/MachinaGUI.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index 5044dcb..4f26c66 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -222,11 +222,10 @@ MachinaGUI::~MachinaGUI() bool MachinaGUI::evolve_callback() { - if (_evolve) { - if (_evolver->improvement()) { - //_engine->driver()->set_machine(_evolver->best()); - _canvas->build(_evolver->best(), _menu_view_labels->get_active()); - } + if (_evolve && _evolver->improvement()) { + _engine->driver()->set_machine( + SPtr<Machine>(new Machine(_evolver->best()))); + _controller->announce(_engine->machine()); } return true; @@ -316,13 +315,12 @@ MachinaGUI::evolve_toggled() _engine->driver()->set_machine(SPtr<Machine>()); _evolver->start(); } else { - _evolver->stop(); + _evolver->join(); _evolve = false; SPtr<Machine> new_machine = SPtr<Machine>( - new Machine(*_evolver->best())); + new Machine(_evolver->best())); _engine->driver()->set_machine(new_machine); - _canvas->build(new_machine, _menu_view_labels->get_active()); - new_machine->activate(); + _controller->announce(_engine->machine()); _engine->driver()->activate(); } } |