* @see captureplugin.drivers.DeviceIf#remove(java.awt.Window,
* devplugin.Program)
*/
@Override
public boolean remove(Window parent, Program program) {
TopfieldConnector connector = new TopfieldConnector(configuration);
if (!configuration.isRecordingsLocal()) {
try {
connector.getTimerList();
} catch (TopfieldConnectionException e) {
String message = String.format(localizer.msg(DEVICE_UNREACHABLE_TEXT, DEFAULT_DEVICE_UNREACHABLE_TEXT), name);
JOptionPane.showMessageDialog(parent, message, localizer.msg(DEVICE_UNREACHABLE_TITLE,
DEFAULT_DEVICE_UNREACHABLE_TITLE), JOptionPane.ERROR_MESSAGE);
}
}
for (TopfieldTimerEntry entry : configuration.getTimerEntries()) {
if (entry.getProgram().getProgram().equals(program)) {
if (!configuration.isRecordingsLocal()) {
try {
return connector.deleteRecording(parent, entry);
} catch (TopfieldConnectionException e) {
String message = String.format(localizer.msg(DEVICE_UNREACHABLE_TEXT, DEFAULT_DEVICE_UNREACHABLE_TEXT),
name);
JOptionPane.showMessageDialog(parent, message, localizer.msg(DEVICE_UNREACHABLE_TITLE,
DEFAULT_DEVICE_UNREACHABLE_TITLE), JOptionPane.ERROR_MESSAGE);