Reorganised code for easier understanding
Recoded the Application Options dialog

Now requires to click "Save" button; Pressing the "X" button will not
save your settings.