-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
274 additions
and
186 deletions.
There are no files selected for viewing
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,49 @@ | ||
// | ||
// PathTypeDefaults.swift | ||
// quick-symlink | ||
// | ||
// Created by Alexander A. Kropotin on 17/09/2021. | ||
// Copyright © 2021 Alexander A. Kropotin. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct QuickSymlinkDefaults<T> { | ||
var key: String | ||
var defaultValue: T | ||
} | ||
|
||
public extension QuickSymlinkDefaults { | ||
|
||
func get() -> T { | ||
guard let valueUntyped = UserDefaults.init(suiteName: "org.ololx.quick-symlink")?.object(forKey: self.key) else { | ||
return self.defaultValue; | ||
} | ||
|
||
guard let value = valueUntyped as? T else { | ||
return self.defaultValue; | ||
} | ||
|
||
return value; | ||
} | ||
|
||
func set(_ value: T) { | ||
UserDefaults.init(suiteName: "org.ololx.quick-symlink")?.set(value, forKey: self.key); | ||
} | ||
} | ||
|
||
public enum QuickSymlinkSettings { | ||
|
||
static var relativePath: Bool { | ||
get { | ||
return pathTypeStrategyDefaults.get(); | ||
|
||
} | ||
set { | ||
pathTypeStrategyDefaults.set(newValue); | ||
|
||
} | ||
} | ||
|
||
private static var pathTypeStrategyDefaults = QuickSymlinkDefaults(key: "relative-path-strategy", defaultValue: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Localizable.strings | ||
quick-symlink | ||
|
||
Created by Alexander A. Kropotin on 15/07/2021. | ||
Copyright © 2021 Alexander A. Kropotin. All rights reserved. | ||
*/ | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"SOFT_LINK_ACTIONS_EXTENTION_NAME" = "Действия с симлинками"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"SOFT_LINK_ACTIONS_EXTENTION_TOOL_TIP" = "Создать символьные ссылки для выбранных файлов и папок"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"HARD_LINK_ACTIONS_EXTENTION_NAME" = "Действия с псевдонимами"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"HARD_LINK_ACTIONS_EXTENTION_TOOL_TIP" = "Создать псевдонимы для выбранных файлов и папок"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"COPY_PATH_ACTION_NAME" = "Скопировать путь отсюда"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"PASTE_LINK_ACTION_NAME" = "Вставить ссылку сюда"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"REPLACE_WITH_LINK_ACTION_NAME" = "Переместить сюда и заменить ссылкой"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"CREATE_LINK_ACTION_NAME" = "Создать ссылку"; | ||
|
||
|
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,33 @@ | ||
/* | ||
Localizable.strings | ||
quick-symlink | ||
|
||
Created by Alexander A. Kropotin on 15/07/2021. | ||
Copyright © 2021 Alexander A. Kropotin. All rights reserved. | ||
*/ | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"SOFT_LINK_ACTIONS_EXTENTION_NAME" = "Действия с симлинками"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"SOFT_LINK_ACTIONS_EXTENTION_TOOL_TIP" = "Создать символьные ссылки для выбранных файлов и папок"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"HARD_LINK_ACTIONS_EXTENTION_NAME" = "Действия с псевдонимами"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"HARD_LINK_ACTIONS_EXTENTION_TOOL_TIP" = "Создать псевдонимы для выбранных файлов и папок"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"COPY_PATH_ACTION_NAME" = "Скопировать путь отсюда"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"PASTE_LINK_ACTION_NAME" = "Вставить ссылку сюда"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"REPLACE_WITH_LINK_ACTION_NAME" = "Переместить сюда и заменить ссылкой"; | ||
|
||
/* Class = "NSMenuItem"; */ | ||
"CREATE_LINK_ACTION_NAME" = "Создать ссылку"; | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.