You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to move around (drag-drop) 4 tabs: Database-Browse-Edit Pragma-Execute SQL #1675
Just only out of sheer curiosity...
I am wondering why I can easily change each position of some tabs (e.g. SQL log, plot, schema) as opposed to the 4 the tabs related to: Database Structure, Browse Filter, Edit Pragmas, Execute SQL which are stuck on their fixed position. More precisely, I have tried to change their fixed order (not simply moving some tabs a bit...).
Is it done on purpose or is it simply a feature not implemented for the 4 aforementioned tabs?
I have tested this behaviour both on Linux (kde desktop) - Windows 10 with different QT and Db Browser versions.
Here is a screenshot on Windows 10 (latest beta build) where I drag and drop the Plot tab:
Pretty sure it's just a legacy thing, from the way the application was first created
Yep. It is my hunch too :-)
As regards the other tabs (plot, Sql log, sql schema) you can not only change their position, by dragging-dropping them, but also decide to temporarily remove them from the GUI (through the "Preference" option panel).
I am an old-fashioned guy and I pretty much only work with the Execute SQL tab.
Therefore, I was trying to move this tab in the first position to no avail :-)
I can confirm that it's for legacy reasons. In version 2.0 there were only three tabs (DB Structure, Browse Data, Execute SQL) and none of the movable docks. When new features were added, most of the time they were put into separate movable docks.
However, that doesn't mean it's super easy to change the current approach. That's because much of the code depends on the four main tabs to be there all the time, i.e. especially making them closable would mean a good amount of work. On the other hand, this would probably improve the overall code quality because it separates the different bits in a stricter way than now. So we might actually want to do that 😄
The main thing I'm worrying about is beginner users who might accidentally close or hide one of the more important tabs then and don't know what option to look for to show it again. Any ideas here?
The main thing I'm worrying about is beginner users who might accidentally close or hide one of the
more important tabs then and don't know what option to look for to show it again. Any ideas here?
Yep. You have a point here. However, we should first agree about what it is "important" as a tab.
For instance, I only work with the Execute SQL and I deem it the only "useful" panel :-)
Joking aside, IMHO, the only minor problem right now is the lack of consistency. In essence, not being able to simply change the position of the 4 uppermost tabs is not consistent with the rest of the GUIs. It is odd having the option to easily change the position, for instance of the Plot tab, while having instead the Execute SQL stuck in its 4° position.
We could convert all the tabs to Dock Widgets but disable the Closable feature. With that I think we avoid problems with both users and with our own logic. Users could then move docks, make them floatable.
Is it a forced close though? I know nothing about Qt - my background is VB. When you close a form in VB, the form has a 'hey, I'm closing!' event, which you can add code too, including a cancel, which cancels the close event. So, for Qt, maybe it has support for cancelling the close event?
Yes, it can also be ignored in Qt. So we could theoretically implement the floatable dock feature also in MacOS by ignoring the close event when user presses the close button.
I've seen it's relatively easy to allow the user to move the tabs. It only requires an attribute in the tabbed widget and prepare the code for referencing the tab widgets and not their indexes. But saving the order is not automatic like the docks, but I guess won't require much more work. So I think we can go through this path, at least on the short term.
They could be made closable if we also like it. Then they could be reactivated through the View menu.
@SilvioGrosso The next nightly build will allow you to move the tabs around, but not to save their positions for the next session. I'll take a look to that later.
@SilvioGrosso You can now close tabs and save the order/open tabs automaticcally.
The main thing I'm worrying about is beginner users who might accidentally close or hide one of the more important tabs then and don't know what option to look for to show it again. Any ideas here?
They can be restored through the View menu. I hope users will find the way, because I find this is very convenient for advanced users. Do you guys find that in this way users could be lost?
There are still two possible improvements:
Saving the open tabs / order in the project files (they currently save the current tab and that might now interfere with the new setting). I think if we save both, then it will make sense again (except for old project files, if user has previously changed the tabs too, unless we restore the default layout for old files - those lacking the new setting).
Deciding about the Alt+[1-4]. See discussion started in 73f7cc8
They can be restored through the View menu. I hope users will find the way, because I find this is very convenient for advanced users. Do you guys find that in this way users could be lost?
If I can crack a joke, no matter what you do, there will always be someone "who shoot himself in the foot", as the saying goes :-)
Usually, to avoid this problem, you need to write everything down in the documentation (wiki etc) but, again, it is a well proven fact that most casual users don't read the documentation either: they consider it "boring" :-)
Just a hint: maybe it is worthwhile adding some "Restore default" setting, somewhere (Preferencese?) to visualize all closed tabs again.
It's in the bottom left corner of the Preferences dialog
Yep. I know :-)
But currently, whenever you press this button it doesn't restore the tabs in the GUIs (e.g. their "natural" fiexed order for the 4 uppermost tabs).
In essence, If I drag the "Execute SQL" tab in the first position and then I press the button "Restore defaults", this tab (Execute) is not moved to its fourth old position (which is its "classical" position).
I've implemented the saving of tabs layout in project files, the Reset Window Layout action (bound to Alt+0) and now the shortcuts for tabs (Alt+[1-4]) always select tabs by position.
I've noticed an issue in the Reset Window Layout action: the first time it is invoked does not restore the original tab order. I think is some weirdness in Qt. It could be worked around by calling two times to restore the original tab order, but didn't want to commited until knowing if this is something happening with other Qt versions (mine is 5.9.5).
I'll close this, as the main issue has now been resolved. The 'side issues' and improvements can be worked on when the issues count have dropped down to single figures... ;)
Thanks for implementing this @mgrojo 💓
Activity
justinclift commentedon Dec 20, 2018
Pretty sure it's just a legacy thing, from the way the application was first created. No idea personally how hard or easy it would be to change. 😄
SilvioGrosso commentedon Dec 20, 2018
MKleusberg commentedon Dec 20, 2018
I can confirm that it's for legacy reasons. In version 2.0 there were only three tabs (DB Structure, Browse Data, Execute SQL) and none of the movable docks. When new features were added, most of the time they were put into separate movable docks.
However, that doesn't mean it's super easy to change the current approach. That's because much of the code depends on the four main tabs to be there all the time, i.e. especially making them closable would mean a good amount of work. On the other hand, this would probably improve the overall code quality because it separates the different bits in a stricter way than now. So we might actually want to do that 😄
The main thing I'm worrying about is beginner users who might accidentally close or hide one of the more important tabs then and don't know what option to look for to show it again. Any ideas here?
SilvioGrosso commentedon Dec 20, 2018
mgrojo commentedon Dec 20, 2018
We could convert all the tabs to Dock Widgets but disable the Closable feature. With that I think we avoid problems with both users and with our own logic. Users could then move docks, make them floatable.
There's a problem, reading the documentation:
We'd have to disable the floatable feature too, at least in MacOS.
chrisjlocke commentedon Dec 21, 2018
Is it a forced close though? I know nothing about Qt - my background is VB. When you close a form in VB, the form has a 'hey, I'm closing!' event, which you can add code too, including a cancel, which cancels the close event. So, for Qt, maybe it has support for cancelling the close event?
mgrojo commentedon Dec 21, 2018
Yes, it can also be ignored in Qt. So we could theoretically implement the floatable dock feature also in MacOS by ignoring the close event when user presses the close button.
Enable the movable attribute for main tabs
mgrojo commentedon Dec 24, 2018
I've seen it's relatively easy to allow the user to move the tabs. It only requires an attribute in the tabbed widget and prepare the code for referencing the tab widgets and not their indexes. But saving the order is not automatic like the docks, but I guess won't require much more work. So I think we can go through this path, at least on the short term.
They could be made closable if we also like it. Then they could be reactivated through the View menu.
@SilvioGrosso The next nightly build will allow you to move the tabs around, but not to save their positions for the next session. I'll take a look to that later.
SilvioGrosso commentedon Dec 24, 2018
Hello @mgrojo
Just tested this new option on Windows 10 (64 bit), with the nightly build (DB.Browser.for.SQLite-win64)
I can now drag-around any of the 4 uppermost tabs at will. Thanks a a lot!
BTW, I also confirm the crashes for the Plot tool (issue 1679) with today's build.
Here is a screenshot:
Closable main tabs and saving automatically open tabs and order
mgrojo commentedon Dec 25, 2018
@SilvioGrosso You can now close tabs and save the order/open tabs automaticcally.
They can be restored through the View menu. I hope users will find the way, because I find this is very convenient for advanced users. Do you guys find that in this way users could be lost?
There are still two possible improvements:
SilvioGrosso commentedon Dec 25, 2018
Hello @mgrojo
If I can crack a joke, no matter what you do, there will always be someone "who shoot himself in the foot", as the saying goes :-)
Usually, to avoid this problem, you need to write everything down in the documentation (wiki etc) but, again, it is a well proven fact that most casual users don't read the documentation either: they consider it "boring" :-)
Just a hint: maybe it is worthwhile adding some "Restore default" setting, somewhere (Preferencese?) to visualize all closed tabs again.
justinclift commentedon Dec 25, 2018
It's in the bottom left corner of the Preferences dialog:
SilvioGrosso commentedon Dec 25, 2018
Hello @justinclift,
Yep. I know :-)
But currently, whenever you press this button it doesn't restore the tabs in the GUIs (e.g. their "natural" fiexed order for the 4 uppermost tabs).
In essence, If I drag the "Execute SQL" tab in the first position and then I press the button "Restore defaults", this tab (Execute) is not moved to its fourth old position (which is its "classical" position).
justinclift commentedon Dec 25, 2018
Ahhh. Understood. 😄
Save open tabs state in project files
Reset Window Layout, positional shortcuts for tabs and avoid statusTip
mgrojo commentedon Dec 26, 2018
I've implemented the saving of tabs layout in project files, the Reset Window Layout action (bound to Alt+0) and now the shortcuts for tabs (Alt+[1-4]) always select tabs by position.
I've noticed an issue in the Reset Window Layout action: the first time it is invoked does not restore the original tab order. I think is some weirdness in Qt. It could be worked around by calling two times to restore the original tab order, but didn't want to commited until knowing if this is something happening with other Qt versions (mine is 5.9.5).
Fix tabs not showing in a clean installation
chrisjlocke commentedon Jan 14, 2019
I'll close this, as the main issue has now been resolved. The 'side issues' and improvements can be worked on when the issues count have dropped down to single figures... ;)
Thanks for implementing this @mgrojo 💓