Moved setting the state of the pretty-print button at the right place
(related to issue 7305)