Skip to content

Commit

Permalink
[macOS] A couple of small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark committed Feb 28, 2024
1 parent 18973e3 commit 2a5803b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions macos/QMK Toolbox/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>fm.qmk.hex</string>
</array>
<key>LSTypeIsPackage</key>
<integer>0</integer>
<key>NSDocumentClass</key>
<string>NSDocument</string>
<string></string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
Expand All @@ -29,14 +31,16 @@
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.macbinary-archive</string>
</array>
<key>LSTypeIsPackage</key>
<integer>0</integer>
<key>NSDocumentClass</key>
<string>NSDocument</string>
<string></string>
</dict>
</array>
<key>CFBundleExecutable</key>
Expand Down
6 changes: 5 additions & 1 deletion macos/QMK Toolbox/MainViewController.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Cocoa
import UniformTypeIdentifiers

class MainViewController: NSViewController, USBListenerDelegate {
@IBOutlet var filepathBox: NSComboBox!
Expand Down Expand Up @@ -273,7 +274,10 @@ class MainViewController: NSViewController, USBListenerDelegate {
openPanel.canChooseDirectories = false
openPanel.allowsMultipleSelection = false
openPanel.message = "Select firmware to load"
openPanel.allowedFileTypes = ["bin", "hex"]
openPanel.allowedContentTypes = [
UTType(filenameExtension: "bin")!,
UTType(filenameExtension: "hex")!
]
openPanel.beginSheetModal(for: window) { response in
guard response == .OK, let file = openPanel.url else { return }
self.setFilePath(file)
Expand Down

0 comments on commit 2a5803b

Please sign in to comment.