Sign up here and you can log into the forum!

Plugin: HideSettings (Update 2010/04/18)

The WDTVExt plugin depot. Plugins/libraries/code only

Plugin: HideSettings (Update 2010/04/18)   

Postby calimero100582 » Fri Apr 16, 2010 10:24 am

Here is the code for a basic plugin to hide Settings menu, this may be usefull when you have kids.

Code: Select all
traceln("Start loading HideSettingsPlugin Plugin")
function HideSettingsPlugin(path) {
    this.rootPath = path;
}

// chain HideSettingsPlugin with proper inheritance - classical in javascript
HideSettingsPlugin.prototype = new Plugin()
HideSettingsPlugin.prototype.constructor = HideSettingsPlugin;

HideSettingsPlugin.prototype.doBuildMenus = function() {
   Menu.Top.$$Settings.visible = false;
}

HideSettingsPlugin.prototype.onPageKey =  function(page, key)
{
  if(page.markupFileName == "villa_home.xml" && !Menu.Top.$$Settings.visible && key == "23" && page.getParam("current_node_name") != "$$Settings" && page.getParam("root_node_name") == "") {
    Menu.Top.$$Settings.visible = true;
    page.redraw(true); // force redraw
}
}
 
// create our plugin with baseParg pointing to current script path
// global variables scriptName, scriptLocation and scriptFullPath are available, no need to do the following
HideSettingsPlugin.instance = new HideSettingsPlugin(scriptPath)

// register our plugin with Ext
Plugin.registerPlugin(HideSettingsPlugin.instance)


Edit 1: Pressing "Options" shows the Settings. Power Off -> On sequence, using remote, hide Settings.
Last edited by calimero100582 on Wed Apr 21, 2010 4:55 pm, edited 2 times in total.
WDTV Live - Telnet Remote Controller and MoreImage
WDlxTV - lilibabe OSD Picto I - 16GB USB Drive
calimero100582
Developer
 
Posts: 18
Joined: Mon Apr 12, 2010 6:31 am

Re: Plugin: HideSettings   

Postby migube » Fri Apr 16, 2010 10:41 pm

Tx have kidz:)
-----
WdTvLive - LG BD390 - Philips 47PFL8404h - Yamaha RXV-667 - DM7000 - Synology 107+ - HP Touchpad (Webos)
migube
Global Moderator
 
Posts: 162
Joined: Thu Apr 08, 2010 7:23 am

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby jatimon » Mon Apr 26, 2010 10:36 am

can this plugin be used to make only specific menu selections available?

Here is what I am thinking/hoping, when I click on VIDEO, the next screen I see is the one where my media files are. Rather than having to navigate more screens to get to them.
Thanks

--
JT
User avatar
jatimon
Developer
 
Posts: 89
Joined: Mon Apr 26, 2010 10:03 am

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby calimero100582 » Mon Apr 26, 2010 11:05 am

jatimon wrote:can this plugin be used to make only specific menu selections available?

Here is what I am thinking/hoping, when I click on VIDEO, the next screen I see is the one where my media files are. Rather than having to navigate more screens to get to them.


This is a different one, but I know someone did this.

What menu do you want to link to?? Video -> Local Drives -> Folders?? or something else??
WDTV Live - Telnet Remote Controller and MoreImage
WDlxTV - lilibabe OSD Picto I - 16GB USB Drive
calimero100582
Developer
 
Posts: 18
Joined: Mon Apr 12, 2010 6:31 am

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby recliq » Mon Apr 26, 2010 1:25 pm

yep, i did 8-)

what this does is, it links the main menu items video, music, photos directly to 'Local Drives -> Folders' within this menu.

here's the code, maybe it is of some ispiration...
Code: Select all
traceln("Start loading MediaFolder plugin")

function MediaFolderPlugin(path) {

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

}

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

MediaFolderPlugin.prototype.doBuildMenus = function() {

        traceln("MediaFolderPlugin.prototype.doBuildMenus...");

        Menu.Top.$$Video.handler = function(){
                Menu.Top["$$Video"]["$$Local Drives"]["$$Folders"].handler()
        };
        Menu.Top.$$Video.title = "Movies";

        Menu.Top.$$Music.handler = function(){
                Menu.Top["$$Music"]["$$Local Drives"]["$$Folders"].handler()
        };

        Menu.Top.$$Photos.handler = function(){
                Menu.Top["$$Photos"]["$$Local Drives"]["$$Folders"].handler()
        };
}

MediaFolderPlugin.instance = new MediaFolderPlugin(scriptPath);

Plugin.registerPlugin(MediaFolderPlugin.instance);

traceln("End loading MediaFolder plugin");
­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: 5022
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby jatimon » Mon May 03, 2010 11:11 am

This is a different one, but I know someone did this.

What menu do you want to link to?? Video -> Local Drives -> Folders?? or something else??


yep, something like that Video -> {Root of my mounted media store} currently its Videos->Local Drives->Folders->Movies->{Root of my mounted media store}


@recliq
here's the code, maybe it is of some ispiration...


Cool Beans!

can I just paste that code with appropriate edits into a file in the plugins directory?
Thanks

--
JT
User avatar
jatimon
Developer
 
Posts: 89
Joined: Mon Apr 26, 2010 10:03 am

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby recliq » Mon May 03, 2010 11:18 am

can I just paste that code with appropriate edits into a file in the plugins directory?


Yes, only naming convention i know of is that the filename has to end with '.plugin.js'

This is quite usefull when you don't want a plugin to load, just rename it!
eg.
MyPlug.plugin.js -> MyPlug.plugin

and it won't get loaded next time you reboot ;)
­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: 5022
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby Senseohasser » Sat May 22, 2010 1:03 am

Great script, thanks! :mrgreen:

Is it possible to let it jump to a specific folder within 'Local Drives -> Folders'? I tried to add ["$$Fotos"] (Fotos is the mount name of one of my subfolders) but it doesn't work (this menu just becomes inactive).

Any idea?



recliq wrote:yep, i did 8-)

what this does is, it links the main menu items video, music, photos directly to 'Local Drives -> Folders' within this menu.

here's the code, maybe it is of some ispiration...
Senseohasser
WDTVer
 
Posts: 32
Joined: Mon May 10, 2010 6:22 am

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby recliq » Sat May 22, 2010 1:19 am

not yet, maybe in future versions of wdtvext.
­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: 5022
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: HideSettings (Update 2010/04/18)   

Postby Senseohasser » Sat May 22, 2010 4:49 am

Ah, bummer! Thanks anyway, the script along with wdtvext is already a huge improvement for me.

recliq wrote:not yet, maybe in future versions of wdtvext.
Senseohasser
WDTVer
 
Posts: 32
Joined: Mon May 10, 2010 6:22 am

Next

Return to WDTVExt plugins

Who is online

Users browsing this forum: No registered users and 2 guests