Now you can Shutdown PC From PS3

If you have a suggestion for a feature, post it here

Re: Now you can Shutdown PC From PS3

Postby mazey » Sat Mar 06, 2010 2:33 pm

lol nobody is using it anymore since 404 is out, learn to plugin.. :P
PMS 1.90.2 SNAPSHOT - HP Proliant Microserver N54L 2.2Ghz - Windows Home Server 2011 (64bit) 8GB - Bravia KDL55HX750
mazey
 
Posts: 767
Joined: Sat Oct 24, 2009 9:07 am

Re: Now you can Shutdown PC From PS3

Postby el.botijo » Sun Mar 07, 2010 12:12 am

chacaman wrote:
el.botijo wrote:Two weeks and you still have not tried to get this into a plugin. If you share the code, I will code the plugin version.

????

You know that PMS supports plugins, do you?
See, plugins works with every version (so you do not need to keep anybody up to date), and the shutdown plugin might weight something like 2kB at most? Compare to the 20MB PMS.jar file!
As you might be somewhat confused, I am offering my help to code something (mainly copy and paste into plugin skeleton). I will do this once. After that, is all yours.
el.botijo
 
Posts: 50
Joined: Thu Feb 04, 2010 9:14 pm

Re: Now you can Shutdown PC From PS3

Postby chacaman » Sun Mar 07, 2010 5:41 pm

this is the code on the psm.java.

