From 04272f9b950479a6e0d48b8fb4464fe785a344ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 10 Nov 2022 08:56:38 +0100 Subject: [PATCH] Drag and drop in tag list can be disabled in settings (To prevent doing it accidentally) --- CHANGELOG.md | 2 +- .../jpexs/decompiler/flash/configuration/Configuration.java | 4 ++++ .../flash/gui/locales/AdvancedSettingsDialog.properties | 5 +++++ .../flash/gui/locales/AdvancedSettingsDialog_cs.properties | 4 ++++ .../jpexs/decompiler/flash/gui/taglistview/TagListTree.java | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dde75e0ca..ef6742c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. - Allowed copy/cut tags to clipboard across multiple SWFs - Keyboard shortcuts for tag clipboard operations - Hilight clipboard panel on copy/cut action for a few seconds -- Drag and drop to move/copy tags in the tag list view +- Drag and drop to move/copy tags in the tag list view (Can be disabled in settings) - Setting for enabling placing Define tags into DefineSprite - Icons for tags in replace character dialog - Move tag with dependencies diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 0113140a6..f819cff40 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -771,6 +771,10 @@ public final class Configuration { @ConfigurationDefaultBoolean(false) @ConfigurationCategory("ui") public static ConfigurationItem allowPlacingDefinesIntoSprites = null; + + @ConfigurationDefaultBoolean(true) + @ConfigurationCategory("ui") + public static ConfigurationItem allowDragAndDropInTagListTree = null; private enum OSId { WINDOWS, OSX, UNIX diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index 36c076d72..501952519 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -584,5 +584,10 @@ config.description.autoPlaySwfs = Automatically play SWF preview on SWF node sel config.name.expandFirstLevelOfTreeOnLoad = Expand first level of tree on SWF load config.description.expandFirstLevelOfTreeOnLoad = Automatically expands first level of nodes in the tree on SWF open. +# after 16.2.0 config.name.allowPlacingDefinesIntoSprites = Allow placing define tags into DefineSprite config.description.allowPlacingDefinesIntoSprites = Allows placing (moving/copying/dragging into) define type tags into DefineSprite. + +config.name.allowDragAndDropInTagListTree = Allow drag and drop in tag list view +config.description.allowDragAndDropInTagListTree = Allows moving / copying tags with drag and drop in the tree of tag list view. + diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties index 110d55019..8260c2ea4 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties @@ -571,5 +571,9 @@ config.description.autoPlaySwfs = Automaticicky p\u0159ehr\u00e1vat n\u00e1hled config.name.expandFirstLevelOfTreeOnLoad = Rozbalit prvn\u00ed \u00farove\u0148 stromu p\u0159i na\u010dten\u00ed SWF config.description.expandFirstLevelOfTreeOnLoad = Automaticky rozbal\u00ed prvn\u00ed \u00farove\u0148 polo\u017eek stromu p\u0159i otev\u0159en\u00ed SWF. +# after 16.2.0 config.name.allowPlacingDefinesIntoSprites = Povolit umis\u0165ov\u00e1n\u00ed defini\u010dn\u00edch tag\u016f do DefineSprite config.description.allowPlacingDefinesIntoSprites = Povol\u00ed umis\u0165ov\u00e1n\u00ed (p\u0159esun/kop\u00edrov\u00e1n\u00ed/ta\u017een\u00ed dovnit\u0159) defini\u010dn\u00edch tag\u016f do DefineSprite. + +config.name.allowDragAndDropInTagListTree = Povolit drag and drop v zobrazen\u00ed seznamu tag\u016f +config.description.allowDragAndDropInTagListTree = Povol\u00ed p\u0159esouv\u00e1n\u00ed / kop\u00edrov\u00e1n\u00ed tag\u016f pomoc\u00ed drag and drop v stromu zobrazen\u00ed seznamu tag\u016f. diff --git a/src/com/jpexs/decompiler/flash/gui/taglistview/TagListTree.java b/src/com/jpexs/decompiler/flash/gui/taglistview/TagListTree.java index a0643dc0a..3212644e2 100644 --- a/src/com/jpexs/decompiler/flash/gui/taglistview/TagListTree.java +++ b/src/com/jpexs/decompiler/flash/gui/taglistview/TagListTree.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.gui.taglistview; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.MainPanel; import com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTree; import static com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTree.getSelection; @@ -162,6 +163,10 @@ class TreeTransferHandler extends TransferHandler { protected Transferable createTransferable(JComponent c) { AbstractTagTree tree = (AbstractTagTree) c; dropLocation = null; + + if (!Configuration.allowDragAndDropInTagListTree.get()) { + return null; + } TreePath[] paths = tree.getSelectionPaths(); if (paths == null) { return null;