Skip to content

Conversation

@xpusostomos
Copy link

Earlier in the year, I opened this request...
https://sourceforge.net/p/squirrel-sql/feature-requests/619/

A quick recap...
It is my belief that the future will be tiling window managers, and instead of each app having its own tab mechanism, your window manager will implement a grand unified tabbing scheme.

With this in mind, I had a few requests, one is that the title bar reflected the database opened. And secondly that squirrel implemented one frame per connection enforced as an optional feature.

Gerd Wagner very kindly implemented the title bar update mechanism, however as it happens, it doesn't help me, because it's only implemented for the main window, and not when tabs are detached into external windows. I don't think he was interested in the one frame per connection model, which is understandable, so that's what this pull request is about. It does the following:

  1. has a new General Preference - Use new Frame per connection.
  2. when the above is selected, new tabs on the main frame are forcibly ejected onto a new Frame.
  3. Not wanting tabs on the new Frame, when the option is turned on, tabs are disabled. (The mechanism is a bit of a kludge... the tab bar height is set to zero, and I interfere with the painting to effectively make the tab bar invisible. I then add a centered title to show the user what the connection is.
  4. The title of the new frame is set to the connection name. I did not make this conditional on the option, because this is for sure an oversight of the original implementation that should have accounted for all frames having the correct title. However I did not want to get involved in all that machinery, what I've done here works for me because there won't be multiple tabs when the option is on.

The result of this is every time you click an Alias in the main frame, you get a sub frame for the new connection. If this patch is accepted, or something like it, I would probably make some further suggestions to make the mainframe more useful, because having its main area always blank with everything in the sidebar is weak, but that change could come later.

I'm sure the maintainers here could probably achieve what I did more elegantly, so if they don't like what I've done, feel free to do it another way.

@gerdwagner
Copy link
Member

gerdwagner commented Dec 1, 2025

SessionFramePlugin.patch
Right now I'm not sure that system side tabbing will become common. That's why I'm not willing to accept your merge request. In such a situation I tend to suggest to place the functionality in a plugin which requires only few and non-invasive changes to SQuirreL's core. I tried to create a sketch of such a plugin an attached a patch of it.

On the patch:
The only changes to SQuirreL's core are calling the new plugin method IPluginManager.isDisplaySession() and moving a method out of TabWindowController to make it available to the plugin. The later is a refactoring only and comes without any functional change.

As a kind of disclaimer please note that my patch does not at all prove that it's feasible to put the functionality in a plugin. It is just a a starting point and I don't guarantee that it can lead to an implementation I will accept to merge.

Here's the patch:
SessionFramePlugin.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants