Settings window + Page editing: Refactor the code for the grips

Signed-off-by: Jerome Flesch <jflesch@gmail.com>