Small refactor to reduce this line length.
Renaming and moving the config check (making it static).
Using the config check method to forbid the write of an incorrect config

By previously separating the config check method from its use, we are
now able to add a check on the configuration that's about to be applied
to the configuration file. If there's an error in the submitted
configuration, the user will be prompted with an error message, the
configuration file won't be written and the user will get a change to
change the configuration throught the dialog.