Merge remote-tracking branch 'origin/feature/7785_snslistener_out_of_run_behaviour'
Some minor clean-up code refactoring.

Refs #6692
Put all the period widgets update code to one function.

Plus minor clean-up/refactoring of the code itself.

Refs #6692
Update widgets only if number of periods has changed.

Refs #6692
Merge branch 'feature/6692_muon_save_periods' into develop