# HG changeset patch # User David Barts # Date 1580363772 28800 # Node ID 0e88c6bed11eed8907748b7f839c8db8a67d5318 # Parent c4f53bc017324fcc0108f9a6899e4b324995654b Remove the troublesome delete command(s). diff -r c4f53bc01732 -r 0e88c6bed11e src/name/blackcap/clipman/Menus.kt --- a/src/name/blackcap/clipman/Menus.kt Wed Jan 29 14:36:16 2020 -0800 +++ b/src/name/blackcap/clipman/Menus.kt Wed Jan 29 21:56:12 2020 -0800 @@ -17,12 +17,8 @@ override fun actionPerformed(e: ActionEvent) { when (e.actionCommand) { "File.Quit" -> System.exit(0) - "Edit.Clone" -> onlyIfSelected { queue.v.add(it) } + "Edit.Clone" -> onlyIfSelected { PasteboardItem.write(it.contents) } "Edit.Coerce" -> onlyIfSelected { doCoerceFonts(it) } - "Edit.Delete" -> onlyIfSelected { - queue.v.delete(it) - SelectionRequired.disable() - } "Edit.Find" -> searchDialog.setVisible(true) "Edit.FindAgain" -> searchDialog.find() else -> throw RuntimeException("unexpected actionCommand!") @@ -76,12 +72,6 @@ addActionListener(menuItemListener) makeShortcut(KeyEvent.VK_K) })) - add(SelectionRequired.add(JMenuItem("Delete").apply { - setEnabled(false) - actionCommand = "Edit.Delete" - addActionListener(menuItemListener) - setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)) - })) add(JMenuItem("Find…").apply { actionCommand = "Edit.Find" addActionListener(menuItemListener) @@ -130,10 +120,6 @@ actionCommand = "Edit.Coerce" addActionListener(menuItemListener) })) - add(SelectionRequired.add(JMenuItem("Delete").apply { - actionCommand = "Edit.Delete" - addActionListener(menuItemListener) - })) } } diff -r c4f53bc01732 -r 0e88c6bed11e src/name/blackcap/clipman/PasteboardQueue.kt --- a/src/name/blackcap/clipman/PasteboardQueue.kt Wed Jan 29 14:36:16 2020 -0800 +++ b/src/name/blackcap/clipman/PasteboardQueue.kt Wed Jan 29 21:56:12 2020 -0800 @@ -67,16 +67,6 @@ } /** - * Delete something from the queue. - * @param object to delete - */ - @Synchronized fun delete(item: QueueItem) { - if (queue.remove(item)) { - parent.validate() - } - } - - /** * Find and highlight the next occurrence of the specified string * @param string to search * @param whether to search backwards (default forwards)