Aanpassing in worker: starten activeert niet automatisch, activeren start nu wel automatisch. Bij activeren kan worden opgegeven of als een thread moet worden gestart. Register lezen IOException genegeerd. LircDevice naar knop herkenning toegevoegd en class Multiplexer geintroduceerd. Verder kleine aanpassingen.

This commit is contained in:
2011-06-02 11:00:32 +00:00
parent fb9c871a80
commit 075e058ef2
19 changed files with 253 additions and 50 deletions

View File

@@ -4,6 +4,7 @@ import java.io.IOException;
import pm.Application;
import pm.util.Native;
import pm.util.VBScript;
public abstract class CMDApplication extends Application {
protected final static String REGISTRY = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths";
@@ -18,7 +19,7 @@ public abstract class CMDApplication extends Application {
this.title = title;
}
protected void initialise() {
public void activate() {
String key = String.format("%s\\%s", REGISTRY, program);
// Check of naam is gevonden in register
String path = Native.getValue(key);
@@ -30,13 +31,15 @@ public abstract class CMDApplication extends Application {
e.printStackTrace();
//throw new ApplicationInitialiseException();
}
super.activate();
}
public void activate() {
if (!active) {
initialise();
public boolean active() {
try {
return active = VBScript.isRunning(program);
} catch (IOException e) {
return false;
}
super.activate();
}
public void deactivate() {