Announcements
: K-Meleon Web Browser Forum
K-meleon announcements.
Go to:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
[Please, enable JavaScript to see the code]
Enter code:
[quote=JamesD] I am having a problem with the menugrayed statement in a macro which I am trying to write. I am using KM 75.1 RC u1 for testing. I think that I have the format correct, but it has been a long time since I have used this statement. In the buildmenu macro I have this statement. [code] setpref(BOOL, "kmeleon.plugins.adblock.log.cleared", false); [/code] The menu is built in three sections and this section is called by the first. [code] _Adblockplugin_BuildMenu_3 { menugrayed = getpref(BOOL, "kmeleon.plugins.adblock.log.cleared"); setmenu($_adA, macro, "View the log", "_Adblockplugin_logs(adblock)", 3); setmenu($_adA, macro, "Clear the log", "_Adblockplugin_clear_log", 4); } [/code] If 'Clear the log' is used then the two menu items about the log should be grayed out or inactive. These statements are at the end of the "_Adblockplugin_clear_log" macro. [code] setpref(BOOL, "kmeleon.plugins.adblock.log.cleared", true); #rebuildmenu($_adA); macros("_Adblockplugin_BuildMenu_3"); [/code] I have tried both rebuildmenu, calling the macro, and both together. I never get the menu items grayed out. I do not wish to say that this is a bug, unless I am sure that I am doing the code correctly. Does it matter that the setmenu statements for log are not all of the statements in $_adA ? [code] setpref(BOOL, "kmeleon.plugins.adblock.rules.cleared", false); setpref(BOOL, "kmeleon.plugins.adblock.log.cleared", false); $_adp= "Adblock Plugin"; setmenu("PrivacySecurity", popup, $_adp, -1); setmenu($_adp, macro, "Disable", "_Adblockplugin_disable", 0); setmenu($_adp, macro, "Logging", "_Adblockplugin_logging", 1); $_adA= "Actions"; $_adAm= "Automatics"; setmenu($_adp, popup, $_adA, 3); setmenu($_adp, popup, $_adAm, 4); setmenu($_adp, separator, $_adA); setmenu($_adA, macro, "Subscriptions' List", "_Adblockplugin_subscriptions", 0); macros("_Adblockplugin_BuildMenu_2"); ## rules items macros("_Adblockplugin_BuildMenu_3"); ## log items setmenu($_adAm, macro, "Auto delete the rules", "_Adblockplugin_Aclear_rules", 0); setmenu($_adAm, macro, "Set interval for rules", "_Adblockplugin_Aclear_rules_I", 1); setmenu($_adAm, separator, 2); setmenu($_adAm, macro, "Auto delete the log", "_Adblockplugin_Aclear_log", 3); setmenu($_adAm, macro, "Set interval for log", "_Adblockplugin_Aclear_log_I", 4); ## create toolbar and set button addtoolbar("Adblock_plugin") ; addbutton("Adblock_plugin", "macros(_Adblockplugin_toggle)", "Adblock Plugin", "Adblock plugin ON/OFF"); macros("_Adblockplugin_toolbar_set"); } } _Adblockplugin_BuildMenu_2 { menugrayed = getpref(BOOL, "kmeleon.plugins.adblock.rules.cleared"); setmenu($_adA, macro, "View the rules", "_Adblockplugin_rules(adblock)", 1); setmenu($_adA, macro, "Clear the rules", "_Adblockplugin_clear_rules", 2); } _Adblockplugin_BuildMenu_3 { menugrayed = getpref(BOOL, "kmeleon.plugins.adblock.log.cleared"); setmenu($_adA, macro, "View the log", "_Adblockplugin_logs(adblock)", 3); setmenu($_adA, macro, "Clear the log", "_Adblockplugin_clear_log", 4); } [/code][/quote]
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
FAQ
English