From c77de954122ecaf912632768322b24a486ccd4c7 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Tue, 12 Sep 2006 21:35:41 +0000 Subject: [PATCH] - 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 --- src/gui_builder.cc | 3 ++- src/jump_to_dialog.cc | 6 +++--- src/jump_to_dialog.hh | 6 +++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 7c6ebc8..a08dabd 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -95,9 +95,10 @@ GuiBuilder::on_simulation_jump_to_clicked() jump_to_dialog->set_transient_for(get_initial_window()); jump_to_dialog->set_target_instant(target_instant); - jump_to_dialog->run(); + jump_to_dialog->start(); } + void GuiBuilder::on_view_show_threads_activate() { diff --git a/src/jump_to_dialog.cc b/src/jump_to_dialog.cc index b814054..e3807bd 100644 --- a/src/jump_to_dialog.cc +++ b/src/jump_to_dialog.cc @@ -48,9 +48,8 @@ JumpToDialog::JumpToDialog(BaseObjectType* cobject, const RefPtr& glade) : glade->get_widget("Button.Stop", stop_button); 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)); - signal_show().connect(sigc::mem_fun(*this, &JumpToDialog::_on_jump)); signal_response().connect(sigc::hide(sigc::mem_fun(*this, &JumpToDialog::hide))); } @@ -72,8 +71,9 @@ JumpToDialog::get_target_instant() const void -JumpToDialog::_on_jump() +JumpToDialog::start() { + show(); _progress->set_fraction(0.0); assert(_target_instant > 0); diff --git a/src/jump_to_dialog.hh b/src/jump_to_dialog.hh index a4f75fd..fd07e85 100644 --- a/src/jump_to_dialog.hh +++ b/src/jump_to_dialog.hh @@ -39,11 +39,15 @@ namespace sgpem unsigned int set_target_instant(unsigned int new_target = 0); unsigned int get_target_instant() const; + void start(); + protected: bool on_delete_event(GdkEventAny* event); private: - void _on_jump(); + // Hide Dialog::run() to prevent usage + void run(); + void _on_stop(); void update(const Simulation& changed_simulation);