diff --git a/source/net/filebot/ui/episodelist/EpisodeListPanel.java b/source/net/filebot/ui/episodelist/EpisodeListPanel.java index ff02cbd8..8d093ea0 100644 --- a/source/net/filebot/ui/episodelist/EpisodeListPanel.java +++ b/source/net/filebot/ui/episodelist/EpisodeListPanel.java @@ -1,9 +1,11 @@ package net.filebot.ui.episodelist; import static net.filebot.ui.episodelist.SeasonSpinnerModel.*; +import static net.filebot.util.ui.SwingUI.*; import static net.filebot.web.EpisodeUtilities.*; import java.awt.Dimension; +import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; @@ -21,10 +23,13 @@ import javax.swing.AbstractAction; import javax.swing.Icon; import javax.swing.JComboBox; import javax.swing.JComponent; +import javax.swing.JPopupMenu; import javax.swing.JSpinner; import javax.swing.KeyStroke; +import javax.swing.TransferHandler; import net.filebot.Language; +import net.filebot.ResourceManager; import net.filebot.Settings; import net.filebot.WebServices; import net.filebot.media.MediaDetection; @@ -37,11 +42,11 @@ import net.filebot.ui.SelectDialog; import net.filebot.ui.transfer.ArrayTransferable; import net.filebot.ui.transfer.ClipboardHandler; import net.filebot.ui.transfer.CompositeTranserable; +import net.filebot.ui.transfer.SaveAction; import net.filebot.util.StringUtilities; import net.filebot.util.ui.LabelProvider; import net.filebot.util.ui.SelectButton; import net.filebot.util.ui.SimpleLabelProvider; -import net.filebot.util.ui.SwingUI; import net.filebot.web.Episode; import net.filebot.web.EpisodeListProvider; import net.filebot.web.SearchResult; @@ -73,8 +78,8 @@ public class EpisodeListPanel extends AbstractSearchPanel { + getTransferHandler().getClipboardHandler().exportToClipboard(this, Toolkit.getDefaultToolkit().getSystemClipboard(), TransferHandler.COPY); + })); + popup.add(new SaveAction(getExportHandler())); + getListComponent().setComponentPopupMenu(popup); } } @@ -265,6 +278,10 @@ public class EpisodeListPanel extends AbstractSearchPanel) list.getListComponent().getSelectedValuesList()).stream().map(Episode.class::cast).toArray(Episode[]::new); + if (selection.length == 0) { + selection = list.getModel().stream().map(Episode.class::cast).toArray(Episode[]::new); + } + Transferable episodeArray = new ArrayTransferable(selection); Transferable stringSelection = new StringSelection(StringUtilities.join(selection, "\n"));