mirror of https://github.com/KLayout/klayout.git
WIP: some bug fixes.
This commit is contained in:
parent
e6f696b8dc
commit
430d140016
|
|
@ -284,9 +284,14 @@ TechnologyController::update_current_technology ()
|
||||||
action.set_title (title);
|
action.set_title (title);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t it = 0;
|
std::map<std::string, const lay::Technology *> tech_by_name;
|
||||||
for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end () && it < m_tech_actions.size (); ++t, ++it) {
|
for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t) {
|
||||||
m_tech_actions[it].set_checked (t->name () == m_current_technology);
|
tech_by_name.insert (std::make_pair (t->name (), t.operator-> ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
int it = 0;
|
||||||
|
for (std::map<std::string, const lay::Technology *>::const_iterator t = tech_by_name.begin (); t != tech_by_name.end (); ++t, ++it) {
|
||||||
|
m_tech_actions[it].set_checked (t->second->name () == m_current_technology);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,17 +328,22 @@ TechnologyController::update_menu ()
|
||||||
|
|
||||||
m_tech_actions.clear ();
|
m_tech_actions.clear ();
|
||||||
|
|
||||||
|
std::map<std::string, const lay::Technology *> tech_by_name;
|
||||||
|
for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t) {
|
||||||
|
tech_by_name.insert (std::make_pair (t->name (), t.operator-> ()));
|
||||||
|
}
|
||||||
|
|
||||||
int it = 0;
|
int it = 0;
|
||||||
for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t, ++it) {
|
for (std::map<std::string, const lay::Technology *>::const_iterator t = tech_by_name.begin (); t != tech_by_name.end (); ++t, ++it) {
|
||||||
|
|
||||||
std::string title = tech_string_from_name (t->name ());
|
std::string title = tech_string_from_name (t->first);
|
||||||
|
|
||||||
m_tech_actions.push_back (pr->create_config_action ("", cfg_initial_technology, t->name ()));
|
m_tech_actions.push_back (pr->create_config_action ("", cfg_initial_technology, t->first));
|
||||||
m_tech_actions.back ().set_title (title); // setting the title here avoids interpretation of '(...)' etc.
|
m_tech_actions.back ().set_title (title); // setting the title here avoids interpretation of '(...)' etc.
|
||||||
m_tech_actions.back ().set_checkable (true);
|
m_tech_actions.back ().set_checkable (true);
|
||||||
m_tech_actions.back ().set_checked (t->name () == m_current_technology);
|
m_tech_actions.back ().set_checked (t->first == m_current_technology);
|
||||||
for (std::vector<std::string>::const_iterator t = tech_group.begin (); t != tech_group.end (); ++t) {
|
for (std::vector<std::string>::const_iterator tg = tech_group.begin (); tg != tech_group.end (); ++tg) {
|
||||||
pr->menu ()->insert_item (*t + ".end", "technology_" + tl::to_string (it), m_tech_actions.back ());
|
pr->menu ()->insert_item (*tg + ".end", "technology_" + tl::to_string (it), m_tech_actions.back ());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -353,7 +363,7 @@ TechnologyController::show_editor ()
|
||||||
// determine the technology files that need to be deleted and delete them
|
// determine the technology files that need to be deleted and delete them
|
||||||
std::set<std::string> files_before;
|
std::set<std::string> files_before;
|
||||||
for (lay::Technologies::const_iterator t = new_tech.begin (); t != new_tech.end (); ++t) {
|
for (lay::Technologies::const_iterator t = new_tech.begin (); t != new_tech.end (); ++t) {
|
||||||
if (! ! t->tech_file_path ().empty () && ! t->is_persisted ()) {
|
if (! t->tech_file_path ().empty () && ! t->is_persisted ()) {
|
||||||
files_before.insert (t->tech_file_path ());
|
files_before.insert (t->tech_file_path ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -635,7 +635,6 @@ ConfigureAction::triggered ()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pr->config_set (m_cname, m_cvalue);
|
m_pr->config_set (m_cname, m_cvalue);
|
||||||
m_pr->config_end ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,8 @@ Technology::Technology (const Technology &d)
|
||||||
m_explicit_base_path (d.m_explicit_base_path), m_default_base_path (d.m_default_base_path),
|
m_explicit_base_path (d.m_explicit_base_path), m_default_base_path (d.m_default_base_path),
|
||||||
m_load_layout_options (d.m_load_layout_options),
|
m_load_layout_options (d.m_load_layout_options),
|
||||||
m_save_layout_options (d.m_save_layout_options),
|
m_save_layout_options (d.m_save_layout_options),
|
||||||
m_lyp_path (d.m_lyp_path), m_add_other_layers (d.m_add_other_layers), m_persisted (d.m_persisted)
|
m_lyp_path (d.m_lyp_path), m_add_other_layers (d.m_add_other_layers), m_persisted (d.m_persisted),
|
||||||
|
m_readonly (d.m_readonly), m_lyt_file (d.m_lyt_file)
|
||||||
{
|
{
|
||||||
for (std::vector <TechnologyComponent *>::const_iterator c = d.m_components.begin (); c != d.m_components.end (); ++c) {
|
for (std::vector <TechnologyComponent *>::const_iterator c = d.m_components.begin (); c != d.m_components.end (); ++c) {
|
||||||
m_components.push_back ((*c)->clone ());
|
m_components.push_back ((*c)->clone ());
|
||||||
|
|
@ -277,6 +278,8 @@ Technology &Technology::operator= (const Technology &d)
|
||||||
m_lyp_path = d.m_lyp_path;
|
m_lyp_path = d.m_lyp_path;
|
||||||
m_add_other_layers = d.m_add_other_layers;
|
m_add_other_layers = d.m_add_other_layers;
|
||||||
m_persisted = d.m_persisted;
|
m_persisted = d.m_persisted;
|
||||||
|
m_readonly = d.m_readonly;
|
||||||
|
m_lyt_file = d.m_lyt_file;
|
||||||
|
|
||||||
for (std::vector <TechnologyComponent *>::const_iterator c = m_components.begin (); c != m_components.end (); ++c) {
|
for (std::vector <TechnologyComponent *>::const_iterator c = m_components.begin (); c != m_components.end (); ++c) {
|
||||||
delete *c;
|
delete *c;
|
||||||
|
|
@ -400,7 +403,8 @@ Technology::load (const std::string &fn)
|
||||||
// use the tech file's path as the default base path
|
// use the tech file's path as the default base path
|
||||||
std::string lyt_file = tl::to_string (QFileInfo (tl::to_qstring (fn)).absoluteDir ().path ());
|
std::string lyt_file = tl::to_string (QFileInfo (tl::to_qstring (fn)).absoluteDir ().path ());
|
||||||
set_default_base_path (lyt_file);
|
set_default_base_path (lyt_file);
|
||||||
set_tech_file_path (lyt_file);
|
|
||||||
|
set_tech_file_path (fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue