Feature request: shut down machine after uploading

nick77
nick77's picture

Joined: 2003-07-22
Posts: 77
Posted: Sun, 2003-09-14 19:04

Hi,

What do you guys think of an option to automatically shut down (windoze) when the upload has finished? It often occured to me (guess I'm not the only one...) that I had to leave the house while gallery remote still was uploading...

With my (let's call it) limited knowledge in Java I think that the function wouldn't be too difficult to implement :lol:

Comments?

Cheers,

Nick

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Sun, 2003-09-14 19:46

This is in the plan... but with a very low priority. Besides, this is very hard to do from Java, or at least I wouldn't know how to do it in a cross-platform way.

 
nick77
nick77's picture

Joined: 2003-07-22
Posts: 77
Posted: Thu, 2003-09-25 10:45

well, as you already know, I don't know anything in Java, so I've been asking around in Forums a little bit.

As they are deleting forum messages after a certain time, I'll post and translate the answers here:

this is what aaa3 wrote:

Quote:
RunTime.getRuntime().exec("command");

to shut down Windows "command" should f.e. read:
rundll32.exe user,exitwindows

Quote:
public class ShutDown {
ShutDown() {
String[] win98Befehl = {"rundll32", "user,exitwindows", "exec"};
String[] winXPBefehl = {"shutdown", "-s", "-t", " 01"};

try {
Runtime.getRuntime().exec(win98Befehl);
System.exit(0);
}
catch(java.io.IOException io) {
io.printStackTrace();
}
}

public static void main(String args[]){
new ShutDown();
}
}

I found the shut-down command for winXP in the Internet too (cf.: code) couldn't test it though (no WinXP...). The win98-comand should hopefully work under win98SE and winme.
In Linux there is something like halt or shutdown -fh now.

I hope this helps a little bit. Many thanks to aaa3

I thought, one (ie you;-) could release the shut-down option for some of the operating systems; I guess, it should be possible to hide the option if the os isn't compatible?

thanks again

Nick

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2003-09-25 10:54

Thanks Nick. I'll add this option to the upload progress dialog in 1.2.

Tracking this in this task.

 
nick77
nick77's picture

Joined: 2003-07-22
Posts: 77
Posted: Thu, 2003-09-25 11:20

Good Lord! you are f a s t!

Thanks so much!

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2003-09-25 13:54

Done in GR 1.2-b4. Thanks for the help, nick77.