Image descriptions are configurable option (defaults to "on").

This commit is contained in:
4pr0n 2015-12-21 07:36:56 -08:00
parent 22cee44345
commit 0ba092813c
3 changed files with 16 additions and 2 deletions

View File

@ -5,6 +5,7 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6

View File

@ -88,7 +88,7 @@ public abstract class AbstractHTMLRipper extends AlbumRipper {
break;
}
}
if (hasDescriptionSupport()) {
if (hasDescriptionSupport() && Utils.getConfigBoolean("descriptions.save", false)) {
logger.debug("Fetching description(s) from " + doc.location());
List<String> textURLs = getDescriptionsFromPage(doc);
if (textURLs.size() > 0) {

View File

@ -136,6 +136,7 @@ public class MainWindow implements Runnable, RipStatusHandler {
private static JCheckBox configSaveURLsOnly;
private static JCheckBox configSaveAlbumTitles;
private static JCheckBox configClipboardAutorip;
private static JCheckBox configSaveDescriptions;
private static TrayIcon trayIcon;
private static MenuItem trayMenuMain;
@ -208,6 +209,7 @@ public class MainWindow implements Runnable, RipStatusHandler {
Utils.setConfigBoolean("urls_only.save", configSaveURLsOnly.isSelected());
Utils.setConfigBoolean("album_titles.save", configSaveAlbumTitles.isSelected());
Utils.setConfigBoolean("clipboard.autorip", configClipboardAutorip.isSelected());
Utils.setConfigBoolean("descriptions.save", configSaveDescriptions.isSelected());
saveHistory();
Utils.saveConfig();
}
@ -457,6 +459,9 @@ public class MainWindow implements Runnable, RipStatusHandler {
configClipboardAutorip = new JCheckBox("Autorip from Clipboard", Utils.getConfigBoolean("clipboard.autorip", false));
configClipboardAutorip.setHorizontalAlignment(JCheckBox.RIGHT);
configClipboardAutorip.setHorizontalTextPosition(JCheckBox.LEFT);
configSaveDescriptions = new JCheckBox("Save descriptions", Utils.getConfigBoolean("descriptions.save", true));
configSaveDescriptions.setHorizontalAlignment(JCheckBox.RIGHT);
configSaveDescriptions.setHorizontalTextPosition(JCheckBox.LEFT);
configSaveDirLabel = new JLabel();
try {
String workingDir = (Utils.shortenPath(Utils.getWorkingDirectory()));
@ -483,7 +488,8 @@ public class MainWindow implements Runnable, RipStatusHandler {
gbc.gridx = 1; configurationPanel.add(configSaveURLsOnly, gbc);
gbc.gridy = 8; gbc.gridx = 0; configurationPanel.add(configClipboardAutorip, gbc);
gbc.gridx = 1; configurationPanel.add(configSaveAlbumTitles, gbc);
gbc.gridy = 9; gbc.gridx = 0; configurationPanel.add(configSaveDirLabel, gbc);
gbc.gridy = 9; gbc.gridx = 0; configurationPanel.add(configSaveDescriptions, gbc);
gbc.gridy =10; gbc.gridx = 0; configurationPanel.add(configSaveDirLabel, gbc);
gbc.gridx = 1; configurationPanel.add(configSaveDirButton, gbc);
gbc.gridy = 0; pane.add(ripPanel, gbc);
@ -737,6 +743,13 @@ public class MainWindow implements Runnable, RipStatusHandler {
Utils.configureLogger();
}
});
configSaveDescriptions.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
Utils.setConfigBoolean("descriptions.save", configSaveDescriptions.isSelected());
Utils.configureLogger();
}
});
queueListModel.addListDataListener(new ListDataListener() {
@Override
public void intervalAdded(ListDataEvent arg0) {