Skip to content

Commit

Permalink
Relase 1.7.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarex committed Oct 4, 2024
1 parent a094d63 commit ad0d28d
Show file tree
Hide file tree
Showing 43 changed files with 1,111 additions and 480 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ Changelog
=======


### 1.7.3 (23)
New features:
- Information about macOS Sequoia.
- Ability to use any symbol as menu item image (use Apple SF Symbols app to see all available symbols).
- Dependencies updated:
- libarchive to 3.7.6
- ffmpeg to 7.0.2
- libwebp to 1.4.0
- libpng to 1.6.44
- lib turbo jpeg to 3.0.90
- lz4 to 1.10.0
- xz to 5.6.2
- zstd to 1.5.6

Bugfix:
- relinked libraries to work on macOS Sequoia (not tested in previous macOS!)


### 1.7.2 (22)
New features:
- New action to export info as json to clipboard.
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo Finder Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<string>$(PRODUCT_MODULE_NAME).FinderSync</string>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020-2023 sbarex. All rights reserved.</string>
<string>Copyright © 2020-2024 sbarex. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
Expand Down
122 changes: 79 additions & 43 deletions MediaInfo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo.xcodeproj/xcshareddata/xcschemes/ffmpeg.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo.xcodeproj/xcshareddata/xcschemes/libb2.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo.xcodeproj/xcshareddata/xcschemes/liblz4.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo.xcodeproj/xcshareddata/xcschemes/libpng.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 5 additions & 0 deletions MediaInfo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation {
}
return true
}


@IBAction func buyMeACoffee(_ sender: Any?) {
NSWorkspace.shared.open(URL(string: "https://www.buymeacoffee.com/sbarex")!)
}
}
164 changes: 90 additions & 74 deletions MediaInfo/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions MediaInfo/Base.lproj/MenuTableView.xib

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion MediaInfo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020-2023 Sbarex. All rights reserved.</string>
<string>Copyright © 2020-2024 Sbarex. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
Expand Down
3 changes: 3 additions & 0 deletions MediaInfo/MediaInfo-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "liblz4/include/lz4.h"

#include "ffmpeg/include/libavutil/ffversion.h"
#include "ffmpeg/include/libavutil/version.h"

#define FORMAT_AE_IFMT 0170000
#define FORMAT_AE_IFREG 0100000
Expand All @@ -28,4 +29,6 @@
#define FORMAT_AE_IFDIR 0040000
#define FORMAT_AE_IFIFO 0010000

#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100))

#endif /* MediaInfo_Bridging_Header_h */
96 changes: 79 additions & 17 deletions MediaInfo/MenuItemEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ class MenuItemEditor: NSViewController {
return !name.isEmpty && !Self.noImageNames.contains(name)
}
lazy var image: NSImage? = {
let img: NSImage?

guard !Self.noImageNames.contains(name) else {
let img: NSImage?
if self.name == "" {
img = NSImage(named: "square.dashed")?.resized(to: NSSize(width: 16, height: 16))
} else if self.name == "no-space" {
Expand All @@ -36,11 +37,20 @@ class MenuItemEditor: NSViewController {
return img
}

var name = self.name
if name == "bleed" || name == "artbox" || name == "pdf" {
name += "_v"
if name.starts(with: "!") {
if #available(macOS 11.0, *) {
img = NSImage.imageFromSymbol(name)
} else {
// Fallback on earlier versions
img = nil
}
} else {
var name = self.name
if name == "bleed" || name == "artbox" || name == "pdf" {
name += "_v"
}
img = NSImage(named: name)?.resized(to: NSSize(width: 16, height: 16))
}
let img = NSImage(named: name)?.resized(to: NSSize(width: 16, height: 16))
img?.isTemplate = !color
return img
}()
Expand Down Expand Up @@ -164,11 +174,13 @@ class MenuItemEditor: NSViewController {
if let image = images.first(where: { $0.isValid(for: name) }) {
return image
}

if #available(macOS 11.0, *) {
if let _ = NSImage(systemSymbolName: name, accessibilityDescription: nil) {
if let _ = NSImage.imageFromSymbol(name) {
return Image(name: name, title: name)
}
}

return nil
}

Expand Down Expand Up @@ -201,7 +213,20 @@ class MenuItemEditor: NSViewController {
}
internal var imageName: String = "" {
didSet {
self.imagePopupButton?.selectItem(at: Self.images.firstIndex(where: { $0.isValid(for: self.imageName) }) ?? 0)
guard let imagePopupButton = self.imagePopupButton else {
return
}
if imageName.hasPrefix("!"), let image = NSImage.imageFromSymbol(imageName) {
imagePopupButton.selectItem(withTag: 1)
imagePopupButton.selectedItem?.image = image
imagePopupButton.selectedItem?.toolTip = String(imageName.dropFirst())
} else {
if let mnu = imagePopupButton.lastItem, mnu.toolTip != nil {
mnu.toolTip = nil
mnu.image = NSImage(systemSymbolName: "ellipsis", accessibilityDescription: nil)
}
self.imagePopupButton?.selectItem(at: Self.images.firstIndex(where: { $0.isValid(for: self.imageName) }) ?? 0)
}
}
}

Expand All @@ -222,23 +247,54 @@ class MenuItemEditor: NSViewController {
imagePopupButton.menu?.addItem(item)
}
}
/*
if #available(macOS 11.0, *) {
imagePopupButton.menu?.addItem(NSMenuItem.separator())
let mnu = NSMenuItem(title: "Other…", action: nil, keyEquivalent: "")

mnu.image = NSImage(systemSymbolName: "ellipsis", accessibilityDescription: nil)
imagePopupButton.menu?.addItem(mnu)
imagePopupButton.menu?.addItem(NSMenuItem.separator())
let custom = NSMenuItem(title: NSLocalizedString("Other image…", comment: ""), action: nil, keyEquivalent: "")
custom.tag = 1
if #unavailable(macOS 11.0) {
custom.isEnabled = false
} else {
custom.image = NSImage(systemSymbolName: "ellipsis", accessibilityDescription: nil)
}
*/
imagePopupButton.menu?.addItem(custom)

let size = self.tableView(self.tableView, sizeToFitWidthOfColumn: 0)
tableView.tableColumns[0].width = size

tokenField.tokenizingCharacterSet = CharacterSet(charactersIn: "\t")

tokenField.objectValue = tokens

self.imagePopupButton?.selectItem(at: Self.images.firstIndex(where: { $0.isValid(for: self.imageName) }) ?? 0)
self.imageName = self.imageName + ""
}

