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.
????
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);
}BantryRed wrote:Shutdown just worked for me, windows 7 ultimate, will let you know about the others later. Thanks
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.
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! : )
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:Apart from that, it does what it says in the tin. And only weights 12kB!
- 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.
Users browsing this forum: No registered users and 2 guests