diff --git a/src/laybasic/laybasic/laySaveLayoutOptionsDialog.cc b/src/laybasic/laybasic/laySaveLayoutOptionsDialog.cc index cea3c6c11..b17c6e208 100644 --- a/src/laybasic/laybasic/laySaveLayoutOptionsDialog.cc +++ b/src/laybasic/laybasic/laySaveLayoutOptionsDialog.cc @@ -191,9 +191,20 @@ SaveLayoutOptionsDialog::commit () // create the particular options for all formats for (std::vector< std::pair >::iterator page = m_pages.begin (); page != m_pages.end (); ++page) { + if (page->first) { - page->first->commit (m_opt_array [m_technology_index].get_options (page->second), m_tech_array [m_technology_index], false); + + db::FormatSpecificWriterOptions *specific_options = m_opt_array [m_technology_index].get_options (page->second); + if (! specific_options) { + // Create a container for the options unless there is one already + specific_options = StreamWriterPluginDeclaration::plugin_for_format (page->second)->create_specific_options (); + m_opt_array [m_technology_index].set_options (specific_options); + } + + page->first->commit (specific_options, m_tech_array [m_technology_index], false); + } + } } @@ -206,7 +217,14 @@ SaveLayoutOptionsDialog::update () for (std::vector< std::pair >::iterator page = m_pages.begin (); page != m_pages.end (); ++page) { if (page->first) { - page->first->setup (m_opt_array [m_technology_index].get_options (page->second), m_tech_array [m_technology_index]); + db::FormatSpecificWriterOptions *specific_options = m_opt_array [m_technology_index].get_options (page->second); + if (! specific_options) { + // Create a container for the options unless there is one already + std::auto_ptr new_options (StreamWriterPluginDeclaration::plugin_for_format (page->second)->create_specific_options ()); + page->first->setup (new_options.get (), m_tech_array [m_technology_index]); + } else { + page->first->setup (specific_options, m_tech_array [m_technology_index]); + } } } } @@ -256,6 +274,10 @@ SaveLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, lay: technologies->begin ()[i].set_save_layout_options (m_opt_array [i]); } + // TODO: this call is required currently because otherwise the technology + // management subsystem does not notice the changes of technologies. + technologies->notify_technologies_changed (); + return true; } else { diff --git a/src/laybasic/laybasic/layTechnology.cc b/src/laybasic/laybasic/layTechnology.cc index 9e4c15bcb..e5ae729c6 100644 --- a/src/laybasic/laybasic/layTechnology.cc +++ b/src/laybasic/laybasic/layTechnology.cc @@ -184,6 +184,12 @@ Technologies::end_updates () } } +void +Technologies::notify_technologies_changed () +{ + technologies_changed (); +} + void Technologies::end_updates_no_event () { diff --git a/src/laybasic/laybasic/layTechnology.h b/src/laybasic/laybasic/layTechnology.h index ff28f3eaf..78e45f6b5 100644 --- a/src/laybasic/laybasic/layTechnology.h +++ b/src/laybasic/laybasic/layTechnology.h @@ -157,6 +157,15 @@ public: */ void end_updates_no_event (); + /** + * @brief Notifies the system of changes in technologies + * For performance reasons, changes inside a technology are not propagated to + * the system directly. Only bulk changes (such as adding or removing technologies + * are). To inform the system of individual technology updates, call this method + * after a technology or multiple technologies have been changed. + */ + void notify_technologies_changed (); + /** * @brief Checks, if a technology with the given name exists */