Apply property changes before switching tree node in properties editor

This commit is contained in:
Matthias Koefferlein 2024-09-08 18:48:12 +02:00
parent 4f72d3353f
commit d902f5d53d
1 changed files with 19 additions and 0 deletions

View File

@ -308,6 +308,25 @@ PropertiesDialog::current_index_changed (const QModelIndex &index, const QModelI
} else {
if (m_index >= 0 && m_index < int (mp_properties_pages.size ()) && ! mp_properties_pages [m_index]->readonly ()) {
try {
db::Transaction t (mp_manager, tl::to_string (QObject::tr ("Apply changes")), m_transaction_id);
mp_properties_pages [m_index]->apply ();
if (! t.is_empty ()) {
m_transaction_id = t.id ();
}
} catch (...) {
}
mp_properties_pages [m_index]->update ();
}
if (mp_tree_model->parent (index).isValid ()) {
m_index = mp_tree_model->page_index (index);