General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Add close all left or right tabs button to toolbar?
Posted by: yoshito
Date: December 17, 2018 07:38PM

I want the button to close all left or right tabs.
However, as far as I search, K-Meleon doesn't have such commandline.
Help mesad smiley

Options: ReplyQuote
Re: Add close all left or right tabs button to toolbar?
Posted by: siria
Date: December 18, 2018 12:16AM

Quote
yoshito
I want the button to close all left or right tabs.
However, as far as I search, K-Meleon doesn't have such commandline.
Help mesad smiley

Don't know how either, sorry. Perhaps anyone else?
Do you need this function very often?
And if you simply close each tab by a Middle-Click? That's what I'm doing all the time, and I find it quite fast. No prob.

I would try making a macro for "close all left or right", but the prob is, macrolanguage has no function to identify the FIRST tab. It only knows how many tabs are open. Occasionally we have already missed that function for a few other macros too.
If someone needs such a function really very, very much, the only lousy workaround I can think of at the moment is to open and keep a special dummy tab as the first one at the left side. As long as it remains open and in 1st position, this tab could serve as a marker for a new macro to "find" the first tab, by hopping from tab to tab and comparing the URL, and closing all tabs until they find this dummy tab and stop. Either going left or right.
But the catch is, you'd always have an annoying empty tab lying around. And in every new window it must be added again. The macro could open those tabs automatically, but tabs open at the right side, not the left. So it must be moved manually by the user.

Hmm, thinking about it, that dummy tab need not be completely useless and empty. It could be any local file, just marked for this new macro with a special hash tag in URL, like this:
file:///c:/......mylinks.html#macroTab1
But still tedious, users must make sure to keep this tab open and in 1st position at left. Probably not worth the hassle.

(Edit half a year later:
if anyone needs such an automatic "first" tab, that is possible now. It's a side-effect of my new macro "OnCloseLastTab" http://kmeleonbrowser.org/forum/read.php?9,149604 )



Edited 1 time(s). Last edit at 07/05/2019 11:59PM by siria.

Options: ReplyQuote
Re: Add close all left or right tabs button to toolbar?
Posted by: yoshito
Date: December 18, 2018 09:39PM

I see...
Due to ID_CLOSE_ALLOTHERTAB, I have thought it is possible.
I stand ID_CLOSE_ALLOTHERTABsmiling smiley

Options: ReplyQuote
Re: Add close all left or right tabs button to toolbar?
Posted by: JohnHell
Date: December 18, 2018 11:32PM

Quote
yoshito
I see...
Due to ID_CLOSE_ALLOTHERTAB, I have thought it is possible.
I stand ID_CLOSE_ALLOTHERTAB smiling smiley

The point is that you can, but you can't discriminate between left or right. If you just want a button, without care to close those at left, or right, except the current focus tab, yes, that command ID is for it, and a button could be appended to the toolbar, but, as said, it can't discriminate.

Options: ReplyQuote
Re: Add close all left or right tabs button to toolbar?
Posted by: adodupan
Date: December 19, 2018 10:56AM

You can register observer and receive these notifications:
kmeleon-createwindow
kmeleon-opentab
kmeleon-closetab
kmeleon-switchtab
So, you can write code to track when km open, switch or close a tab, then you can use this data for anything you want.
This would be a partial solution, because there is missing part or notification 'kmeleon-movetab'. This means, you will not be able to write code to tracking this part and if you start moving tabs around,
you will get a real mess.
roytam is still active here, you can ask him to add a part for missing notification, in the meantime, you can try this without missing part.

Regards

Options: ReplyQuote
Re: Add close all left or right tabs button to toolbar?
Posted by: siria
Date: July 15, 2019 11:57AM

Update 2019:
Use new macro "CloseLeftRightTabs" smiling smiley
http://kmeleonbrowser.org/forum/read.php?9,149634

Then right-click on the normal Close-Page button in the toolbar [x]
The macro has added new menu entries to "Close All Left/Right Tabs"

If someone needs the direct commands for keyboard shortcuts, use those:
macros(CloseLeftRightTabs_LEFT)
macros(CloseLeftRightTabs_RIGHT)

Or for extra buttons, manually defined in toolbars.cfg, the same but with right-click menu:
macros(CloseLeftRightTabs_LEFT)|CloseTab
macros(CloseLeftRightTabs_RIGHT)|CloseTab



Edited 2 time(s). Last edit at 07/15/2019 12:11PM by siria.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.