/**
* @see captureplugin.drivers.DeviceIf#executeAdditionalCommand(java.awt.Window,int,devplugin.Program)
*/
public boolean executeAdditionalCommand(Window parent, int num, Program program) {
if (num == 0) {
final DreamboxChannel channel = (DreamboxChannel) mConfig.getExternalChannel(program.getChannel());
if (channel != null) {
new Thread(new Runnable() {
public void run() {
DreamboxConnector connect = new DreamboxConnector(mConfig);
connect.switchToChannel(channel);
}
}).start();
} else {
int ret = JOptionPane.showConfirmDialog(parent,
mLocalizer.msg("notConfiguredText", "Channel not configured, do\nyou want to do this now?"),
mLocalizer.msg("notConfiguredTitle", "Configure"), JOptionPane.YES_NO_OPTION);
if (ret == JOptionPane.YES_OPTION) {
configDevice(parent);
}
}
return true;
} else if (num == 1) {
DreamboxConnector connect = new DreamboxConnector(mConfig);
ParamParser parser = new ParamParser();
connect.sendMessage(parser.analyse("{channel_name} - {leadingZero(start_hour,\"2\")}:{leadingZero(start_minute,\"2\")}-{leadingZero(end_hour,\"2\")}:{leadingZero(end_minute,\"2\")}\n{title}", program));
} else if (num == 2) {
final DreamboxChannel channel = (DreamboxChannel) mConfig.getExternalChannel(program.getChannel());
if (channel != null) {
DreamboxConnector connect = new DreamboxConnector(mConfig);
if (!connect.streamChannel(channel)) {
int ret = JOptionPane.showConfirmDialog(parent,