WIP: Persist search queries within DB
Changing a database or an activity re-executes the search query that was entered. Changing to a new database clears the search. Changing back to a database that had a search query entered at some earlier point, causes the old search query to be re-entered and executed.
However, this does still have some potential issues. For example, when entering a search query 'foo', and adding a new activity 'bar', causes the new activity to not show up at all (because it is immediately filtered out through the search filter). This might lead to unintuitive behaviour.
Also, this change fixes issues with search causing the height of the widgets being messed up in the exact same way as described in #797. However, I am not entirely happy with the way I fixed it, because there does seem to be a single frame of the incorrect heights being shown. This implies the incorrect heights are set initially when searching (e.g. when searching for a string that results in 0 rows, such as a random string of characters), but are then later overwritten by the resize_splitter function. If possible, I think fixing the resizing at its root cause would be a much cleaner solution, but right now I don't know how to find where this occurs.
Due to these minor issues, this is still a WIP. Merging this would not cause unintended behaviour, other than those issues mentioned (as far as I can tell).