Asking whether to apply a .lyp file on multiple layouts on MRU-listed .lyp files too.

This commit is contained in:
Matthias Koefferlein 2021-10-18 23:10:39 +02:00
parent 4d64e95680
commit 04deb785ba
2 changed files with 36 additions and 32 deletions

View File

@ -2025,7 +2025,17 @@ MainWindow::cm_load_layer_props ()
if (current_view ()) {
std::string fn;
if (mp_lprops_fdia->get_open (fn, tl::to_string (QObject::tr ("Load Layer Properties File")))) {
load_layer_props_from_file (fn);
add_to_other_mru (fn, cfg_mru_layer_properties);
}
} else {
throw tl::Exception (tl::to_string (QObject::tr ("No view open to load the layer properties for")));
}
}
void
MainWindow::load_layer_props_from_file (const std::string &fn)
{
int target_cv_index = -2;
if (current_view ()->cellviews () > 1 && is_single_cv_layer_properties_file (fn)) {
@ -2054,13 +2064,6 @@ MainWindow::cm_load_layer_props ()
} else {
load_layer_properties (fn, false /*current view only*/, false /*don't add default*/);
}
add_to_other_mru (fn, cfg_mru_layer_properties);
}
} else {
throw tl::Exception (tl::to_string (QObject::tr ("No view open to load the layer properties for")));
}
}
void
@ -3238,7 +3241,7 @@ MainWindow::open_recent_layer_properties (size_t n)
if (n < m_mru_layer_properties.size ()) {
std::string fn = m_mru_layer_properties [n];
load_layer_properties (fn, false /*current view only*/, false /*don't add default*/);
load_layer_props_from_file (fn);
add_to_other_mru (fn, cfg_mru_layer_properties); // make it the latest
}

View File

@ -805,6 +805,7 @@ private:
int dirty_files (std::string &dirty_files);
void load_layer_props_from_file (const std::string &fn);
void interactive_close_view (int index, bool all_cellviews);
void call_on_current_view (void (lay::LayoutView::*func) (), const std::string &op_desc);
void current_view_changed ();