Main Menu Button Order

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Online
Team-Kodi Member
Posts: 13,147
Joined: Jan 2009
Reputation: 390
Post: #16
(2012-12-08 21:22)phil65 Wrote:  if you want to get nice code for exchanging main menu items just ask.

thanx!
not saying i will add it to T!
but i'm sure interested in seeing how it can be done :-)

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,686
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #17
First of all you need a container somewhere in settings area (here with id 9000).
for <content> you then create some inludes containing the main menu items.
Code:
<include name="MoviesMainMenu">
<item id="10">
<label fallback="31502">$INFO[Skin.String(MovieHomeItem.Label)]</label>
<onclick>SetProperty($INFO[Window(home).Property(MenuName)],MovieHomeItem,home)</onclick>
<onclick>SetFocus(9006)</onclick>
<icon fallback="special://skin/backgrounds/movies/">$INFO[Skin.String(MovieHomeItem.MultiFanart)]</icon>
<property name="Widget">$INFO[Skin.String(MovieHomeItem.Widget)]</property>
<property name="Widget2">$INFO[Skin.String(MovieHomeItem.Widget2)]</property>
<property name="DisableIcon">$INFO[Skin.String(MovieHomeItem.Disable)]</property>
<property name="BigIcon" fallback="special://skin/extras/BigIcons/Film.png">$INFO[Skin.String(MovieHomeItem.Icon)]</property>
<property name="InfoLine">$INFO[Skin.String(MovieHomeItem.InfoLine)]</property>
<property name="SubMenu">$INFO[Skin.String(MovieHomeItem.SubMenu)]</property>
<property name="Type" fallback="custom">$INFO[Skin.String(MovieHomeItem.Type)]</property>
<property name="Path" fallback="ActivateWindow(Videos,MovieTitles,return)">$INFO[Skin.String(MovieHomeItem.Path)]</property>
</item>
</include>
<include name="MusicMainMenu">
<item id="3">
<label fallback="31501">$INFO[Skin.String(MusicHomeItem.Label)]</label>
<onclick>SetProperty($INFO[Window(home).Property(MenuName)],MusicHomeItem,home)</onclick>
<onclick>SetFocus(9006)</onclick>
<icon fallback="special://skin/backgrounds/music/">$INFO[Skin.String(MusicHomeItem.MultiFanart)]</icon>
<property name="Widget">$INFO[Skin.String(MusicHomeItem.Widget)]</property>
<property name="Widget2">$INFO[Skin.String(MusicHomeItem.Widget2)]</property>
<property name="DisableIcon">$INFO[Skin.String(MusicHomeItem.Disable)]</property>
<property name="BigIcon" fallback="special://skin/extras/BigIcons/Headphone.png">$INFO[Skin.String(MusicHomeItem.Icon)]</property>
<property name="InfoLine">$INFO[Skin.String(MusicHomeItem.InfoLine)]</property>
<property name="SubMenu">$INFO[Skin.String(MusicHomeItem.SubMenu)]</property>
<property name="Type" fallback="custom">$INFO[Skin.String(MusicHomeItem.Type)]</property>
<property name="Path" fallback="ActivateWindow(music)">$INFO[Skin.String(MusicHomeItem.Path)]</property>
</item>
</include>

In the same window you have to set a property in <onload>:

Code:
<onload>SetProperty(MenuName,MenuItem,home)</onload>

the button which gets focused looks like this:

