This commit is contained in:
Alin
2024-09-20 15:15:53 -06:00
parent ef23d0a724
commit 8eeea2b9f8
19 changed files with 235 additions and 1214 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
+21
View File
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_32x32.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+5 -78
View File
@@ -27,8 +27,11 @@ class FinderOpen: FIFinderSync {
selectedItemURLs.count == 1, selectedItemURLs.first?.pathExtension == "app" {
// Add menu item if the selected item is a .app file
let menuItem = NSMenuItem(title: "Pearcleaner Uninstall", action: #selector(openInMyApp), keyEquivalent: "")
// menuItem.image = NSImage(named: NSImage.trashEmptyName)
// menu.addItem(withTitle: "Pearcleaner Uninstall", action: #selector(openInMyApp), keyEquivalent: "")
if let appIcon = NSImage(named: "Icon") {
menuItem.image = appIcon
} else {
menuItem.image = NSImage(named: NSImage.trashFullName)
}
menu.addItem(menuItem)
}
}
@@ -53,79 +56,3 @@ class FinderOpen: FIFinderSync {
}
//class FinderSync: FIFinderSync {
//
// var myFolderURL = URL(fileURLWithPath: "/Users/Shared/MySyncExtension Documents")
//
// override init() {
// super.init()
//
// NSLog("FinderSync() launched from %@", Bundle.main.bundlePath as NSString)
//
// // Set up the directory we are syncing.
// FIFinderSyncController.default().directoryURLs = [self.myFolderURL]
//
// // Set up images for our badge identifiers. For demonstration purposes, this uses off-the-shelf images.
// FIFinderSyncController.default().setBadgeImage(NSImage(named: NSImage.colorPanelName)!, label: "Status One" , forBadgeIdentifier: "One")
// FIFinderSyncController.default().setBadgeImage(NSImage(named: NSImage.cautionName)!, label: "Status Two", forBadgeIdentifier: "Two")
// }
//
// // MARK: - Primary Finder Sync protocol methods
//
// override func beginObservingDirectory(at url: URL) {
// // The user is now seeing the container's contents.
// // If they see it in more than one view at a time, we're only told once.
// NSLog("beginObservingDirectoryAtURL: %@", url.path as NSString)
// }
//
//
// override func endObservingDirectory(at url: URL) {
// // The user is no longer seeing the container's contents.
// NSLog("endObservingDirectoryAtURL: %@", url.path as NSString)
// }
//
// override func requestBadgeIdentifier(for url: URL) {
// NSLog("requestBadgeIdentifierForURL: %@", url.path as NSString)
//
// // For demonstration purposes, this picks one of our two badges, or no badge at all, based on the filename.
// let whichBadge = abs(url.path.hash) % 3
// let badgeIdentifier = ["", "One", "Two"][whichBadge]
// FIFinderSyncController.default().setBadgeIdentifier(badgeIdentifier, for: url)
// }
//
// // MARK: - Menu and toolbar item support
//
// override var toolbarItemName: String {
// return "FinderSy"
// }
//
// override var toolbarItemToolTip: String {
// return "FinderSy: Click the toolbar item for a menu."
// }
//
// override var toolbarItemImage: NSImage {
// return NSImage(named: NSImage.cautionName)!
// }
//
// override func menu(for menuKind: FIMenuKind) -> NSMenu {
// // Produce a menu for the extension.
// let menu = NSMenu(title: "")
// menu.addItem(withTitle: "Example Menu Item", action: #selector(sampleAction(_:)), keyEquivalent: "")
// return menu
// }
//
// @IBAction func sampleAction(_ sender: AnyObject?) {
// let target = FIFinderSyncController.default().targetedURL()
// let items = FIFinderSyncController.default().selectedItemURLs()
//
// let item = sender as! NSMenuItem
// NSLog("sampleAction: menu item: %@, target = %@, items = ", item.title as NSString, target!.path as NSString)
// for obj in items! {
// NSLog(" %@", obj.path as NSString)
// }
// }
//
//}