Created general method for popup creating and adapted existing methods and events using file chooser dialog