Mercurial > cgi-bin > hgweb.cgi > ImagePrep
annotate src/name/blackcap/imageprep/Osdep.kt.mac.osdep @ 25:a495f9ea498b mac-open
Initial attempts to make it respond to MacOS open message (not working).
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 13 Dec 2020 10:29:08 -0800 |
parents | 5fa5d15b4a7b |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * OS-dependent code, Mac version. | |
3 */ | |
1 | 4 package name.blackcap.imageprep |
0 | 5 |
6 import com.apple.eawt.AboutHandler | |
25
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
7 import com.apple.eawt.OpenFilesHandler |
0 | 8 import com.apple.eawt.PreferencesHandler |
9 import com.apple.eawt.QuitStrategy | |
25
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
10 import java.util.logging.Level |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
11 import java.util.logging.Logger |
0 | 12 |
13 fun setMacMenus() { | |
14 com.apple.eawt.Application.getApplication().run { | |
15 setAboutHandler(AboutHandler { showAboutDialog() }) | |
25
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
16 setOpenFileHandler(OpenFilesHandler { |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
17 LOGGER.log(Level.INFO, "got open request") |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
18 for (file in it.files) { |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
19 LOGGER.log(Level.INFO, "opening: ${file.toString()}") |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
20 RotateDialog.makeDialog(file, Application.settingsDialog.maxDimension) |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
21 } |
a495f9ea498b
Initial attempts to make it respond to MacOS open message (not working).
David Barts <n5jrn@me.com>
parents:
19
diff
changeset
|
22 }) |
19
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
1
diff
changeset
|
23 setPreferencesHandler( |
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
1
diff
changeset
|
24 PreferencesHandler { Application.settingsDialog.setVisible(true) }) |
0 | 25 setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS) |
26 } | |
27 } |