@IBAction func handleImageButton(_ sender: NSPopUpButton) {
guard sender.selectedItem?.tag == 1, #available(macOS 11.0, *) else {
return
}

let msg = NSAlert()
msg.addButton(withTitle: "OK")
msg.addButton(withTitle: "Cancel").keyEquivalent = "\u{1b}"
msg.alertStyle = .informational
msg.messageText = ""
msg.informativeText = NSLocalizedString("Enter the symbol identifier to use as the menu item image:", comment: "")

let txt = NSTextField(frame: NSRect(x: 0, y: 0, width: 200, height: 24))
// txt.stringValue = defaultValue

msg.accessoryView = txt

msg.beginSheetModal(for: self.view.window!) { response in
guard response == .alertFirstButtonReturn, let image = NSImage(systemSymbolName: txt.stringValue, accessibilityDescription: nil) else {
sender.selectedItem?.image = NSImage(systemSymbolName: "ellipsis", accessibilityDescription: nil)
sender.selectedItem?.toolTip = nil

sender.selectItem(at: 0)
return
}
sender.selectedItem?.image = image
sender.selectedItem?.toolTip = txt.stringValue
}
}

@IBAction func handleCancel(_ sender: Any) {
Expand All @@ -257,7 +313,13 @@ class MenuItemEditor: NSViewController {
alert.runModal()
return
}
doneAction(Self.images[imagePopupButton.indexOfSelectedItem].name, tokens)
let image: Image?
if imagePopupButton.selectedTag() == 1 {
image = Self.getImage(named: "!" + (imagePopupButton.selectedItem!.toolTip ?? ""))
} else {
image = Self.images[imagePopupButton.indexOfSelectedItem]
}
doneAction(image?.name ?? "", tokens)
self.dismiss(self)
}

Expand Down
2 changes: 1 addition & 1 deletion MediaInfo/MenuTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class MenuTableView: NSView {

@IBAction func handleDisclosureButton(_ sender: Any) {
self.isTriggerHidden = !self.isTriggerHidden
hideTriggers(animated: true)
hideTriggers(animated: false)
}

@IBAction func handleTriggerEnable(_ sender: NSButton) {
Expand Down
2 changes: 1 addition & 1 deletion MediaInfo/NSMenuItem+ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import AppKit

extension NSMenuItem: Encodable {
extension NSMenuItem: @retroactive Encodable {
enum CodingKeys: String, CodingKey {
case title
case tag
Expand Down
Loading

0 comments on commit ad0d28d

Please sign in to comment.