parent
998035d17f
commit
9df47d6466
@ -154,6 +154,7 @@ public class EightmusesRipper extends AbstractHTMLRipper {
|
||||
}
|
||||
|
||||
private String getFullSizeImage(String imageUrl) throws IOException {
|
||||
sendUpdate(STATUS.LOADING_RESOURCE, imageUrl);
|
||||
Document doc = new Http(imageUrl).get();
|
||||
return doc.select("#image").first().attr("src");
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -398,6 +399,14 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
||||
queueListScroll = new JScrollPane(queueList,
|
||||
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
|
||||
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
for (String item : Utils.getConfigList("queue")) {
|
||||
queueListModel.addElement(item);
|
||||
}
|
||||
if (queueListModel.size() > 0) {
|
||||
optionQueue.setText("Queue (" + queueListModel.size() + ")");
|
||||
} else {
|
||||
optionQueue.setText("Queue");
|
||||
}
|
||||
gbc.gridx = 0;
|
||||
JPanel queueListPanel = new JPanel(new GridBagLayout());
|
||||
queueListPanel.add(queueListScroll, gbc);
|
||||
@ -968,9 +977,14 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void ripNextAlbum() {
|
||||
isRipping = true;
|
||||
if (queueListModel.size() == 0) {
|
||||
|
||||
// Save current state of queue to configuration.
|
||||
Utils.setConfigList("queue", (Enumeration<Object>) queueListModel.elements());
|
||||
|
||||
if (queueListModel.isEmpty()) {
|
||||
// End of queue
|
||||
isRipping = false;
|
||||
return;
|
||||
@ -1057,7 +1071,7 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
||||
|
||||
class RipButtonHandler implements ActionListener {
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
if (!queueListModel.contains(ripTextfield.getText())) {
|
||||
if (!queueListModel.contains(ripTextfield.getText()) && !ripTextfield.getText().equals("")) {
|
||||
queueListModel.add(queueListModel.size(), ripTextfield.getText());
|
||||
ripTextfield.setText("");
|
||||
}
|
||||
|
@ -119,6 +119,14 @@ public class Utils {
|
||||
config.clearProperty(key);
|
||||
config.addProperty(key, list);
|
||||
}
|
||||
public static void setConfigList(String key, Enumeration<Object> enumeration) {
|
||||
config.clearProperty(key);
|
||||
List<Object> list = new ArrayList<Object>();
|
||||
while (enumeration.hasMoreElements()) {
|
||||
list.add(enumeration.nextElement());
|
||||
}
|
||||
config.addProperty(key, list);
|
||||
}
|
||||
|
||||
public static void saveConfig() {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user