Code: Select all
VirtualFolder vfs = new VirtualFolder(Messages.getString("Computer Options"), null); //$NON-NLS-1$      
           vfs.addChild(new VirtualVideoAction(Messages.getString("ShutDown Windows"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process = runtime.exec("ShutDown /s /f");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("Restart Windows"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process = runtime.exec("ShutDown /r /f");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("hibernate windows"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process1 = runtime.exec("powercfg /h on");
                  Process process2 = runtime.exec("ShutDown /h");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("Sleep Windows"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process01 = runtime.exec("powercfg /h off");
                  Process process02 = runtime.exec("Rundll32.exe Powrprof.dll,SetSuspendState Sleep");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("Shut Down Linux"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process = runtime.exec("shutdown -h now");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("Restart Linux"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process = runtime.exec("shutdown -r now");
               } catch (IOException e) {}
               return true;
            }
         });
         
         vfs.addChild(new VirtualVideoAction(Messages.getString("Hibernate Ubuntu"), true) { //$NON-NLS-1$
            public boolean enable() {
               Runtime runtime = Runtime.getRuntime();
               try {
                  Process process = runtime.exec("sudo hibernate-ram --force");
               } catch (IOException e) {}
               return true;
            }
         });
   
         //vf.closeChildren(0, false);
         getRootFolder(renderer).addChild(vfs);
      }
chacaman
 
Posts: 17
Joined: Sun Feb 07, 2010 7:38 pm

Re: Now you can Shutdown PC From PS3

Postby el.botijo » Sun Mar 07, 2010 7:57 pm

I have copied over everything as a plugin. My skills are becomen too rusty, or I might be too tired today, but anyhow, NON-working plugin version can be found here:
http://sites.google.com/site/elbotijomm ... ects=0&d=1
Source code included in the JAR file (it is a ZIP file after all). I hope you can figure out why this is not working for me on PMS 404. At least it should give you a rough idea on how to code a plugin.
el.botijo
 
Posts: 50
Joined: Thu Feb 04, 2010 9:14 pm

Re: Now you can Shutdown PC From PS3

Postby BantryRed » Sun Mar 07, 2010 8:50 pm

Shutdown just worked for me, windows 7 ultimate, will let you know about the others later. Thanks
BantryRed
 
Posts: 86
Joined: Wed Feb 25, 2009 11:11 am
Location: Cork Ireland

Re: Now you can Shutdown PC From PS3

Postby el.botijo » Sun Mar 07, 2010 9:51 pm

BantryRed wrote:Shutdown just worked for me, windows 7 ultimate, will let you know about the others later. Thanks

The plugin version works, it just does not work with my Roku Soundbridge... Video Settings do not show either, so it is a genuine bug with my Roku Soundbridge. However, it works ok with XBMC 9.11.

Another tip: localization of the plugin. I have copied over what PMS uses for localization. That means that you can copy shutdown_messages.properties into, let's say, shutdown_messages_de.properties and then translate from English into German. You should not worry about log commands, though.

That is for today.
el.botijo
 
Posts: 50
Joined: Thu Feb 04, 2010 9:14 pm

Re: Now you can Shutdown PC From PS3

Postby chacaman » Mon Mar 08, 2010 1:39 am

el.botijo wrote:I have copied over everything as a plugin. My skills are becomen too rusty, or I might be too tired today, but anyhow, NON-working plugin version can be found here:
http://sites.google.com/site/elbotijomm ... ects=0&d=1
Source code included in the JAR file (it is a ZIP file after all). I hope you can figure out why this is not working for me on PMS 404. At least it should give you a rough idea on how to code a plugin.


excelent work! : )
chacaman
 
Posts: 17
Joined: Sun Feb 07, 2010 7:38 pm

Re: Now you can Shutdown PC From PS3

Postby marco275 » Mon Mar 08, 2010 10:14 am

YESS!! Thank you both chacaman & el.botijo. :D

Going to give it a try right away.
marco275
 
Posts: 177
Joined: Thu Feb 05, 2009 2:29 pm

Re: Now you can Shutdown PC From PS3

Postby el.botijo » Mon Mar 08, 2010 9:30 pm

chacaman wrote:
el.botijo wrote:I have copied over everything as a plugin. My skills are becomen too rusty, or I might be too tired today, but anyhow, NON-working plugin version can be found here:
http://sites.google.com/site/elbotijomm ... ects=0&d=1
Source code included in the JAR file (it is a ZIP file after all). I hope you can figure out why this is not working for me on PMS 404. At least it should give you a rough idea on how to code a plugin.


excelent work! : )

Now it is up to you to develop this further. What I see lacking is this:
  • It looks it only displays if the video settings option is active
  • It does not work on Mac
  • There is no error checking but for the example I written and not tested
  • English version only for the time being
  • The config window is uggly and the description is bad
  • The plugin JAR file is hosted in my website. As you are the true parent of this baby, you better take care of it. The version on my website might disappear at some stage without notice.
  • The plugin is not listed in the plugin list of this forum. So not many people know about this one. Some moderator notice this thread, please! Need a marketing campaign, I tell you.
Apart from that, it does what it says in the tin. And only weights 12kB!
el.botijo
 
Posts: 50
Joined: Thu Feb 04, 2010 9:14 pm

Re: Now you can Shutdown PC From PS3

Postby mazey » Tue Mar 09, 2010 1:13 am

el.botijo wrote:
chacaman wrote:
el.botijo wrote:I have copied over everything as a plugin. My skills are becomen too rusty, or I might be too tired today, but anyhow, NON-working plugin version can be found here:
http://sites.google.com/site/elbotijomm ... ects=0&d=1
Source code included in the JAR file (it is a ZIP file after all). I hope you can figure out why this is not working for me on PMS 404. At least it should give you a rough idea on how to code a plugin.


excelent work! : )

Now it is up to you to develop this further. What I see lacking is this:
  • It looks it only displays if the video settings option is active
  • It does not work on Mac
  • There is no error checking but for the example I written and not tested
  • English version only for the time being
  • The config window is uggly and the description is bad
  • The plugin JAR file is hosted in my website. As you are the true parent of this baby, you better take care of it. The version on my website might disappear at some stage without notice.
  • The plugin is not listed in the plugin list of this forum. So not many people know about this one. Some moderator notice this thread, please! Need a marketing campaign, I tell you.
Apart from that, it does what it says in the tin. And only weights 12kB!


i dont have video settings on and it worked for me. nicely. im using windows 7.

this thread should be moved to plugins and the first post edited/updated with details and download location..
PMS 1.90.2 SNAPSHOT - HP Proliant Microserver N54L 2.2Ghz - Windows Home Server 2011 (64bit) 8GB - Bravia KDL55HX750
mazey
 
Posts: 767
Joined: Sat Oct 24, 2009 9:07 am

Previous

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest