diff --git a/src/lay/lay/layTechnologyController.cc b/src/lay/lay/layTechnologyController.cc index 7438790d7..b01d2c2f9 100644 --- a/src/lay/lay/layTechnologyController.cc +++ b/src/lay/lay/layTechnologyController.cc @@ -214,7 +214,7 @@ TechnologyController::technologies_changed () void TechnologyController::technology_changed (lay::Technology *) { - update_menu (); + technologies_changed (); } bool diff --git a/src/laybasic/laybasic/layLoadLayoutOptionsDialog.cc b/src/laybasic/laybasic/layLoadLayoutOptionsDialog.cc index fcd2f7333..cb4122c46 100644 --- a/src/laybasic/laybasic/layLoadLayoutOptionsDialog.cc +++ b/src/laybasic/laybasic/layLoadLayoutOptionsDialog.cc @@ -250,9 +250,11 @@ LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay: config_root->config_set (cfg_reader_options_show_always, tl::to_string (m_show_always)); i = 0; + technologies->begin_updates (); for (lay::Technologies::iterator t = technologies->begin (); t != technologies->end () && i < m_opt_array.size (); ++t, ++i) { technologies->begin ()[i].set_load_layout_options (m_opt_array [i]); } + technologies->end_updates (); return true; diff --git a/src/laybasic/laybasic/layTechnology.cc b/src/laybasic/laybasic/layTechnology.cc index 8934cb547..058e02f49 100644 --- a/src/laybasic/laybasic/layTechnology.cc +++ b/src/laybasic/laybasic/layTechnology.cc @@ -60,17 +60,24 @@ Technologies::operator= (const Technologies &other) { if (&other != this) { m_technologies = other.m_technologies; - technologies_changed_event (); + for (iterator i = begin (); i != end (); ++i) { + i->technology_changed_with_sender_event.add (this, &Technologies::technology_changed); + } + technologies_changed (); } return *this; } +static std::auto_ptr sp_technologies; + lay::Technologies * Technologies::instance () { - static lay::Technologies s_technologies; - return &s_technologies; + if (! sp_technologies.get ()) { + sp_technologies.reset (new lay::Technologies ()); + } + return sp_technologies.get (); } static tl::XMLElementList xml_elements () @@ -167,6 +174,16 @@ Technologies::clear () } } +void +Technologies::technology_changed (Technology *t) +{ + if (m_in_update) { + m_changed = true; + } else { + technology_changed_event (t); + } +} + void Technologies::technologies_changed () { diff --git a/src/laybasic/laybasic/layTechnology.h b/src/laybasic/laybasic/layTechnology.h index a7d130c7d..82bc59a8e 100644 --- a/src/laybasic/laybasic/layTechnology.h +++ b/src/laybasic/laybasic/layTechnology.h @@ -234,10 +234,7 @@ protected: /** * @brief Forward the event from the individual technologies */ - void technology_changed (Technology *t) - { - technology_changed_event (t); - } + void technology_changed (Technology *t); /** * @brief Sends the technologies_changed event