General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
[1.1a] Custom menu feature
Posted by: ra
Date: December 27, 2006 08:30PM

[Splitting from the main 1.1a thread and the bug discussion in the Wiki.]

K-M 1.1 will allow default menus with custom changes in cfg files in the profile (upgradeability). Now, I reported three things that don't seem to be possible after I had looked into kko's FAQ.

I can accomplish what I wish to do for sub-menus, but not for main menu entries like in my examples, yet kko says it works for him. So, now, how?

Quote

* Re-/Moving menu items with menus.cfg from profile (i.e. removal of the main menu entry for "Groups" and/or moving this menu entry into the "Tools" menu as submenu).
WFM - RTFM or ask (kko).

* Renaming menu items with menus.cfg from profiles (i.e. "H" instead of "Hotlist").
WFM - RTFM or ask (kko).

* Reordering the menu (i.e. "Bookmarks Hotlist Favorites" instead of Bookmarks Favorites Hotlist") with menus.cfg from profiles.
WFM - RTFM or ask (kko).

Please use the examples. smiling smiley

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: kko
Date: January 08, 2007 06:37PM

Re-/Moving menu items with menus.cfg from profile (i.e. removal of the main menu entry for "Groups" and/or moving this menu entry into the "Tools" menu as submenu).

Remove Groups from the main menu:

!Main{
-&Groups
}

Add Groups to the Tools menu (simplest):

!&Tools{
:&Groups
}

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: kko
Date: January 08, 2007 06:38PM

Renaming menu items with menus.cfg from profiles (i.e. "H" instead of "Hotlist").

Normally, you'd do it like this:

%ifplugin hotlist
H{
!H&otlist
}
%endif

!Main{
%ifplugin hotlist
:H|H&otlist
-H&otlist
%endif
}

But, in this particular case, it may be a bit more complicated. The bookmarks, favorites and hotlist plugins are building their menus in a very aggressive way. This may require a workaround:

%ifplugin hotlist
H&otlist{
}
H{
# This is the original contents of H&otlist
&Add Page=hotlist(Add)
&Edit...=hotlist(Edit)
Se&ttings...=hotlist(Config)
-
hotlist()
}
%endif

!Main{
%ifplugin hotlist
:H|H&otlist
-H&otlist
%endif
}

If the first method isn't working, the second should do.

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: kko
Date: January 08, 2007 06:38PM

Reordering the menu (i.e. "Bookmarks Hotlist Favorites" instead of Bookmarks Favorites Hotlist") with menus.cfg from profiles.

Remove the entry and reinsert it at the desired position:

!Main{
%ifplugin hotlist
-H&otlist
:H&otlist|F&avorites
%endif
}

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: ra
Date: January 08, 2007 11:12PM

Thanks a lot kko! After some tweaking it works great (first method's enough)!

It was probably too obvious, but I didn't succeed when I tried it back then because I didn't know how to call the root of the menus. At some page of your site you're mentioning just an empty string with a ! in front and that didn't work. Now, that I know it, it was just the simple word "Main" that I missed (related to the toolbars, isn't it?) in the tutorial.

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: kko
Date: January 11, 2007 01:17PM

You're mixing up menus and macros here! (Perhaps read the tutorial again.)

In menus.cfg all menus are defined in the menu root (you cannot define a menu inside an other menu). That is different when you're using the setmenu() macro method!

When you want to modify a menu using menus.cfg, you only have to know that menus name. The main menu's name is "Main". That's all.

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: ra
Date: January 11, 2007 09:45PM

You're mixing up menus and macros here! (Perhaps read the tutorial again.)

No, I'm not. I knew it was about s.th. else (macros in this case), but I tried it never the less, because I didn't know how to call the menu's root, because

When you want to modify a menu using menus.cfg, you only have to know that menus name. The main menu's name is "Main". That's all.

this important part isn't worded that clearly / at all in the tutorial.

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: kko
Date: January 11, 2007 11:13PM

The term 'menu root' does not appear anywhere in the menus.cfg tutorial (but in the macros reference). That's why I don't understand why you wanted to 'call' (?) it.

Quote from the menus.cfg tutorial:

Since version 1.1, K-Meleon can have two menu configuration files (both named menus.cfg). The first one is located in the Default Settings Directory, the second one can be created in the User Settings Directory and is dedicated to customize the default menus.

I thought, it would be normal to take a closer look at the thing that one wants to customize, before one trys to customize it. smiling smiley

In other words, examine the default menus.cfg (that's were the main menu is defined).

Options: ReplyQuote
Re: [1.1a] Custom menu feature
Posted by: ra
Date: January 13, 2007 01:00AM

Quote
kko
The term 'menu root' does not appear anywhere in the menus.cfg tutorial (but in the macros reference). That's why I don't understand why you wanted to 'call' (?) it.

I wanted to remove a main entry from the menu. The tutorial says
Quote

To add or to remove a menu item, you have to add an exclamation mark (!) in front of the parent menu's name
So the parent of the entry is the root I thought. And the root is the name of the menu itself as I know now. Please update the tutorial to make that clearer.

Quote

I thought, it would be normal to take a closer look at the thing that one wants to customize, before one trys to customize it. smiling smiley

Sure. But the menus file looks much like the old one, no removed or renamed menus or stuff like that. Therefore one has to stick to the tutorial or the short documentation that Dorian posted.

Quote

In other words, examine the default menus.cfg (that's were the main menu is defined).

Yeah, line 328 is what I missed. %)

Options: ReplyQuote


K-Meleon forum is powered by Phorum.