if (JOptionPane.showConfirmDialog(parent, localizer.msg(NOT_CONFIGURED_TEXT, DEFAULT_NOT_CONFIGURED_TEXT),
localizer.msg(NOT_CONFIGURED_TITLE, DEFAULT_NOT_CONFIGURED_TITLE), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
configDevice(parent);
}
} else {
ProgramTime time = new ProgramTime(program);
Calendar start = time.getStartAsCalendar();
start.add(Calendar.MINUTE, configuration.getChannelPreroll(program.getChannel()) * -1);
time.setStart(start.getTime());
Calendar end = time.getEndAsCalendar();
end.add(Calendar.MINUTE, configuration.getChannelPostroll(program.getChannel()));
time.setEnd(end.getTime());
JComboBox repeatSelector = new JComboBox();
for (TopfieldTimerMode mode : TopfieldTimerMode.values()) {
repeatSelector.addItem(mode);
}
ProgramTimeDialog recordDialog = new ProgramTimeDialog(parent, time, true, localizer.msg(REPEAT_LABEL,
DEFAULT_REPEAT_LABEL), repeatSelector);
UiUtilities.centerAndShow(recordDialog);
ProgramTime programToRecord = recordDialog.getPrgTime();
if (programToRecord != null) {
TopfieldConnector connector = new TopfieldConnector(configuration);
boolean recordingAdded = false;
try {
recordingAdded = connector.addRecording(parent, service, programToRecord, (TopfieldTimerMode) repeatSelector