mirror of https://github.com/KLayout/klayout.git
'Refresh Libraries' feature in File menu, new GSI method Library#refresh_all (static)
This commit is contained in:
parent
5625fb95dd
commit
67de518611
|
|
@ -248,6 +248,16 @@ LibraryManager::lib_internal (lib_id_type id) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LibraryManager::refresh_all ()
|
||||||
|
{
|
||||||
|
for (std::vector<Library *>::iterator l = m_libs.begin (); l != m_libs.end (); ++l) {
|
||||||
|
if (*l) {
|
||||||
|
(*l)->refresh ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LibraryManager::clear ()
|
LibraryManager::clear ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,11 @@ public:
|
||||||
*/
|
*/
|
||||||
void clear ();
|
void clear ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Refreshes all libraries
|
||||||
|
*/
|
||||||
|
void refresh_all ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Library *> m_libs;
|
std::vector<Library *> m_libs;
|
||||||
lib_name_map m_lib_by_name;
|
lib_name_map m_lib_by_name;
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@ static std::vector<db::lib_id_type> library_ids ()
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void refresh_all ()
|
||||||
|
{
|
||||||
|
db::LibraryManager::instance ().refresh_all ();
|
||||||
|
}
|
||||||
|
|
||||||
static void register_lib (db::Library *lib, const std::string &name)
|
static void register_lib (db::Library *lib, const std::string &name)
|
||||||
{
|
{
|
||||||
lib->set_name (name);
|
lib->set_name (name);
|
||||||
|
|
@ -184,6 +189,11 @@ LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
||||||
"\n"
|
"\n"
|
||||||
"This method has been introduced in version 0.27."
|
"This method has been introduced in version 0.27."
|
||||||
) +
|
) +
|
||||||
|
gsi::method ("refresh_all", &refresh_all,
|
||||||
|
"@brief Calls \\refresh on all libraries.\n"
|
||||||
|
"\n"
|
||||||
|
"This convenience method has been introduced in version 0.30.4."
|
||||||
|
) +
|
||||||
gsi::method_ext ("register", ®ister_lib, gsi::arg ("name"),
|
gsi::method_ext ("register", ®ister_lib, gsi::arg ("name"),
|
||||||
"@brief Registers the library with the given name\n"
|
"@brief Registers the library with the given name\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ static const char *cm_symbols[] = {
|
||||||
"cm_save",
|
"cm_save",
|
||||||
"cm_save_all",
|
"cm_save_all",
|
||||||
"cm_reload",
|
"cm_reload",
|
||||||
|
"cm_refresh",
|
||||||
"cm_close",
|
"cm_close",
|
||||||
"cm_close_all",
|
"cm_close_all",
|
||||||
"cm_clone",
|
"cm_clone",
|
||||||
|
|
|
||||||
|
|
@ -2555,6 +2555,12 @@ MainWindow::cm_writer_options ()
|
||||||
mp_layout_save_options->edit_global_options (dispatcher (), db::Technologies::instance ());
|
mp_layout_save_options->edit_global_options (dispatcher (), db::Technologies::instance ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MainWindow::cm_refresh ()
|
||||||
|
{
|
||||||
|
db::LibraryManager::instance ().refresh_all ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainWindow::cm_new_panel ()
|
MainWindow::cm_new_panel ()
|
||||||
{
|
{
|
||||||
|
|
@ -4036,6 +4042,8 @@ MainWindow::menu_activated (const std::string &symbol)
|
||||||
cm_reader_options ();
|
cm_reader_options ();
|
||||||
} else if (symbol == "cm_writer_options") {
|
} else if (symbol == "cm_writer_options") {
|
||||||
cm_writer_options ();
|
cm_writer_options ();
|
||||||
|
} else if (symbol == "cm_refresh") {
|
||||||
|
cm_refresh ();
|
||||||
} else if (symbol == "cm_new_panel") {
|
} else if (symbol == "cm_new_panel") {
|
||||||
cm_new_panel ();
|
cm_new_panel ();
|
||||||
} else if (symbol == "cm_new_layout") {
|
} else if (symbol == "cm_new_layout") {
|
||||||
|
|
@ -4449,6 +4457,7 @@ public:
|
||||||
menu_entries.push_back (lay::menu_item ("cm_close_all", "close_all:edit", at, tl::to_string (QObject::tr ("Close All(Shift+Ctrl+W)"))));
|
menu_entries.push_back (lay::menu_item ("cm_close_all", "close_all:edit", at, tl::to_string (QObject::tr ("Close All(Shift+Ctrl+W)"))));
|
||||||
menu_entries.push_back (lay::menu_item ("cm_clone", "clone", at, tl::to_string (QObject::tr ("Clone Panel"))));
|
menu_entries.push_back (lay::menu_item ("cm_clone", "clone", at, tl::to_string (QObject::tr ("Clone Panel"))));
|
||||||
menu_entries.push_back (lay::menu_item ("cm_reload", "reload:edit", at, tl::to_string (QObject::tr ("Reload(Ctrl+R)"))));
|
menu_entries.push_back (lay::menu_item ("cm_reload", "reload:edit", at, tl::to_string (QObject::tr ("Reload(Ctrl+R)"))));
|
||||||
|
menu_entries.push_back (lay::menu_item ("cm_refresh", "refresh:edit", at, tl::to_string (QObject::tr ("Refresh Libraries"))));
|
||||||
menu_entries.push_back (lay::menu_item ("cm_pull_in", "pull_in:edit", at, tl::to_string (QObject::tr ("Pull In Other Layout"))));
|
menu_entries.push_back (lay::menu_item ("cm_pull_in", "pull_in:edit", at, tl::to_string (QObject::tr ("Pull In Other Layout"))));
|
||||||
menu_entries.push_back (lay::menu_item ("cm_reader_options", "reader_options", at, tl::to_string (QObject::tr ("Reader Options"))));
|
menu_entries.push_back (lay::menu_item ("cm_reader_options", "reader_options", at, tl::to_string (QObject::tr ("Reader Options"))));
|
||||||
menu_entries.push_back (lay::separator ("open_recent_group", at));
|
menu_entries.push_back (lay::separator ("open_recent_group", at));
|
||||||
|
|
|
||||||
|
|
@ -837,6 +837,7 @@ private:
|
||||||
void cm_pull_in ();
|
void cm_pull_in ();
|
||||||
void cm_reader_options ();
|
void cm_reader_options ();
|
||||||
void cm_writer_options ();
|
void cm_writer_options ();
|
||||||
|
void cm_refresh ();
|
||||||
void cm_new_panel ();
|
void cm_new_panel ();
|
||||||
void cm_new_layout ();
|
void cm_new_layout ();
|
||||||
void cm_clone ();
|
void cm_clone ();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue