- if (ending_name_edit) {
- /* already doing this, and focus out or other event has caused
- us to re-enter this code.
- */
- return;
- }
-
- PBD::Unwinder<bool> uw (ending_name_edit, true);
-
- bool edit_next = false;
- bool edit_prev = false;
-
- switch (response) {
- case RESPONSE_CANCEL:
- break;
- case RESPONSE_OK:
- name_entry_changed ();
- break;
- case RESPONSE_ACCEPT:
- name_entry_changed ();
- edit_next = true;
- case RESPONSE_APPLY:
- name_entry_changed ();
- edit_prev = true;
- }
-
- /* this will delete the name_entry. but it will also drop focus, which
- * will cause another callback to this function, so set name_entry = 0
- * first to ensure we don't double-remove etc. etc.
- */
-
- Gtk::Entry* tmp = name_entry;
- name_entry = 0;
- name_hbox.remove (*tmp);
-
- /* put the name label back */
-
- name_hbox.pack_end (name_label);
- name_label.show ();
-
- if (edit_next) {