From bc2fcadedc26675daf601e6fa0481a7d3c416c32 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 19 Jan 2013 06:50:48 +0000 Subject: [PATCH] + Clear cache via Ctrl+Shift+Delete --- .../net/sourceforge/filebot/ui/MainFrame.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/net/sourceforge/filebot/ui/MainFrame.java b/source/net/sourceforge/filebot/ui/MainFrame.java index a3bfca02..622f279d 100644 --- a/source/net/sourceforge/filebot/ui/MainFrame.java +++ b/source/net/sourceforge/filebot/ui/MainFrame.java @@ -2,7 +2,11 @@ package net.sourceforge.filebot.ui; +import static java.awt.event.InputEvent.*; +import static java.awt.event.KeyEvent.*; +import static javax.swing.KeyStroke.*; import static javax.swing.ScrollPaneConstants.*; +import static net.sourceforge.filebot.ui.NotificationLogging.*; import java.awt.Color; import java.awt.FlowLayout; @@ -12,9 +16,11 @@ import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; +import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JList; @@ -29,6 +35,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.miginfocom.swing.MigLayout; +import net.sf.ehcache.CacheManager; import net.sourceforge.filebot.Analytics; import net.sourceforge.filebot.ResourceManager; import net.sourceforge.filebot.Settings; @@ -98,6 +105,16 @@ public class MainFrame extends JFrame { }); setSize(860, 630); + + // KEYBOARD SHORTCUTS + TunedUtilities.installAction(this.getRootPane(), getKeyStroke(VK_DELETE, CTRL_MASK | SHIFT_MASK), new AbstractAction("Clear Cache") { + + @Override + public void actionPerformed(ActionEvent e) { + CacheManager.getInstance().clearAll(); + UILogger.info("Cache has been cleared"); + } + }); }