📄 configsectionfiletorrents.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: ConfigSectionFileTorrents.java
package org.gudy.azureus2.ui.swt.views.configsections;
import com.aelitis.azureus.ui.swt.imageloader.ImageLoader;
import org.eclipse.swt.graphics.Image;
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.config.*;
import org.gudy.azureus2.ui.swt.plugins.UISWTConfigSection;
public class ConfigSectionFileTorrents
implements UISWTConfigSection
{
public ConfigSectionFileTorrents()
{
}
public String configSectionGetParentSection()
{
return "files";
}
public String configSectionGetName()
{
return "torrents";
}
public void configSectionSave()
{
}
public void configSectionDelete()
{
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.releaseImage("openFolderButton");
}
public int maxUserMode()
{
return 0;
}
public Composite configSectionCreate(final Composite parent)
{
ImageLoader imageLoader = ImageLoader.getInstance();
Image imgOpenFolder = imageLoader.getImage("openFolderButton");
Composite cTorrent = new Composite(parent, 0);
GridData gridData = new GridData(272);
cTorrent.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
cTorrent.setLayout(layout);
int userMode = COConfigurationManager.getIntParameter("User Mode");
BooleanParameter saveTorrents = new BooleanParameter(cTorrent, "Save Torrent Files", "ConfigView.label.savetorrents");
Composite gSaveTorrents = new Composite(cTorrent, 0);
gridData = new GridData(768);
gridData.horizontalIndent = 25;
gridData.horizontalSpan = 2;
gSaveTorrents.setLayoutData(gridData);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 3;
gSaveTorrents.setLayout(layout);
Label lSaveDir = new Label(gSaveTorrents, 0);
Messages.setLanguageText(lSaveDir, "ConfigView.label.savedirectory");
gridData = new GridData(768);
final StringParameter torrentPathParameter = new StringParameter(gSaveTorrents, "General_sDefaultTorrent_Directory");
torrentPathParameter.setLayoutData(gridData);
Button browse2 = new Button(gSaveTorrents, 8);
browse2.setImage(imgOpenFolder);
imgOpenFolder.setBackground(browse2.getBackground());
browse2.setToolTipText(MessageText.getString("ConfigView.button.browse"));
browse2.addListener(13, new Listener() {
final Composite val$parent;
final StringParameter val$torrentPathParameter;
final ConfigSectionFileTorrents this$0;
public void handleEvent(Event event)
{
DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), 0x10000);
dialog.setFilterPath(torrentPathParameter.getValue());
dialog.setText(MessageText.getString("ConfigView.dialog.choosedefaulttorrentpath"));
String path = dialog.open();
if (path != null)
torrentPathParameter.setValue(path);
}
{
this$0 = ConfigSectionFileTorrents.this;
parent = composite;
torrentPathParameter = stringparameter;
super();
}
});
browse2.setLayoutData(new GridData());
gridData = new GridData();
gridData.horizontalSpan = 2;
(new BooleanParameter(gSaveTorrents, "Save Torrent Backup", "ConfigView.label.savetorrentbackup")).setLayoutData(gridData);
Control controls[] = {
gSaveTorrents
};
org.gudy.azureus2.ui.swt.config.IAdditionalActionPerformer grayPathAndButton1 = new ChangeSelectionActionPerformer(controls);
saveTorrents.setAdditionalActionPerformer(grayPathAndButton1);
gridData = new GridData();
gridData.horizontalSpan = 2;
(new BooleanParameter(cTorrent, "Default Start Torrents Stopped", "ConfigView.label.defaultstarttorrentsstopped")).setLayoutData(gridData);
BooleanParameter watchFolder = new BooleanParameter(cTorrent, "Watch Torrent Folder", "ConfigView.label.watchtorrentfolder");
Composite gWatchFolder = new Composite(cTorrent, 0);
gridData = new GridData(768);
gridData.horizontalIndent = 25;
gridData.horizontalSpan = 2;
gWatchFolder.setLayoutData(gridData);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 3;
gWatchFolder.setLayout(layout);
Label lImportDir = new Label(gWatchFolder, 0);
Messages.setLanguageText(lImportDir, "ConfigView.label.importdirectory");
gridData = new GridData(768);
final StringParameter watchFolderPathParameter = new StringParameter(gWatchFolder, "Watch Torrent Folder Path", "");
watchFolderPathParameter.setLayoutData(gridData);
Button browse4 = new Button(gWatchFolder, 8);
browse4.setImage(imgOpenFolder);
imgOpenFolder.setBackground(browse4.getBackground());
browse4.setToolTipText(MessageText.getString("ConfigView.button.browse"));
browse4.addListener(13, new Listener() {
final Composite val$parent;
final StringParameter val$watchFolderPathParameter;
final ConfigSectionFileTorrents this$0;
public void handleEvent(Event event)
{
DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), 0x10000);
dialog.setFilterPath(watchFolderPathParameter.getValue());
dialog.setText(MessageText.getString("ConfigView.dialog.choosewatchtorrentfolderpath"));
String path = dialog.open();
if (path != null)
watchFolderPathParameter.setValue(path);
}
{
this$0 = ConfigSectionFileTorrents.this;
parent = composite;
watchFolderPathParameter = stringparameter;
super();
}
});
Label lWatchTorrentFolderInterval = new Label(gWatchFolder, 0);
Messages.setLanguageText(lWatchTorrentFolderInterval, "ConfigView.label.watchtorrentfolderinterval");
String min = (new StringBuilder()).append(" ").append(MessageText.getString("ConfigView.section.stats.minutes")).toString();
String hr = (new StringBuilder()).append(" ").append(MessageText.getString("ConfigView.section.stats.hours")).toString();
int watchTorrentFolderIntervalValues[] = {
1, 2, 3, 4, 5, 10, 15, 30, 60, 120,
240, 360, 480, 720, 960, 1200, 1440
};
String watchTorrentFolderIntervalLabels[] = new String[watchTorrentFolderIntervalValues.length];
for (int i = 0; i < watchTorrentFolderIntervalValues.length; i++)
{
int mins = watchTorrentFolderIntervalValues[i];
int hrs = mins / 60;
watchTorrentFolderIntervalLabels[i] = (new StringBuilder()).append(" ").append(hrs != 0 ? (new StringBuilder()).append(hrs).append(hr).toString() : (new StringBuilder()).append(mins).append(min).toString()).toString();
}
gridData = new GridData();
gridData.horizontalSpan = 2;
(new IntListParameter(gWatchFolder, "Watch Torrent Folder Interval", 1, watchTorrentFolderIntervalLabels, watchTorrentFolderIntervalValues)).setLayoutData(gridData);
gridData = new GridData();
gridData.horizontalSpan = 3;
(new BooleanParameter(gWatchFolder, "Start Watched Torrents Stopped", "ConfigView.label.startwatchedtorrentsstopped")).setLayoutData(gridData);
controls = (new Control[] {
gWatchFolder
});
watchFolder.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(controls));
return cTorrent;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -