Improve updating hg repositories
Improve coding style and add accelerators to GUI buttons
remove unnecessary braces