refreshSettings.addSeparator(mLocalizer.msg("titleRefresh", "Startup"), cc.xyw(
1, 1, 6));
mAutoDownload = new JCheckBox(mLocalizer.msg("autoUpdate","Update TV listings automatically"));
mStartDownload = new JRadioButton(mLocalizer.msg("onStartUp", "Only on TV-Browser startup"));
mRecurrentDownload = new JRadioButton(mLocalizer.msg("recurrent","Recurrent"));
ButtonGroup bg = new ButtonGroup();
bg.add(mStartDownload);
bg.add(mRecurrentDownload);
refreshSettings.add(mAutoDownload, cc.xyw(2, 3, 5));
refreshSettings.add(mStartDownload, cc.xyw(3, 5, 4));
refreshSettings.add(mRecurrentDownload, cc.xyw(3, 6, 4));
mAutoDownloadCombo = new JComboBox(AUTO_DOWNLOAD_MSG_ARR);
String dlType = Settings.propAutoDownloadType.getString();
if (dlType.equals("daily")) {
mAutoDownloadCombo.setSelectedIndex(0);
} else if (dlType.equals("every3days")) {
mAutoDownloadCombo.setSelectedIndex(1);
} else if (dlType.equals("weekly")) {
mAutoDownloadCombo.setSelectedIndex(2);
}
JPanel panel = new JPanel(new FormLayout("10dlu, pref, 3dlu, pref", "pref, 3dlu, pref, 3dlu, pref, 5dlu, pref"));
mStartDownload.setSelected(!dlType.equals("never") && !Settings.propAutoDataDownloadEnabled.getBoolean());
mRecurrentDownload.setSelected(Settings.propAutoDataDownloadEnabled.getBoolean());
mAutoDownload.setSelected(mStartDownload.isSelected() || mRecurrentDownload.isSelected());
mStartDownload.setSelected(!mAutoDownload.isSelected() || mStartDownload.isSelected());
mStartDownload.setEnabled(mAutoDownload.isSelected());
mRecurrentDownload.setEnabled(mAutoDownload.isSelected());
mHowOften = new JLabel(mLocalizer.msg("autoDownload.howOften", "How often?"));
panel.add(mHowOften, cc.xy(2, 1));
panel.add(mAutoDownloadCombo, cc.xy(4, 1));
mAskBeforeDownloadRadio = new JRadioButton(mLocalizer.msg("autoDownload.ask", "Ask before downloading"));
mAutoDownloadPeriodCB = new JComboBox(PeriodItem.getPeriodItems());
int autoDLPeriod = Settings.propAutoDownloadPeriod.getInt();
PeriodItem pi = new PeriodItem(autoDLPeriod);
mAutoDownloadPeriodCB.setSelectedItem(pi);
panel.add(mAskBeforeDownloadRadio, cc.xyw(2, 3, 3));
mAskTimeRadio = new JRadioButton(mLocalizer.msg("autoDownload.duration", "Automatically refresh for"));
panel.add(mAskTimeRadio, cc.xy(2, 5));
panel.add(mAutoDownloadPeriodCB, cc.xy(4, 5));
ButtonGroup group = new ButtonGroup();
group.add(mAskBeforeDownloadRadio);