help adding/editing toolbars for extensions
Posted by: sickley
Date: January 16, 2010 12:37AM

Hey guys, just wondering if anyone would be willing to half walk me through the process of consolidating toolbars. i was looking specifically to take adblock plus and noscript and putting them in the privacy bar rather than having their own toolbars, maybe do some other things once i get the hang of it.
i did indeed look at the .cfg files page on the wiki, i just feel like im missing step 2 between step 1 and step 3.

thanks!



Edited 1 time(s). Last edit at 01/16/2010 12:38AM by sickley.

Re: help adding/editing toolbars for extensions
Posted by: jsnj
Date: January 16, 2010 01:39AM

For Adblock Plus:

Find or create the bmp you want to use for adblock plus if you haven't already.
Use the size 16,16 or 24,24 for most large skins. Name it adblockplus.bmp. Place or save it into the default subfolder of skins(create the folder if necessary). Add the following within the toolbar of you choice:
	Adblock Plus{
	adblockplus(Preferences)
	Adblock Plus
	adblockplus.bmp	
	adblockplus.bmp	
	adblockplus.bmp	
	}

Be sure to mirror the number of button/image states already present in the buttons within the particular toolbar. For example, the buttons in the Main Bar each have 3 button/image states. So the above would work in the Main Bar, but the other toolbars within toolbars.cfg only have 2 button/image states. So you'd have to delete one of the adblockplus.bmp lines above.

Re: help adding/editing toolbars for extensions
Posted by: sickley
Date: January 16, 2010 01:56AM

everythings cool so far, is there a way to keep the right click menu? that way i can bring up blockable list items and such

Re: help adding/editing toolbars for extensions
Posted by: jsnj
Date: January 16, 2010 02:38AM

Quote
sickley
everythings cool so far, is there a way to keep the right click menu? that way i can bring up blockable list items and such

Not that I know of.

Re: help adding/editing toolbars for extensions
Posted by: sickley
Date: January 16, 2010 02:43AM

hmmm who knows, if there is its probably very involved haha

Re: help adding/editing toolbars for extensions
Posted by: SoerenB
Date: January 16, 2010 11:24AM

Hi,

I'd be interested in this one, too - but only if there is an answer to the
Quote

is there a way to keep the right click menu?
question which I can handle. Can't that be done by editing some BuildMenu lines in a *.kmm? But which one, and how?

Cheers
SoerenB

Re: help adding/editing toolbars for extensions
Posted by: desga2
Date: January 16, 2010 12:25PM

If I understand good, in this thread you like add NoScript and AdBlockPlus toolbars buttons to the Privacy Bar toolbar. Is this correct?

Privacy bar is in menu: View -> Toolbars -> Privacy Bar

By default this extension created a toolbar button size 16x16 or 24x24.
Privacy Bar (by default) is a diferent size toolbar button (64x13) and almost this include text in buttons. But you can mixed buttons of diferent size in a toolbar if you set the size in button definition.

Here you can found the documentation about next code.

For example to NoScript:

Open noscript.kmm file in an text editor, and search this code at the end of file:
_NoScript_BuildToolbar{
# Toolbars
$Large=(index(readfile(getfolder("SkinFolder")."\\..\\skins.ini"),getpref(STRING,"kmeleon.general.skinsCurrent")."=1")>-1);
$Large ? pluginmsg(toolbars,"AddToolbar","NoScript,24,24",""):pluginmsg(toolbars,"AddToolbar","NoScript,16,16","");
$Large ? pluginmsg(toolbars,"AddButton","NoScript,NoScript,macros(NoScript_Toggle),&NoScript,".$_NoScript_Tooltip.",24,24,"."noscript_large.bmp[0],"."noscript_large.bmp[1]"."noscript_large.bmp[2]",""):0;
$Large ? 0:pluginmsg(toolbars,"AddButton","NoScript,NoScript,macros(NoScript_Toggle),&NoScript,".$_NoScript_Tooltip.",16,16,"."noscript.bmp[0],"."noscript.bmp[1]"."noscript.bmp[2]","");
}

For privacy bar is better the little button 16x16, change this code to add the button to Privacy bar instead his own toolbar:
_NoScript_BuildToolbar{
# Button in Privacy Bar
pluginmsg(toolbars,"AddButton","&Privacy Bar,NoScript,macros(NoScript_Toggle),&NoScript,".$_NoScript_Tooltip.",16,16,"."noscript.bmp[0],"."noscript.bmp[1]"."noscript.bmp[2]","");
}

But in KM 1.5.3 exist the bug # 1130 "pluginmsg AddButton broken" fixed for the next 1.5.4 version.

For AdBLockPlus by default any toolbar button is defined but you can add it to his macro file adblockplus.kmm.
_AdBlockPlus_BuildToolbar{
# Button in Privacy Bar
pluginmsg(toolbars,"AddButton","&Privacy Bar,AdBlockPlus,adblockplus(Preferences),,"."AdBlockPlus".",16,16,"."adblockplus.bmp[0],"."adblockplus.bmp[1]"."adblockplus.bmp[2]","");
}

$OnSetup=$OnSetup."_AdBlockPlus_BuildToolbar;";

Remember you must create an adblockplus.bmp file with ABP icons and place it in "\K-Meleon\skins\default" folder.

Note: adblockplus(Preferences),[Here you can put a menu name for rightclick contextmenu for the button],

K-Meleon in Spanish

Re: help adding/editing toolbars for extensions
Posted by: siria
Date: January 16, 2010 01:12PM

Quote
desga2
But you can mixed buttons of diferent size in a toolbar if you set the size in button definition.
I know it's written so in every toolbars.cfg, but does that really work for you??
Just asking because I'd really, really like this option, but when I tried some weeks and months ago, and tried real hard and repeatedly, but never managed to get it working :-( Never know in such cases if it's perhaps a win98-thing or if I'm somehow missing something or it really may not work. But with this option here there's not that much that can be done wrong, and actually the individual width has an influence for the width of the icon, but alas not for the width of the whole button.

Re: help adding/editing toolbars for extensions
Posted by: jsnj
Date: January 16, 2010 07:03PM

Quote
desga2
Note: adblockplus(Preferences),[Here you can put a menu name for rightclick contextmenu for the button],

The right-click menu name of the adblock plus plugin button isn't referenced anywhere though. And it's a right-click menu within a plugin. So I don't know if it's possible to attach that to a KM button in toolbars.cfg. I've never seen it done before.

Re: help adding/editing toolbars for extensions
Posted by: sickley
Date: January 16, 2010 09:09PM

Quote
jsnj
The right-click menu name of the adblock plus plugin button isn't referenced anywhere though. And it's a right-click menu within a plugin. So I don't know if it's possible to attach that to a KM button in toolbars.cfg. I've never seen it done before.

exactly, i was looking everywhere for it but its obviously not in the kmm file. possibly elsewhere like the dll?
for noscript you can see he actually puts it all in the kmm

Re: help adding/editing toolbars for extensions
Posted by: disrupted
Date: January 16, 2010 10:55PM

you should not be using noscript, at least not with policy manager
they conflict and noscript overrides some policymanager settings.. policy manager will not be able to function properly with noscript. you have to choose just one of them and noscript isn't the recommended one

instructions for removing noscript properly:
http://kmeleonbrowser.org/forum/read.php?9,100161

Re: help adding/editing toolbars for extensions
Posted by: sickley
Date: January 17, 2010 02:33AM

thanks for the heads up. i was going to ditch it anyway since it didn't to be working properly

K-Meleon forum is powered by Phorum.