📄 configsectionconnectionencryption.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: ConfigSectionConnectionEncryption.java
package org.gudy.azureus2.ui.swt.views.configsections;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.ui.swt.Messages;
import org.gudy.azureus2.ui.swt.components.LinkLabel;
import org.gudy.azureus2.ui.swt.config.*;
import org.gudy.azureus2.ui.swt.plugins.UISWTConfigSection;
public class ConfigSectionConnectionEncryption
implements UISWTConfigSection
{
private final String CFG_PREFIX = "ConfigView.section.connection.encryption.";
private final int REQUIRED_MODE = 1;
public ConfigSectionConnectionEncryption()
{
}
public int maxUserMode()
{
return 1;
}
public String configSectionGetParentSection()
{
return "server";
}
public String configSectionGetName()
{
return "connection.encryption";
}
public void configSectionSave()
{
}
public void configSectionDelete()
{
}
public Composite configSectionCreate(Composite parent)
{
Composite cSection = new Composite(parent, 0);
GridData gridData = new GridData(272);
cSection.setLayoutData(gridData);
GridLayout advanced_layout = new GridLayout();
cSection.setLayout(advanced_layout);
int userMode = COConfigurationManager.getIntParameter("User Mode");
if (userMode < 1)
{
Label label = new Label(cSection, 64);
gridData = new GridData();
label.setLayoutData(gridData);
String modeKeys[] = {
"ConfigView.section.mode.beginner", "ConfigView.section.mode.intermediate", "ConfigView.section.mode.advanced"
};
String param1;
if (1 < modeKeys.length)
param1 = MessageText.getString(modeKeys[1]);
else
param1 = String.valueOf(1);
String param2;
if (userMode < modeKeys.length)
param2 = MessageText.getString(modeKeys[userMode]);
else
param2 = String.valueOf(userMode);
label.setText(MessageText.getString("ConfigView.notAvailableForMode", new String[] {
param1, param2
}));
return cSection;
}
Group gCrypto = new Group(cSection, 0);
Messages.setLanguageText(gCrypto, "ConfigView.section.connection.encryption.encrypt.group");
gridData = new GridData(768);
gCrypto.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
gCrypto.setLayout(layout);
Label lcrypto = new Label(gCrypto, 64);
Messages.setLanguageText(lcrypto, "ConfigView.section.connection.encryption.encrypt.info");
gridData = new GridData(768);
gridData.horizontalSpan = 2;
gridData.widthHint = 200;
lcrypto.setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 2;
new LinkLabel(gCrypto, gridData, "ConfigView.section.connection.encryption.encrypt.info.link", "http://www.azureuswiki.com/index.php/Avoid_traffic_shaping");
BooleanParameter require = new BooleanParameter(gCrypto, "network.transport.encrypted.require", "ConfigView.section.connection.encryption.require_encrypted_transport");
gridData = new GridData();
gridData.horizontalSpan = 2;
require.setLayoutData(gridData);
String encryption_types[] = {
"Plain", "RC4"
};
String dropLabels[] = new String[encryption_types.length];
String dropValues[] = new String[encryption_types.length];
for (int i = 0; i < encryption_types.length; i++)
{
dropLabels[i] = encryption_types[i];
dropValues[i] = encryption_types[i];
}
Composite cEncryptLevel = new Composite(gCrypto, 0);
gridData = new GridData(272);
gridData.horizontalSpan = 2;
cEncryptLevel.setLayoutData(gridData);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 0;
layout.marginHeight = 0;
cEncryptLevel.setLayout(layout);
Label lmin = new Label(cEncryptLevel, 0);
Messages.setLanguageText(lmin, "ConfigView.section.connection.encryption.min_encryption_level");
StringListParameter min_level = new StringListParameter(cEncryptLevel, "network.transport.encrypted.min_level", encryption_types[1], dropLabels, dropValues);
Label lcryptofb = new Label(gCrypto, 64);
Messages.setLanguageText(lcryptofb, "ConfigView.section.connection.encryption.encrypt.fallback_info");
gridData = new GridData(768);
gridData.horizontalSpan = 2;
gridData.widthHint = 200;
lcryptofb.setLayoutData(gridData);
BooleanParameter fallback_outgoing = new BooleanParameter(gCrypto, "network.transport.encrypted.fallback.outgoing", "ConfigView.section.connection.encryption.encrypt.fallback_outgoing");
gridData = new GridData();
gridData.horizontalSpan = 2;
fallback_outgoing.setLayoutData(gridData);
BooleanParameter fallback_incoming = new BooleanParameter(gCrypto, "network.transport.encrypted.fallback.incoming", "ConfigView.section.connection.encryption.encrypt.fallback_incoming");
gridData = new GridData();
gridData.horizontalSpan = 2;
fallback_incoming.setLayoutData(gridData);
BooleanParameter use_crypto_port = new BooleanParameter(gCrypto, "network.transport.encrypted.use.crypto.port", "ConfigView.section.connection.encryption.use_crypto_port");
gridData = new GridData();
gridData.horizontalSpan = 2;
use_crypto_port.setLayoutData(gridData);
Control ap_controls[] = {
min_level.getControl(), lmin, lcryptofb, fallback_outgoing.getControl(), fallback_incoming.getControl()
};
org.gudy.azureus2.ui.swt.config.IAdditionalActionPerformer iap = new GenericActionPerformer(ap_controls) {
final BooleanParameter val$require;
final BooleanParameter val$fallback_incoming;
final BooleanParameter val$use_crypto_port;
final Control val$ap_controls[];
final ConfigSectionConnectionEncryption this$0;
public void performAction()
{
boolean required = require.isSelected();
boolean ucp_enabled = !fallback_incoming.isSelected() && required;
use_crypto_port.getControl().setEnabled(ucp_enabled);
for (int i = 0; i < ap_controls.length; i++)
ap_controls[i].setEnabled(required);
}
{
this$0 = ConfigSectionConnectionEncryption.this;
require = booleanparameter;
fallback_incoming = booleanparameter1;
use_crypto_port = booleanparameter2;
ap_controls = acontrol;
super(x0);
}
};
fallback_incoming.setAdditionalActionPerformer(iap);
require.setAdditionalActionPerformer(iap);
return cSection;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -