There's been a very noticable UI trend going for a while now. I think it started with browsers... when you close a browser and reopen it, it restores all the pages to how they were when you shut it down.
Then Apple took the idea in MacOS and ran with it. It's an amazing thing to see, you can reboot a Macintosh and when you login again, everything, all the apps, window positions, the lot are exactly how they were when you left them.
And of course Android sort of does this. You press "home", go to another app, go back to the first app, and it's where you left it.
One app that can't do it is squirrelsql. So there would be a few things I think to make it happen:
1) remember open tabs
2) have those tabs actually connected where appropriate
3) remember the text in the SQL tab and/or what file it was editing.
4) Remember the log
5) Remember the results from before
6) If one want to go the whole hog, remember the state of the Objects window.
The one that interests me the most is (3) having the SQL tab for a particular database remember its state, whether it be the text in there, or the file location it was editing. Basically, I'm sick of losing my work of what I was working on in that window.
(4) , (5) and (6) are kind of nice to haves, not really essential, but I mention for completeness.
(1), (2) and (3) seem relatively easy to make happen. The only niggle I can see is maybe the SQL text is too big to store in Java preferences, in which case you'd have to find a disk location for it.
So I would imagine the implementation would be to attach a hook to the exit function. Write to some area, either the java defaults, or some scratch area the state. Then load that state up again when the app starts. And I would say if you close a particular tab, also hook that, record those things, and reopen them when you open the same database.
One thing that also should change I think, is if I open 2 tabs to database "abc", "1 - abc" and "2 - abc" then close them. Then I open a new tab to database "abc", instead of being "1 - abc", it becomes "3 - abc" for some strange reason. That seems wrong it me, it should take the lowest vacant number and become "1 - abc" and then load the state associated with "1 - abc" that was saved.
The other question is what if a connection can't be reestablished, I would say just be fairly silent about that, put it in the log window, don't bother the user.
Of course, I always use the saved passwords option and auto connect. I don't see the point of the other options, but they might have to bother the user, I don't know.
Parts of this request should be implement by the new Saved Session group feature. Snapshot with this feature are available here
https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20240512_2133/
and here
https://github.com/squirrel-sql-client/squirrel-sql-snapshot-releases/releases/tag/snapshot-20240512_2133
Excerpt from change log:
Last edit: Gerd Wagner 2024-05-12
Glad to hear that something like what I'm suggesting is on the table. I would also like to add that I think it's important this is the default behavior that closing and opening the program takes you back to where you were. Of course, since the beginning of time, programs have had abilities to save their state. But having ALL your programs neatly close down, and neatly open back to where they were, is where I want to see things headed, and where the rest of the industry has gone. SquirrelSQL tends to have a bad habit of having the best behavior optional, and the most annoying behavior the default.