Sign up here and you can log into the forum!

Rearranging Top.Menu items

General WDTVExt forum

Rearranging Top.Menu items   

Postby tkorth » Sun Jun 27, 2010 6:25 pm

Hi guys,

I'm trying to remake my top level menu to only have three items showing: Movies, Youtube, Pandora.

I've got the movies working with the folowing code (based on MediaFolder plugin):
Code: Select all
         
var myMovies = new Menu("All Movies","$$All Movies","/osd/image/villa/home_video_main_icon_n.png",
                    "/osd/image/villa/home_video_main_icon_f.png", true);
myMovies.handler = function(){
   Menu.Top["$$Video"]["$$Local Drives"]["$$All Video"].handler()
};
Menu.Top.addChild(myMovies);


Building on the above, I've been able to set it to go to YouTubes Top Rated with the following code:
Code: Select all
         
var myYoutube = new Menu("My Youtube","$$YouTube Top Rated","/osd/image/villa/home_video_youtube_sub_icon_n.png",
                   "/osd/image/villa/home_video_youtube_sub_icon_f.png", true);
myYoutube.handler = function(){
   Menu.Top["$$Video"]["$$YouTube"]["$$Top Rated"].handler()
//   Menu.Top["$$Video"]["$$YouTube"].handler()   //this doesn't work and crashes the osd
};
Menu.Top.addChild(myYoutube);


I would like to have a YouTube Icon on the front screen that when clicked, brought up the YouTube submenu.

And I've tried the following with Pandora, to no good end:
Code: Select all
         
var myPandora = new Menu("My Pandora","$$Pandora","/osd/image/villa/home_pandora_icon_n.png",
                               "/osd/image/villa/home_pandora_icon_f.png", true);
myPandora.handler = function(){
   Menu.Top["$$Music"]["$$Pandora"]["$$user@gmail.com"].handler()
};
//   myPandora.addChild(Menu.Top["$$Music"]["$$Pandora"]);   // This crashes the osd
Menu.Top.addChild(myPandora);


I'm sure I'm just not getting the big picture with how the menus work, but haven't been able to figure it out from previous posts or by looking at code from other plugins.

Thanks for the help,
Travis
tkorth
DLX'er
 
Posts: 59
Joined: Mon Apr 19, 2010 10:18 am

Re: Rearranging Top.Menu items   

Postby Jodo » Wed Jun 30, 2010 10:00 pm

I'm trying to do exactly the same thing with Pandora and having the same problem. It's almost as if the title of the menus are not what we think they are.

Thanks in advance!
Jodo
Donor
 
Posts: 8
Joined: Wed Jun 30, 2010 9:58 pm

Re: Rearranging Top.Menu items   

Postby tkorth » Thu Jul 01, 2010 12:15 pm

I've got Pandora figured out. Here's the bit of code that will put a Pandora icon on the Top Menu and when you click it it logs in. Just change the email address to your pandora login. I put this code into MediaFolder.plugin.js

Code: Select all
         
var myPandora = new Menu("My Pandora","$$My Pandora","/osd/image/villa/home_pandora_icon_n.png","/osd/image/villa/home_pandora_icon_f.png", true);

   myPandora.handler = function(){
      Menu.Top["$$Music"]["$$Pandora"]["yourname@email.com"].handler()
   };
Menu.Top.addChild(myPandora);


Still trying to figure out youtube... I'm trying to recreate the youtube menu, but having problems some unknown problem. At boot, it finds but doesn't load the plugin. Must be a typo. There also might be a problem in reusing subfolder names such as Account and Preferences. I've tweaked some of the other names around. It was at least showing up in the menu for a while, but then I had a corrupted file and when I remade it, it didn't work anymore.

Here's my plugin so far in case anyone wants to spot check me. HomePageYouTube.plugin.js:
Code: Select all
traceln("Start loading HomePageYouTube")

function HomePageYouTube(path) {

        this.rootPath = path;
        traceln("HomePageYouTube plugin : base path is " + this.rootPath);

}

HomePageYouTube.prototype = new Plugin()
HomePageYouTube.prototype.constructor = HomePageYouTube;


