From c6daa17f609a760109a039add804f8051413e4d3 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 28 Oct 2012 06:36:07 +0000 Subject: [PATCH] * make absolutely sure state is reset before building the new popup --- source/net/sourceforge/filebot/ui/rename/FormatDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/ui/rename/FormatDialog.java b/source/net/sourceforge/filebot/ui/rename/FormatDialog.java index 693be190..516b8f82 100644 --- a/source/net/sourceforge/filebot/ui/rename/FormatDialog.java +++ b/source/net/sourceforge/filebot/ui/rename/FormatDialog.java @@ -556,6 +556,9 @@ class FormatDialog extends JDialog { @Override public void popupMenuWillBecomeVisible(PopupMenuEvent evt) { + // make sure to reset state + popupMenuWillBecomeInvisible(evt); + JPopupMenu popup = (JPopupMenu) evt.getSource(); for (final String expression : mode.persistentFormatHistory()) { JMenuItem item = popup.add(new AbstractAction(expression) { @@ -580,7 +583,7 @@ class FormatDialog extends JDialog { @Override public void popupMenuCanceled(PopupMenuEvent evt) { - // ignore + popupMenuWillBecomeInvisible(evt); } }); return popup;