- Small fix for the sake of code correctness

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1037 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-07 09:56:56 +00:00
parent 3fe76dad2d
commit 1203372f3e
3 changed files with 10 additions and 2 deletions

View File

@ -82,3 +82,9 @@ History::set_notify_enabled(bool enabled)
return old_value; return old_value;
} }
bool
History::is_notify_enabled() const
{
return _notify;
}

View File

@ -143,6 +143,7 @@ namespace sgpem
* \return The old value * \return The old value
*/ */
virtual bool set_notify_enabled(bool enabled = true); virtual bool set_notify_enabled(bool enabled = true);
bool is_notify_enabled() const;
virtual void reset() = 0; virtual void reset() = 0;

View File

@ -84,13 +84,14 @@ JumpToDialog::_on_jump()
History& h = sim.get_history(); History& h = sim.get_history();
sim.attach(*this); sim.attach(*this);
h.set_notify_enabled(false); bool reenable = h.is_notify_enabled();
try try
{ {
if(_target_instant < h.get_size() - 1) if(_target_instant < h.get_size() - 1)
sim.jump_to(_target_instant); sim.jump_to(_target_instant);
else else
sim.jump_to(h.get_size() - 1); sim.jump_to(h.get_size() - 1);
h.set_notify_enabled(false);
while(h.get_front() < _target_instant) while(h.get_front() < _target_instant)
{ {
sim.run(); sim.run();
@ -102,7 +103,7 @@ JumpToDialog::_on_jump()
{ {
// FIXME: correctly manage exceptions! // FIXME: correctly manage exceptions!
} }
h.set_notify_enabled(true); h.set_notify_enabled(reenable);
sim.detach(*this); sim.detach(*this);
_ok_button->set_sensitive(true); _ok_button->set_sensitive(true);