HomePageYouTube.prototype.doBuildMenus = function() {
   
    var youtubeMenu = new Menu("WatchYouTube", "$$Watch YouTube", "/osd/image/villa/home_video_youtube_sub_icon_n.png", "/osd/image/villa/home_video_youtube_sub_icon_f.png", true);

    youtubeMenu.addChild(new Menu("TopFavorited", "$$Top Favorited", "/osd/image/villa/home_video_youtube_favorites_sub_icon_n.png", "/osd/image/villa/home_video_youtube_favorites_sub_icon_f.png", true));
    youtubeMenu.addChild(new Menu("FeaturedVideos", "$$Featured Videos", "/osd/image/villa/home_video_youtube_popular_sub_icon_n.png", "/osd/image/villa/home_video_youtube_popular_sub_icon_f.png", true));
    youtubeMenu.addChild(new Menu("MostPopular", "$$Most Popular", "/osd/image/villa/home_most_popular_icon_n.png", "/osd/image/villa/home_most_popular_icon_f.png", true));
    youtubeMenu.addChild(new Menu("MostViewed", "$$Most Viewed", "/osd/image/villa/home_most_viewed_icon_n.png", "/osd/image/villa/home_most_viewed_icon_f.png", true));
    youtubeMenu.addChild(new Menu("TopRated", "$$Top Rated", "/osd/image/villa/home_top_rate_icon_n.png", "/osd/image/villa/home_top_rate_icon_f.png", true));
    youtubeMenu.addChild(new Menu("Preferences", "$$Preferences", "/osd/image/villa/home_video_youtobe_preference_sub_icon_n.png", "/osd/image/villa/home_video_youtobe_preference_sub_icon_f.png", true));
    youtubeMenu.addChild(new Menu("Account", "$$Account", "/osd/image/villa/home_video_youtube_myaccont_sub_icon_n.png", "/osd/image/villa/home_video_youtube_myaccont_sub_icon_f.png", true));
    youtubeMenu.addChild(new Menu("Search", "$$Search", "/osd/image/villa/home_search_icon_n.png", "/osd/image/villa/home_search_icon_f.png", true));

    youtubeMenu.lastChild.next = youtubeMenu.firstChild
    youtubeMenu.firstChild.prev = youtubeMenu.lastChild

    Menu.Top.addChild(youtubeMenu);



   Menu.Top.WatchYouTube.TopFavorited.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Top Favorited"].handler()
   };
   Menu.Top.WatchYouTube.FeaturedVideos.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Featured Videos"].handler()
   };
   Menu.Top.WatchYouTube.MostPopular.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Most Popular"].handler()
   };
   Menu.Top.WatchYouTube.MostViewed.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Most Viewed"].handler()
   };
   Menu.Top.WatchYouTube.TopRated.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Top Rated"].handler()
   };
   Menu.Top.WatchYouTube.Preferences.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Preferences"].handler()
   };
   Menu.Top.WatchYouTube.Account.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Account"].handler()
   };
   Menu.Top.WatchYouTube.Search.handler = function(){
      Menu.Top["$$Video"]["$$YouTube"]["$$Search"].handler()
   };



}


    HomePageYouTube.instance = new HomePageYouTube(scriptPath);

    Plugin.registerPlugin(HomePageYouTube.instance);

    traceln("End loading HomePageYouTube");
tkorth
DLX'er
 
Posts: 59
Joined: Mon Apr 19, 2010 10:18 am

Re: Rearranging Top.Menu items   

Postby Jodo » Thu Jul 01, 2010 2:09 pm

I was like... that's the same code!!! Then I noticed that the email address had no $$ preceding it. Le sigh.

I'll try that when I get home. Thanks!
Jodo
Donor
 
Posts: 8
Joined: Wed Jun 30, 2010 9:58 pm

Re: Rearranging Top.Menu items   

Postby tkorth » Thu Jul 01, 2010 7:16 pm

I got the Youtube menu working too and made them both into plugins.

See here:
http://forum.wdlxtv.com/viewtopic.php?f=48&t=987
tkorth
DLX'er
 
Posts: 59
Joined: Mon Apr 19, 2010 10:18 am

Re: Rearranging Top.Menu items   

Postby recliq » Fri Jul 02, 2010 6:58 am

@tkorth: why easy if there is a complicated way...
maybe take a look at this script i made for someone: http://forum.wdlxtv.com/download/file.php?id=34.
You can link Entire Menus on top menu without redefining everything and every submenu...
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Rearranging Top.Menu items   

Postby tkorth » Fri Jul 02, 2010 7:39 am

:x I swear I tried that!!! Must have been something else wrong with the code. I was willing to bet there was an easier answer but couldn't find it anywhere.

Thanks for the answer.

Will this work with the UMSP menus too? If I recall correctly, at some point the menu structure breaks down and items such as AppleTrailers are not menu items but media items?
tkorth
DLX'er
 
Posts: 59
Joined: Mon Apr 19, 2010 10:18 am

Re: Rearranging Top.Menu items   

Postby recliq » Fri Jul 02, 2010 4:01 pm

correct, and there's so far no way i know of to add a media item to menu... :|
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Rearranging Top.Menu items   

Postby Jodo » Fri Jul 02, 2010 7:12 pm

Gah - me = double fail...

I didn't realise that installing b-rad's firmware deleted my Pandora registration :) so even when I got the $$ bit correct, I still couldn't load Pandora!

Also I tinkered with recliq's code. The way he does it, while simpler, physically seems to move the menu item from its original place to the top menu. I'm not sure I like that so I think I'll stick to the method employed in this plug in. Thanks for the hard work, guys!
Jodo
Donor
 
Posts: 8
Joined: Wed Jun 30, 2010 9:58 pm

Re: Rearranging Top.Menu items   

Postby pippolino » Fri Jul 09, 2010 5:00 am

Hello,
I was too trying to design my own menu with the items I use.
I added a log function to a script to identify menu names but some of them are empty... (maybe as you told they are media items?)

This is what I identified:
Plugins (if you use plugins)
Plugin0
Plugin1
Plugin...
Tools (if you use MovieSheetPlugin)
enableSheet
disableSheets
Reboot
Weather (Weather plugin)
$$Video
$$Local Drives
$$USB2
$$Media Servers
$$Network Shares
$$YouTube
$$Photos
$$Local Drives
$$USB2
$$Media Servers
$$Network Shares
$$Flickr
$$Music
$$Local Drives
$$USB2
$$Media Servers
$$Network Shares
$$Live365
$$Pandora
$$Settings
$$Audio/Video

just as example...

What I would like to have is:
Plugins -> OK
Reboot -> OK
Weather -> OK
$$Video -> $$Local Drives -> $$USB2 -> XMOUNTED MOVIES SUBFOLDER ??? HOW CAN I DO THIS? OR DIRECTLY THE XMOUNTED FOLDER WITHOUT POINTING TO USB...
UMSP -> DVD ?? WHAT IS THE NAME TO POINT TO THIS?? HAS ANYONE FOUND?
APPLE TRAILERS -> ?? WHAT IS THE NAME TO POINT TO THIS?? HAS ANYONE FOUND?
$$YouTube -> OK
$$Settings -> OK

Thanks to all
Lore
pippolino
WDTVer
 
Posts: 24
Joined: Thu Apr 22, 2010 5:09 am

Next

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 2 guests