- Fix involved bug that didn't let the system terminate after

calling JumpTo


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1118 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-12 21:35:41 +00:00
parent 403a192415
commit c77de95412
3 changed files with 10 additions and 5 deletions

View File

@ -95,9 +95,10 @@ GuiBuilder::on_simulation_jump_to_clicked()
jump_to_dialog->set_transient_for(get_initial_window()); jump_to_dialog->set_transient_for(get_initial_window());
jump_to_dialog->set_target_instant(target_instant); jump_to_dialog->set_target_instant(target_instant);
jump_to_dialog->run(); jump_to_dialog->start();
} }
void void
GuiBuilder::on_view_show_threads_activate() GuiBuilder::on_view_show_threads_activate()
{ {

View File

@ -48,9 +48,8 @@ JumpToDialog::JumpToDialog(BaseObjectType* cobject, const RefPtr<Xml>& glade) :
glade->get_widget("Button.Stop", stop_button); glade->get_widget("Button.Stop", stop_button);
glade->get_widget("ProgressBar", _progress); glade->get_widget("ProgressBar", _progress);
// Attach signal handlers for the Stop button // Attach signal handlers
stop_button->signal_clicked().connect(sigc::mem_fun(*this, &JumpToDialog::_on_stop)); stop_button->signal_clicked().connect(sigc::mem_fun(*this, &JumpToDialog::_on_stop));
signal_show().connect(sigc::mem_fun(*this, &JumpToDialog::_on_jump));
signal_response().connect(sigc::hide(sigc::mem_fun(*this, &JumpToDialog::hide))); signal_response().connect(sigc::hide(sigc::mem_fun(*this, &JumpToDialog::hide)));
} }
@ -72,8 +71,9 @@ JumpToDialog::get_target_instant() const
void void
JumpToDialog::_on_jump() JumpToDialog::start()
{ {
show();
_progress->set_fraction(0.0); _progress->set_fraction(0.0);
assert(_target_instant > 0); assert(_target_instant > 0);

View File

@ -39,11 +39,15 @@ namespace sgpem
unsigned int set_target_instant(unsigned int new_target = 0); unsigned int set_target_instant(unsigned int new_target = 0);
unsigned int get_target_instant() const; unsigned int get_target_instant() const;
void start();
protected: protected:
bool on_delete_event(GdkEventAny* event); bool on_delete_event(GdkEventAny* event);
private: private:
void _on_jump(); // Hide Dialog::run() to prevent usage
void run();
void _on_stop(); void _on_stop();
void update(const Simulation& changed_simulation); void update(const Simulation& changed_simulation);