# HG changeset patch # User David Barts # Date 1607884148 28800 # Node ID a495f9ea498ba282a2f278608536bb5920b03457 # Parent a4737a525af8813449dc90d2bcc5c5d2b6776f4a Initial attempts to make it respond to MacOS open message (not working). diff -r a4737a525af8 -r a495f9ea498b package-files/osx/Info.plist --- a/package-files/osx/Info.plist Wed Nov 25 08:40:45 2020 -0800 +++ b/package-files/osx/Info.plist Sun Dec 13 10:29:08 2020 -0800 @@ -7,6 +7,34 @@ English CFBundleDisplayName @app.name@ + CFBundleDocumentTypes + + + CFBundleTypeName + @app.name@ Document + CFBundleTypeRole + Editor + LSItemContentTypes + + com.compuserve.gif + com.microsoft.bmp + public.jpeg + public.png + + CFBundleTypeExtensions + + * + + CFBundleTypeOSTypes + + GIFf + BMPf + JPEG + PNGf + **** + + + CFBundleExecutable JavaApplicationStub CFBundleIconFile diff -r a4737a525af8 -r a495f9ea498b src/name/blackcap/imageprep/Osdep.kt.mac.osdep --- a/src/name/blackcap/imageprep/Osdep.kt.mac.osdep Wed Nov 25 08:40:45 2020 -0800 +++ b/src/name/blackcap/imageprep/Osdep.kt.mac.osdep Sun Dec 13 10:29:08 2020 -0800 @@ -4,12 +4,22 @@ package name.blackcap.imageprep import com.apple.eawt.AboutHandler +import com.apple.eawt.OpenFilesHandler import com.apple.eawt.PreferencesHandler import com.apple.eawt.QuitStrategy +import java.util.logging.Level +import java.util.logging.Logger fun setMacMenus() { com.apple.eawt.Application.getApplication().run { setAboutHandler(AboutHandler { showAboutDialog() }) + setOpenFileHandler(OpenFilesHandler { + LOGGER.log(Level.INFO, "got open request") + for (file in it.files) { + LOGGER.log(Level.INFO, "opening: ${file.toString()}") + RotateDialog.makeDialog(file, Application.settingsDialog.maxDimension) + } + }) setPreferencesHandler( PreferencesHandler { Application.settingsDialog.setVisible(true) }) setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS)