preferences: make gap time configurable

Instead of using a constant 45min gap, put it in the preferences.

This still needs some work: the change in gap time isn't reflected
immediately, only after the next ping fires.