From ba60be88bc748401c6a7c593307a52f463fbec5c Mon Sep 17 00:00:00 2001 From: tchernobog Date: Mon, 28 Aug 2006 20:23:42 +0000 Subject: [PATCH] - Remove useless pointer from SimulationController member data git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@950 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/gui_builder.cc | 13 ++++++++----- src/gui_builder.hh | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 0fda5db..19cea54 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -291,8 +291,8 @@ GuiBuilder::open_file(const std::string& filename) // --------------------------------- -SimulationController::SimulationController(Simulation& simulation, Glib::RefPtr main_window) - : _sim(simulation), _refXml(main_window), _break_requested(false) +SimulationController::SimulationController(Simulation& simulation, Glib::RefPtr refXml) + : _sim(simulation), _break_requested(false) { using namespace Gtk; @@ -301,9 +301,10 @@ SimulationController::SimulationController(Simulation& simulation, Glib::RefPtr< // Start, pause and stop simulation from the toolbar // TODO: can we use action groups instead of this? - _refXml->get_widget("ToolBar.Play", _toolbt_start); - _refXml->get_widget("ToolBar.Pause", _toolbt_pause); - _refXml->get_widget("ToolBar.Stop", _toolbt_stop); + refXml->get_widget("ToolBar.Play", _toolbt_start); + refXml->get_widget("ToolBar.Pause", _toolbt_pause); + refXml->get_widget("ToolBar.Stop", _toolbt_stop); + _toolbt_start->signal_clicked().connect(sigc::mem_fun(*this, &SimulationController::on_simulation_run)); _toolbt_pause->signal_clicked().connect(sigc::mem_fun(*this, &SimulationController::on_simulation_pause)); _toolbt_stop->signal_clicked().connect(sigc::mem_fun(*this, &SimulationController::on_simulation_stop)); @@ -358,7 +359,9 @@ SimulationController::on_simulation_stop() void SimulationController::update(const Simulation& simulation) { +#ifndef NDEBUG std::cerr << "SimulationController::update(), simulation state == " << std::hex << simulation.get_state() << std::endl; +#endif if(_break_requested) return; diff --git a/src/gui_builder.hh b/src/gui_builder.hh index 6bc6048..1f3478e 100644 --- a/src/gui_builder.hh +++ b/src/gui_builder.hh @@ -60,7 +60,6 @@ namespace sgpem bool run_simulation_adaptor(); Simulation& _sim; - Glib::RefPtr _refXml; bool _break_requested; Gtk::ToolButton* _toolbt_start;