Make our state saving an enum, for both sanity and better debugging
This way at least we get meaningful names when debugging these state transitions. Also, it's better in every way. I've used an IntEnum here just so that I keep the state-changed signal signature, though there's no reason that needs to remain the same, really.
Showing with 15 additions and 12 deletions