Mercurial > cgi-bin > hgweb.cgi > ClipMan
changeset 30:0e88c6bed11e
Remove the troublesome delete command(s).
author | David Barts <n5jrn@me.com> |
---|---|
date | Wed, 29 Jan 2020 21:56:12 -0800 |
parents | c4f53bc01732 |
children | 0c6c18a733b7 |
files | src/name/blackcap/clipman/Menus.kt src/name/blackcap/clipman/PasteboardQueue.kt |
diffstat | 2 files changed, 1 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- 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) - })) } }
--- 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)