We want the dialog to be displayed after the history is written.

Without this the last activated modules are not in the dialog.
Share code between the /copy/copy parts/ routines.
Merge branch 'fix-copy-parts'

* fix-copy-parts:
  Share code between the /copy/copy parts/ routines.
  We want the dialog to be displayed after the history is written.