Code:
<control type="button" id="9006">
<include>HiddenObject</include>
<onfocus>Skin.Setstring(ItemToEdit.Label,$INFO[Container(9000).ListItem.Label])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.MultiFanart,$INFO[Container(9000).ListItem.Icon])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Icon,$INFO[Container(9000).ListItem.Property(BigIcon)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Widget,$INFO[Container(9000).ListItem.Property(Widget)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Widget2,$INFO[Container(9000).ListItem.Property(Widget2)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.InfoLine,$INFO[Container(9000).ListItem.Property(InfoLine)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.SubMenu,$INFO[Container(9000).ListItem.Property(SubMenu)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Disable,$INFO[Container(9000).ListItem.Property(DisableIcon)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Type,$INFO[Container(9000).ListItem.Property(Type)])</onfocus>
<onfocus>Skin.Setstring(ItemToEdit.Path,$INFO[Container(9000).ListItem.Property(Path)])</onfocus>
<onfocus>ActivateWindow(1122)</onfocus>
<onfocus>SetFocus(9000)</onfocus>
</control>

This Opens a dialog.
Put this into the header:

<onload>ClearProperty(Exchange,home)</onload>
<onload>SetProperty(MenuName,Exchange,home)</onload>

You also put a list inside this dialog with exactly the same <content> as the list before.
only thing which differs in this dialog is the button 9006 which you again put next to the list:

Code:
<control type="button" id="9006">
<include>HiddenObject</include>
<onfocus>SetProperty(TempItemToEdit.Label,$INFO[Container(4).ListItem.Label],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.MultiFanart,$INFO[Container(4).ListItem.Icon],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.Icon,$INFO[Container(4).ListItem.Property(BigIcon)],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.Widget,$INFO[Container(4).ListItem.Property(Widget)],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.Widget2,$INFO[Container(4).ListItem.Property(Widget2)],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.InfoLine,$INFO[Container(4).ListItem.Property(InfoLine)],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.SubMenu,$INFO[Container(4).ListItem.Property(SubMenu)],home)</onfocus>
<onfocus>SetProperty(TempItemToEdit.Disable,$INFO[Container(4).ListItem.Property(DisableIcon)],home)</onfocus>
<onfocus>Dialog.Close(1122)</onfocus>
</control>

this triggers the onunloads:

Code:
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Type,$INFO[Skin.String(ItemToEdit.Type)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].MultiFanart,$INFO[Skin.String(ItemToEdit.MultiFanart)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Label,$INFO[Skin.String(ItemToEdit.Label)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Path,$INFO[Skin.String(ItemToEdit.Path)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Widget,$INFO[Skin.String(ItemToEdit.Widget)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Widget2,$INFO[Skin.String(ItemToEdit.Widget2)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Disable,$INFO[Skin.String(ItemToEdit.Disable)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].Icon,$INFO[Skin.String(ItemToEdit.Icon)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].InfoLine,$INFO[Skin.String(ItemToEdit.InfoLine)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString($INFO[Window(home).Property(Exchange)].SubMenu,$INFO[Skin.String(ItemToEdit.SubMenu)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Type,$INFO[Window(home).Property(TempItemToEdit.Type)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.MultiFanart,$INFO[Window(home).Property(TempItemToEdit.MultiFanart)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Label,$INFO[Window(home).Property(TempItemToEdit.Label)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Path,$INFO[Window(home).Property(TempItemToEdit.Path)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Widget,$INFO[Window(home).Property(TempItemToEdit.Widget)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Widget2,$INFO[Window(home).Property(TempItemToEdit.Widget2)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Disable,$INFO[Window(home).Property(TempItemToEdit.Disable)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.Icon,$INFO[Window(home).Property(TempItemToEdit.Icon)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.InfoLine,$INFO[Window(home).Property(TempItemToEdit.InfoLine)])</onunload>
<onunload condition="!IsEmpty(Window(home).Property(Exchange))">Skin.SetString(ItemToEdit.SubMenu,$INFO[Window(home).Property(TempItemToEdit.SubMenu)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Type,$INFO[Skin.String(ItemToEdit.Type)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].MultiFanart,$INFO[Skin.String(ItemToEdit.MultiFanart)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Label,$INFO[Skin.String(ItemToEdit.Label)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Path,$INFO[Skin.String(ItemToEdit.Path)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Widget,$INFO[Skin.String(ItemToEdit.Widget)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Widget2,$INFO[Skin.String(ItemToEdit.Widget2)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Disable,$INFO[Skin.String(ItemToEdit.Disable)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].Icon,$INFO[Skin.String(ItemToEdit.Icon)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].InfoLine,$INFO[Skin.String(ItemToEdit.InfoLine)])</onunload>
<onunload>Skin.SetString($INFO[Window(home).Property(MenuItem)].SubMenu,$INFO[Skin.String(ItemToEdit.SubMenu)])</onunload>
<onunload>Skin.Reset(ItemToEdit.Label)</onunload>
<onunload>Skin.Reset(ItemToEdit.MultiFanart)</onunload>
<onunload>Skin.Reset(ItemToEdit.Path)</onunload>
<onunload>Skin.Reset(ItemToEdit.Type)</onunload>
<onunload>Skin.Reset(ItemToEdit.Widget)</onunload>
<onunload>Skin.Reset(ItemToEdit.Widget2)</onunload>
<onunload>Skin.Reset(ItemToEdit.Disable)</onunload>
<onunload>Skin.Reset(ItemToEdit.Icon)</onunload>
<onunload>Skin.Reset(ItemToEdit.InfoLine)</onunload>
<onunload>Skin.Reset(ItemToEdit.SubMenu)</onunload>
<onunload>ClearProperty(MenuItem,home)</onunload>

that´s it. nice thing is that you can use that include for home, too then, with the following button 9006:
Code:
<control type="button" id="9006">
<include>HiddenObject</include>
<onfocus condition="stringcompare(Container(9000).ListItem.Property(Type),0) | stringcompare(Container(9000).ListItem.Property(Type),1) | stringcompare(Container(9000).ListItem.Property(Type),2) | stringcompare(Container(9000).ListItem.Property(Type),3)">RunAddon($INFO[Container(9000).ListItem.Property(Path)])</onfocus>
<onfocus condition="stringcompare(Container(9000).ListItem.Property(Type),4)">ActivateWindow(Videos,$INFO[Container(9000).ListItem.Property(Path)],return)</onfocus>
<onfocus condition="stringcompare(Container(9000).ListItem.Property(Type),5)">ActivateWindow(MusicLibrary,$INFO[Container(9000).ListItem.Property(Path)],return)</onfocus>
<onfocus condition="Stringcompare(Container(9000).ListItem.Property(Type),custom)">$INFO[Container(9000).ListItem.Property(Path)]</onfocus>
</control>

what you have to take into account is that you have to use Stringcompare(Container(9000).ListItem.Property(xxx),xxx) for widgets, submenus etc. instead of Container(9000).HasFocus(xx)
i hope i got everything right.

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
(This post was last modified: 2012-12-09 20:33 by phil65.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,147
Joined: Jan 2009
Reputation: 390
Post: #18
thanx for taking the time to explain all that stuff phil65, much appreciated.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
steve1977 Offline
Posting Freak
Posts: 2,592
Joined: Dec 2006
Reputation: 0
Post: #19
Triggers you changing your mind? ;-)

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
find quote
denywinarto Offline
Fan
Posts: 429
Joined: Jun 2012
Reputation: 3
Post: #20
+1 For this Smile

Please implement it Ronie
Newer skins already implement it i think,
it'd be awesome if Transparency has this feature
find quote
ronie Online
Team-Kodi Member
Posts: 13,147
Joined: Jan 2009
Reputation: 390
Post: #21
not likely. sorry.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Triptychwolfe Offline
Junior Member
Posts: 1
Joined: Mar 2017
Reputation: 0
Post: #22
I spotted this thread, and noting it is from some 4+ years back, am hoping against hope that things might be a bit different now. I can't speak to voyagerxp's reasons for that original request, but the way I find myself most using KODI, I would find it immensely useful if I could have the "VIDEOS" menu item at the top of the main menu. (Particularly because I'm parceling movies for consumption by myself from those for my better half...and particularly those for my rather particular and easily perturbed 95 year-old father-in-law (long story).

Can you help me? Is there a way now to modify the menu order? ...or perhaps some other way to put front and center the different folders of films I've placed on my home server for these disparate (and somewhat picky) souls?

Thanks in advance for taking time to tend to my query.
(This post was last modified: 2017-03-06 07:09 by Triptychwolfe.)
find quote
Post Reply