Change behavior when right click on notebook tabs

Hi all,
while working with Tryton the last days I noticed one missing feature I use very often in other apps:
If you open a lot of tabs you can get lost after a while.
As an example thunderbird has the option to close all other or current tab by right click on one tab:

What do you think about the same in Tryton?

A quick and dirty test is uploaded here:

1 Like

Why not but there are few things to take care:

  • It must raise the confirmation popup if a tab contains unsaved changes
  • It must still display the default navigation menu

Also we should implement the same feature in sao.

because all the checks are implemented in the Main class I triggered the click on the close buttons. This runs the checks but I don’t know if this is good style.

I did not find any app which shows all the open tabs on right click (firefox, thunderbird, meld)
but I think its easy to implement.

This should probably not a great design. It is probably better to call a method on Main. Maybe using a signal.

It is a default behavior of GTK. It is probably lost because you catch the button press event. Normally you should be able to extend the default popup menu and insert your actions.

I was searching a way to access methods defined in Main from notebook but did not find a quick solution. If community is interested in this patch the simplest way would be to move this methods from main to a custom notebook class since they are related to the notebook.

Didn’t find that accessible from pyGtk - and all apps I was reviewing implementing it by own methods. But Iterating the tabs and adding to menu is simple - so no problem …

no - its explicitly enabled with popup_enable() and I think is a convenience method if you don’t want to implement your own.

I moved the behavior to the tab itself, since the notebook context menu is a general menu and not related to the tabs. I also added a ‘Close tabs right’ because sometimes I open a lot of relates to check something and after this I want to return to my “default opened tabs” (I think it works more or less to illustrate the idea)

Right now it looks like this and works for the tab right clicked

I think you should create an feature request issue to track the development.

Maybe instead of adding the action on the popup menu of the notebook, it will be simpler to have application shortcuts like we already have “Next tab”, “Previous tab” etc. So you could add “Close other tabs” and “Close tabs to the right”. I think this will result in less custom code and a more practical usage as there will be shortcuts.

Personally I don’t have seen a lot of people using the Next/Previous-Tab-shortcuts. If they are going to switch the tabs the mouse follows the eyes searching the tab by reading the title. I think people expects (if expecting something like this in general) by right clicking on the tabs. But accelerators should be added for completeness.

Possibly nobody is missing this feature - I’m a tab hoarder and I need this from time to time in both firefox and thunderbird and would like to have it in tryton as well.