migrate utility functions to screencast controller

the function moved here is getDahuFileFromDirectory, used
to get the name of the presentation to create relating to
the given directory
factorize layout creation code

this code is used when we open an existing project
or when we create a new empty one.