changeset 39:2a5808156f99

Remove more deadwood, add non-Mac About dialog.
author David Barts <n5jrn@me.com>
date Fri, 31 Jan 2020 00:06:59 -0800
parents 08eaae2aaf76
children c803a2c89ea0
files src/name/blackcap/clipman/Menus.kt src/name/blackcap/clipman/Pasteboard.kt
diffstat 2 files changed, 5 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/name/blackcap/clipman/Menus.kt	Thu Jan 30 22:06:37 2020 -0800
+++ b/src/name/blackcap/clipman/Menus.kt	Fri Jan 31 00:06:59 2020 -0800
@@ -22,6 +22,11 @@
             "Edit.Coerce" -> onlyIfSelected { coerceDialog.setVisible(true) }
             "Edit.Find" -> searchDialog.setVisible(true)
             "Edit.FindAgain" -> searchDialog.find()
+            "Help.About" -> JOptionPane.showMessageDialog(frame.v,
+                "ClipMan, a clipboard manager.\n"
+                + "© MMXX, David W. Barts",
+                "About ClipMan",
+                JOptionPane.PLAIN_MESSAGE)
             else -> throw RuntimeException("unexpected actionCommand!")
         }
     }
@@ -37,19 +42,6 @@
             block(selected)
         }
     }
-
-    private fun clone(contents: PasteboardItem) {
-        val (plain, html) = when(contents) {
-            is PasteboardItem.Plain -> Pair(contents.plain, null)
-            is PasteboardItem.HTML -> Pair(contents.plain, contents.html)
-            is PasteboardItem.RTF -> Pair(contents.plain, contents.html)
-        }
-        if (html == null) {
-            PasteboardItem.write(PasteboardItem.Plain(plain))
-        } else {
-            PasteboardItem.write(PasteboardItem.HTML(plain, scrub(html)))
-        }
-    }
 }
 
 val menuItemListener = MenuItemListener()
--- a/src/name/blackcap/clipman/Pasteboard.kt	Thu Jan 30 22:06:37 2020 -0800
+++ b/src/name/blackcap/clipman/Pasteboard.kt	Fri Jan 31 00:06:59 2020 -0800
@@ -119,11 +119,6 @@
          * @return a PasteboardItem? object, null if nothing could be read
          */
         fun read() : PasteboardItem? {
-            /* println("-- BEGIN FLAVORS --")
-            CLIPBOARD.availableDataFlavors.forEach {
-                println(it.mimeType)
-            }
-            println("-- END FLAVORS --") */
             check()
             val plain = getClipboardData(DataFlavor.stringFlavor) as String?
             if (plain == null) {