diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 40bc865b9..eae205afb 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -373,6 +373,16 @@ public abstract class MainFrameMenu implements MenuBuilder { mainFrame.getPanel().importShape((SWF) openable, true); } + protected void importMoviesActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + if (mainFrame.getPanel().checkEdited()) { + return; + } + mainFrame.getPanel().importMovie((SWF) openable); + } + protected void importSymbolClassActionPerformed(ActionEvent evt) { if (Main.isWorking()) { return; @@ -1118,6 +1128,7 @@ public abstract class MainFrameMenu implements MenuBuilder { addMenuItem("/file/import/importOther/importImages", translate("menu.file.import.image"), "importimage32", this::importImagesActionPerformed, PRIORITY_MEDIUM, null, true, null, false); addMenuItem("/file/import/importOther/importShapes", translate("menu.file.import.shape"), "importshape32", this::importShapesActionPerformed, PRIORITY_MEDIUM, null, true, null, false); addMenuItem("/file/import/importOther/importShapesNoFill", translate("menu.file.import.shapeNoFill"), "importshape32", this::importShapesNoFillActionPerformed, PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/file/import/importOther/importMovies", translate("menu.file.import.movie"), "importmovie32", this::importMoviesActionPerformed, PRIORITY_MEDIUM, null, true, null, false); addMenuItem("/file/import/importOther/importSymbolClass", translate("menu.file.import.symbolClass"), "importsymbolclass32", this::importSymbolClassActionPerformed, PRIORITY_MEDIUM, null, true, null, false); finishMenu("/file/import/importOther"); finishMenu("/file/import"); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 1ec9f503e..d9867cc4c 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -3065,6 +3065,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } } + public void importMovie(final SWF swf) { + + } public void importShape(final SWF swf, boolean noFill) { ViewMessages.showMessageDialog(MainPanel.this, translate("message.info.importShapes2"), translate("message.info"), JOptionPane.INFORMATION_MESSAGE, Configuration.showImportShapeInfo); JFileChooser chooser = new JFileChooser(); diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/importmovie16.png b/src/com/jpexs/decompiler/flash/gui/graphics/importmovie16.png new file mode 100644 index 000000000..6617db51c Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/importmovie16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/importmovie32.png b/src/com/jpexs/decompiler/flash/gui/graphics/importmovie32.png new file mode 100644 index 000000000..4ee7feb4c Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/importmovie32.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 9314f90d4..2acd86a40 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -1089,4 +1089,6 @@ error.sound.rate = The input sound has unsupported sampling rate: %saplingRate%. with some sound editor before importing. filter.movies = Supported movie formats (%extensions%) -error.movie.invalid = Invalid movie. \ No newline at end of file +error.movie.invalid = Invalid movie. + +menu.file.import.movie = Import movies \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java index 9dec9f93b..2824d726c 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java @@ -169,6 +169,8 @@ public class TagTreeContextMenu extends JPopupMenu { private JMenuItem importShapesMenuItem; private JMenuItem importShapesNoFillMenuItem; + + private JMenuItem importMoviesMenuItem; private JMenuItem importSymbolClassMenuItem; @@ -409,6 +411,11 @@ public class TagTreeContextMenu extends JPopupMenu { importShapesNoFillMenuItem.addActionListener(this::importShapesNoFillActionPerformed); importShapesNoFillMenuItem.setIcon(View.getIcon("importshape16")); add(importShapesNoFillMenuItem); + + importMoviesMenuItem = new JMenuItem(mainPanel.translate("menu.file.import.movie")); + importMoviesMenuItem.addActionListener(this::importMoviesActionPerformed); + importMoviesMenuItem.setIcon(View.getIcon("importmovie16")); + add(importMoviesMenuItem); importSymbolClassMenuItem = new JMenuItem(mainPanel.translate("menu.file.import.symbolClass")); importSymbolClassMenuItem.addActionListener(this::importSymbolClassActionPerformed); @@ -3256,6 +3263,11 @@ public class TagTreeContextMenu extends JPopupMenu { SWF swf = (SWF) getCurrentItem().getOpenable(); mainPanel.importShape(swf, true); } + + public void importMoviesActionPerformed(ActionEvent evt) { + SWF swf = (SWF) getCurrentItem().getOpenable(); + mainPanel.importMovie(swf); + } public void importSymbolClassActionPerformed(ActionEvent evt) { SWF swf = (SWF) getCurrentItem().getOpenable();