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);