Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ololx committed Oct 7, 2021
2 parents 1d9be79 + 5ed4dbe commit d0ca8a8
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
/* Class = "NSMenuItem"; */
"CREATE_LINK_ACTION_NAME" = "Create link";

/* Class = "NSMenuItem"; */
"PATH_STRATEGY_OPTION" = "Use relative path";
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

- Refactor application.

## [0.10.3] - 2021-10-07

### Added

- Add the checkbox item on the contextual menu of the `soft link extention` to switch on/off the relative path use to create a symbolic link.

## [0.10.2] - 2021-10-05

### Changed
Expand All @@ -20,7 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fix the localization bug - onlu russian localization in for all `system languages`.
- Fix the localization bug - only `Russian` localization in for all `system languages`.

## [0.10.0] - 2021-09-18

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Quick Symlink is a `Finder extension` which provides a `contextual menu item` for the symbolic links creation on macOS.

[![status](https://img.shields.io/badge/status-active-active?style=flat-square)](BADGES_GUIDE.md#status) [![version](https://img.shields.io/badge/version-0.10.2-informational?style=flat-square)](BADGES_GUIDE.md#version) [![oss lifecycle](https://img.shields.io/badge/oss_lifecycle-active-important?style=flat-square)](BADGES_GUIDE.md#oss-lifecycle) [![maintenance](https://img.shields.io/badge/maintenance-yes-informational?style=flat-square)](BADGES_GUIDE.md#maintenance) [![last release](https://img.shields.io/badge/last_release-October_05,_2021-informational?style=flat-square)](BADGES_GUIDE.md#release-date) [![last commit](https://img.shields.io/badge/last_commit-October_05,_2021-informational?style=flat-square)](BADGES_GUIDE.md#commit-date)
[![status](https://img.shields.io/badge/status-active-active?style=flat-square)](BADGES_GUIDE.md#status) [![version](https://img.shields.io/badge/version-0.10.3-informational?style=flat-square)](BADGES_GUIDE.md#version) [![oss lifecycle](https://img.shields.io/badge/oss_lifecycle-active-important?style=flat-square)](BADGES_GUIDE.md#oss-lifecycle) [![maintenance](https://img.shields.io/badge/maintenance-yes-informational?style=flat-square)](BADGES_GUIDE.md#maintenance) [![last release](https://img.shields.io/badge/last_release-October_05,_2021-informational?style=flat-square)](BADGES_GUIDE.md#release-date) [![last commit](https://img.shields.io/badge/last_commit-October_07,_2021-informational?style=flat-square)](BADGES_GUIDE.md#commit-date)

[![license](https://img.shields.io/badge/license-MIT-informational?style=flat-square)](LICENSE) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](CODE_OF_CONDUCT.md)

Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- [x] Add the new menu item for replacing selected folders and files with symlinks.
- [x] Add the new menu item for creating symlink in a parent directory (parent for target objects).
- [x] Use relative path instead absolute path in symlink target URL.
- [ ] Add setting - select the default path for links: relative or absolute
- [x] Add setting - select the default path for links: relative or absolute
- [ ] Refactor code in `commons/*` part and add unit-tests.
- [x] Develop additional `Finder extension` which allows to create a `hard links` for selected folders and files via contextual menu.
- [ ] Develop the action panel for created symbolic links and hard lonks (in the app window):
Expand Down
3 changes: 2 additions & 1 deletion en-GB.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
/* Class = "NSMenuItem"; */
"CREATE_LINK_ACTION_NAME" = "Create link";


/* Class = "NSMenuItem"; */
"PATH_STRATEGY_OPTION" = "Use relative path";
3 changes: 2 additions & 1 deletion en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
/* Class = "NSMenuItem"; */
"CREATE_LINK_ACTION_NAME" = "Create link";


/* Class = "NSMenuItem"; */
"PATH_STRATEGY_OPTION" = "Use relative path";
7 changes: 5 additions & 2 deletions hard-link-actions-extension/FinderSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ class FinderSync: FIFinderSync {
keyEquivalent: ""
);

/*let separator = NSMenuItem.separator();
separator.image = quickSymlinkToolbarItemImage;
quickSymlinkMenu.addItem(separator);*/

quickSymlinkMenu.addItem(
withTitle: NSLocalizedString("COPY_PATH_ACTION_NAME", comment: ""),
action: #selector(copyPathToClipboard(_:)),
Expand All @@ -101,13 +105,12 @@ class FinderSync: FIFinderSync {
} else {
let quickSymLinkMainMenu = NSMenu(title: "");
let quickSymlinkMenuItem = NSMenuItem(
title: NSLocalizedString("HARD_LINK_ACTIONS_EXTENTION_NAME", comment: ""),
title: NSLocalizedString("" + "HARD_LINK_ACTIONS_EXTENTION_NAME", comment: ""),
action: nil,
keyEquivalent: ""
);
quickSymLinkMainMenu.setSubmenu(quickSymlinkMenu, for: quickSymlinkMenuItem);
quickSymLinkMainMenu.addItem(quickSymlinkMenuItem);

return quickSymLinkMainMenu;
}
}
Expand Down
2 changes: 1 addition & 1 deletion quick-symlink.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
A30B9AB3265CA63300ACAA63 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A30B9AB4265CA63300ACAA63 /* quick_symlink.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = quick_symlink.entitlements; sourceTree = "<group>"; };
A30B9ABE265CA68900ACAA63 /* soft-link-actions-extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "soft-link-actions-extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
A30B9AC0265CA68900ACAA63 /* FinderSync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinderSync.swift; sourceTree = "<group>"; };
A30B9AC0265CA68900ACAA63 /* FinderSync.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = FinderSync.swift; sourceTree = "<group>"; tabWidth = 4; wrapsLines = 0; };
A30B9AC2265CA68900ACAA63 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A30B9ACB265CA78600ACAA63 /* soft-link-actions-extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "soft-link-actions-extension.entitlements"; sourceTree = "<group>"; };
A316477626B7B403001DD969 /* CreateLinkAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateLinkAction.swift; sourceTree = "<group>"; };
Expand Down
2 changes: 1 addition & 1 deletion quick-symlink/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.10.2</string>
<string>0.10.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
Expand Down
3 changes: 2 additions & 1 deletion quick-symlink/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class ViewController: NSViewController {
case .off:
quickSymlinkDefaults.set(false);
break;
default: break;
default:
break;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
/* Class = "NSMenuItem"; */
"CREATE_LINK_ACTION_NAME" = "Создать ссылку";

/* Class = "NSMenuItem"; */
"PATH_STRATEGY_OPTION" = "Использовать относительный путь";
28 changes: 27 additions & 1 deletion soft-link-actions-extension/FinderSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import FinderSync
class FinderSync: FIFinderSync {

let quickSymlinkToolbarItemImage = NSImage(named:NSImage.Name(rawValue: "quick-symlink-toolbar-item-image"));
var quickSymlinkDefaults: QuickSymlinkDefaults! = QuickSymlinkDefaults(key: "relative-path-strategy", defaultValue: true);

let copyPathAction = CopyPathAction.init();
let pasteLinkAction = PasteLinkAction.init(fileLinkManager: SoftLinkManager.init());
Expand Down Expand Up @@ -43,7 +44,6 @@ class FinderSync: FIFinderSync {
}

// 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.
Expand Down Expand Up @@ -104,6 +104,17 @@ class FinderSync: FIFinderSync {
replaceFileWithSymlinkFromClipboardMenuItem.isEnabled = false;
}

quickSymlinkMenu.addItem(NSMenuItem.separator());
let pathStrategyItem = NSMenuItem.init(
title: NSLocalizedString("PATH_STRATEGY_OPTION", comment: ""),
action: #selector(onPathStrategyChange(_:)),
keyEquivalent: ""
);
pathStrategyItem.target = self;
pathStrategyItem.state = quickSymlinkDefaults.get() ? .on : .off;

quickSymlinkMenu.addItem(pathStrategyItem);

if menuKind.rawValue == 3 {
return quickSymlinkMenu;
} else {
Expand Down Expand Up @@ -135,4 +146,19 @@ class FinderSync: FIFinderSync {
@IBAction func createSymlink(_ sender: AnyObject?) {
self.createSymlink.execute();
}

@IBAction func onPathStrategyChange(_ sender: NSMenuItem!) {
sender.state = sender.state == .on ? .off : .on;

switch sender.state {
case .on:
self.quickSymlinkDefaults.set(true);
break;
case .off:
self.quickSymlinkDefaults.set(false);
break;
default:
break;
}
}
}

0 comments on commit d0ca8a8

Please sign in to comment.