diff --git a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 2020f6654..a00a96415 100644 --- a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -253,6 +253,15 @@ public class Configuration { @ConfigurationName("export.formats") public static final ConfigurationItem lastSelectedExportFormats = null; + @ConfigurationDefaultBoolean(true) + @ConfigurationName("warning.experimental.as12edit") + public static final ConfigurationItem warningExperimentalAS12Edit = null; + + @ConfigurationDefaultBoolean(true) + @ConfigurationName("warning.experimental.as3edit") + public static final ConfigurationItem warningExperimentalAS3Edit = null; + + private enum OSId { WINDOWS, OSX, UNIX diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/View.java b/trunk/src/com/jpexs/decompiler/flash/gui/View.java index 5263a7e37..c44c3702e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/View.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/View.java @@ -16,6 +16,10 @@ */ package com.jpexs.decompiler.flash.gui; +import com.jpexs.decompiler.flash.AppStrings; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.configuration.ConfigurationItem; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -43,11 +47,13 @@ import javax.swing.Action; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; +import javax.swing.JPanel; import javax.swing.JRootPane; import javax.swing.JTree; import javax.swing.KeyStroke; @@ -358,6 +364,31 @@ public class View { }); return ret[0]; } + + + public static int showConfirmDialog(final Component parentComponent, String message, final String title, final int optionType, final int messageTyp, ConfigurationItem showAgainConfig, int defaultOption) { + + JLabel warLabel = new JLabel(message); + final JPanel warPanel = new JPanel(new BorderLayout()); + warPanel.add(warLabel,BorderLayout.CENTER); + JCheckBox donotShowAgainCheckBox = new JCheckBox(AppStrings.translate("message.confirm.donotshowagain")); + donotShowAgainCheckBox.setSelected(!showAgainConfig.get()); + warPanel.add(donotShowAgainCheckBox,BorderLayout.SOUTH); + + if(donotShowAgainCheckBox.isSelected()){ + return defaultOption; + } + + final int ret[] = new int[1]; + execInEventDispatch(new Runnable() { + @Override + public void run() { + ret[0] = JOptionPane.showConfirmDialog(parentComponent, warPanel, title, optionType, messageTyp); + } + }); + showAgainConfig.set(!donotShowAgainCheckBox.isSelected()); + return ret[0]; + } public static void showMessageDialog(final Component parentComponent, final Object message, final String title, final int messageType) { execInEventDispatch(new Runnable() { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index d2539d71a..1b761d68f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -87,6 +87,7 @@ import java.util.logging.Logger; import java.util.regex.Pattern; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JOptionPane; @@ -653,13 +654,13 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se do{ ret = View.showConfirmDialog(this, AppStrings.translate("message.action.playerglobal.place").replace("%libpath%", Configuration.getFlashLibPath().getAbsolutePath()),AppStrings.translate("message.action.playerglobal.title"),JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); swc = Configuration.getPlayerSWC(); - }while(ret == JOptionPane.OK_OPTION && swc == null); - if(ret == JOptionPane.OK_OPTION){ - setDecompiledEditMode(true); - } + }while(ret == JOptionPane.OK_OPTION && swc == null); } - }else{ - setDecompiledEditMode(true); + } + if(swc!=null){ + if(View.showConfirmDialog(null, AppStrings.translate("message.confirm.experimental.function"), AppStrings.translate("message.warning"), JOptionPane.OK_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE,Configuration.warningExperimentalAS3Edit,JOptionPane.OK_OPTION)==JOptionPane.OK_OPTION){ + setDecompiledEditMode(true); + } } break; case ACTION_CANCEL_DECOMPILED: diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index a00b7ae07..fe4367a1f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -743,7 +743,9 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene } break; case ACTION_EDIT_DECOMPILED: - setDecompiledEditMode(true); + if(View.showConfirmDialog(null, AppStrings.translate("message.confirm.experimental.function"), AppStrings.translate("message.warning"), JOptionPane.OK_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE,Configuration.warningExperimentalAS12Edit,JOptionPane.OK_OPTION)==JOptionPane.OK_OPTION){ + setDecompiledEditMode(true); + } break; case ACTION_CANCEL_DECOMPILED: setDecompiledEditMode(false); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index f8906ade4..61efff732 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -468,3 +468,6 @@ button.next = Next message.action.playerglobal.title = PlayerGlobal library needed message.action.playerglobal.needed = For ActionScript 3 direct editation, a library called "PlayerGlobal.swc" needs to be downloaded from Adobe homepage.\r\n%adobehomepage%\r\nPress OK to go to the download page. message.action.playerglobal.place = Download the library called PlayerGlobal(.swc), and place it to directory\r\n%libpath%\r\n Press OK to continue. + +message.confirm.experimental.function = This function is EXPERIMENTAL. It means that you should not trust the results and the SWF file can be disfunctional after saving. +message.confirm.donotshowagain = Do not show again diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index dd5367cd1..43605982a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -463,4 +463,7 @@ error.sound.invalid = Neplatn\u00fd zvuk. message.action.playerglobal.title = Vy\u017eadov\u00e1na knihovna PlayerGlobal message.action.playerglobal.needed = Pro p\u0159\u00edmou editaci ActionScriptu 3 je pot\u0159eba knihovna "PlayerGlobal.swc", kterou lze stahnout ze str\u00e1nek Adobe\r\n%adobehomepage%\r\nStiskn\u011bte OK pro p\u0159echod na stahovac\u00ed str\u00e1nku. -message.action.playerglobal.place = St\u00e1hn\u011bte knihovnu nazvanou PlayerGlobal(.swc), a um\u00edst\u011bte j\u00ed do adres\u00e1\u0159e\r\n%libpath%\r\n Stiskn\u011bte OK pro pokra\u010dov\u00e1n\u00ed. \ No newline at end of file +message.action.playerglobal.place = St\u00e1hn\u011bte knihovnu nazvanou PlayerGlobal(.swc), a um\u00edst\u011bte j\u00ed do adres\u00e1\u0159e\r\n%libpath%\r\n Stiskn\u011bte OK pro pokra\u010dov\u00e1n\u00ed. + +message.confirm.experimental.function = Tato funkce je EXPERIMENT\u00c1LN\u00cd. To znamen\u00e1, \u017ee byste nem\u011bli v\u011b\u0159it jej\u00edm v\u00fdsledk\u016fm a SWF soubor m\u016f\u017ee po ulo\u017een\u00ed p\u0159estat fungovat. +message.confirm.donotshowagain = P\u0159\u00ed\u0161t\u011b nezobrazovat \ No newline at end of file