layout_data.horizontalSpan = 2;
show_nightly_build_warning.setLayoutData(layout_data);
show_nightly_build_warning.setSelection(swt_preferences.isNightlyBuildWarning());
}
Group ports = new Group(content,SWT.NONE);
ports.setText(_._("settingswindow.tab.general.group.ports"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
layout_data.horizontalSpan = 2;
ports.setLayoutData(layout_data);
ports.setLayout(new GridLayout(2,false));
label = new Label(ports,SWT.NONE);
label.setFont(skin.getDefaultFont());
label.setForeground(skin.getDefaultColor());
label.setText(_._("settingswindow.tab.connection.label.tcp_port") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
tcp_port = new Spinner (ports, SWT.BORDER);
tcp_port.setMinimum(1);
tcp_port.setMaximum(65535);
try {
tcp_port.setSelection(config_manager.getTCP());
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
tcp_port.setIncrement(1);
tcp_port.setPageIncrement(100);
label = new Label(ports,SWT.NONE);
label.setFont(skin.getDefaultFont());
label.setForeground(skin.getDefaultColor());
label.setText(_._("settingswindow.tab.connection.label.udp_port") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Composite container1 = new Composite(ports,SWT.NONE);
container1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
layout = new GridLayout(2,false);
layout.marginWidth=0;
layout.marginHeight=0;
container1.setLayout(layout);
udp_port = new Spinner (container1, SWT.BORDER);
udp_port.setMinimum(1);
udp_port.setMaximum(65535);
try {
udp_port.setSelection(config_manager.getUDP());
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
udp_port.setIncrement(1);
udp_port.setPageIncrement(100);
enable_udp = new Button(container1,SWT.CHECK);
enable_udp.setText(_._("settingswindow.tab.connection.button.enabled"));
enable_udp.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
updateUDPControls();
}
});
try {
enable_udp.setSelection(config_manager.isUDPEnabled());
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
updateUDPControls();
Group limits = new Group(content,SWT.NONE);
limits.setText(_._("settingswindow.tab.general.group.limits"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
layout_data.horizontalSpan = 2;
limits.setLayoutData(layout_data);
limits.setLayout(new GridLayout(2,false));
label = new Label(limits,SWT.NONE);
label.setFont(skin.getDefaultFont());
label.setForeground(skin.getDefaultColor());
label.setText(_._("settingswindow.tab.connection.label.download_limit") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Composite container2 = new Composite(limits,SWT.NONE);
layout_data = new GridData(GridData.FILL_HORIZONTAL);
container2.setLayoutData(layout_data);
layout = new GridLayout(3,false);
layout.marginWidth = 0;
layout.marginHeight = 0;
container2.setLayout(layout);
download_limit = new Text(container2,SWT.BORDER );
download_limit.addListener(SWT.Verify, number_filter);
layout_data = new GridData();
layout_data.widthHint = EDIT_FIELD_WIDTH;
download_limit.setLayoutData(layout_data);
try {
download_limit.setText((config_manager.getDownloadLimit()/1024)+"");
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
new Label(container2,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
enable_download_limit = new Button(container2,SWT.CHECK);
enable_download_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
enable_download_limit.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
updateDownloadLimitControls();
}
});
label = new Label(limits,SWT.NONE);
label.setFont(skin.getDefaultFont());
label.setForeground(skin.getDefaultColor());
label.setText(_._("settingswindow.tab.connection.label.upload_limit") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Composite container3 = new Composite(limits,SWT.NONE);
layout_data = new GridData(GridData.FILL_HORIZONTAL);
container3.setLayoutData(layout_data);
layout = new GridLayout(3,false);
layout.marginWidth = 0;
layout.marginHeight = 0;
container3.setLayout(layout);
upload_limit = new Text(container3,SWT.BORDER );
upload_limit.addListener(SWT.Verify, number_filter);
layout_data = new GridData();
layout_data.widthHint = EDIT_FIELD_WIDTH;
upload_limit.setLayoutData(layout_data);
try {
upload_limit.setText((config_manager.getUploadLimit()/1024)+"");
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
new Label(container3,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
enable_upload_limit = new Button(container3,SWT.CHECK);
enable_upload_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
enable_upload_limit.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
updateUploadLimitControls();
}
});
boolean enable = false;
try {
enable = config_manager.getDownloadLimit()==0 ? false : true;
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
enable_download_limit.setSelection(enable);
try {
enable = config_manager.getUploadLimit() == 0 ? false : true;
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
enable_upload_limit.setSelection(enable);
updateDownloadLimitControls();
updateUploadLimitControls();
Group capacities = new Group(content,SWT.NONE);
capacities.setText(_._("settingswindow.tab.general.group.capacities"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
layout_data.horizontalSpan = 2;
capacities.setLayoutData(layout_data);
capacities.setLayout(new GridLayout(2,false));
label = new Label(capacities,SWT.NONE);
label.setFont(skin.getDefaultFont());
label.setForeground(skin.getDefaultColor());
label.setText(_._("settingswindow.tab.connection.label.download_capacity") + " : ");