-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tauri 不支持关联文件
- Loading branch information
wangxianqiao
committed
Jul 2, 2022
1 parent
5e74e2d
commit 03dbdb2
Showing
15 changed files
with
459 additions
and
200 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDocumentTypes</key> | ||
<array> | ||
<dict> | ||
<key>CFBundleTypeRole</key> | ||
<string>Editor</string> | ||
<key>LSItemContentTypes</key> | ||
<array> | ||
<string>public.nes</string> | ||
</array> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ | |
"title": "NESBox", | ||
"width": 1024, | ||
"height": 640, | ||
"fileDropEnabled": false, | ||
"visible": true | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
{ | ||
"width": 1024, | ||
"height": 640, | ||
"fileDropEnabled": false, | ||
"visible": false | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { history } from '@mantou/gem'; | ||
import { createPath } from 'duoyun-ui/elements/route'; | ||
|
||
import { setNesFile } from 'src/configure'; | ||
import { routes } from 'src/routes'; | ||
import { matchRoute } from 'src/utils'; | ||
|
||
window.launchQueue?.setConsumer(async (launchParams: any) => { | ||
if (!launchParams.files.length) return; | ||
|
||
// https://github.com/WICG/file-system-access/blob/master/EXPLAINER.md#example-code | ||
const files = await Promise.all(launchParams.files.map((h: any) => h.getFile())); | ||
dropHandler(files); | ||
}); | ||
|
||
export const dropHandler = (files: File[]) => { | ||
if (!matchRoute(routes.emulator)) { | ||
history.push({ path: createPath(routes.emulator) }); | ||
} | ||
setNesFile(files.find((e) => e.name.toLowerCase().endsWith('.nes'))); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.