diff --git a/AutoLaunchHelper/pl.lproj/InfoPlist.strings b/AutoLaunchHelper/pl.lproj/InfoPlist.strings new file mode 100644 index 0000000..7141365 --- /dev/null +++ b/AutoLaunchHelper/pl.lproj/InfoPlist.strings @@ -0,0 +1,6 @@ +/* Bundle name */ +"CFBundleName" = "AutoLaunchHelper"; + +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Matthäus Szturc. Wszelkie Prawa zastrzeżone."; + diff --git a/AutoLaunchHelper/pl.lproj/Main.strings b/AutoLaunchHelper/pl.lproj/Main.strings new file mode 100644 index 0000000..250f3d8 --- /dev/null +++ b/AutoLaunchHelper/pl.lproj/Main.strings @@ -0,0 +1,3 @@ + +/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */ +"AYu-sK-qS6.title" = "Menu Główne"; diff --git a/Podfile.lock b/Podfile.lock index 030ec5f..2561a9c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,3 +1,3 @@ PODFILE CHECKSUM: da4267f11d20800810ec0687a2dda4242b0874c4 -COCOAPODS: 1.9.1 +COCOAPODS: 1.11.2 diff --git a/ThinkpadAssistant.xcodeproj/project.pbxproj b/ThinkpadAssistant.xcodeproj/project.pbxproj index 6b93847..87eabbe 100644 --- a/ThinkpadAssistant.xcodeproj/project.pbxproj +++ b/ThinkpadAssistant.xcodeproj/project.pbxproj @@ -51,6 +51,11 @@ /* Begin PBXFileReference section */ 1F4D64855DFDE6D7D5FD9F23 /* Pods-AutoLaunchHelper.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoLaunchHelper.debug.xcconfig"; path = "Target Support Files/Pods-AutoLaunchHelper/Pods-AutoLaunchHelper.debug.xcconfig"; sourceTree = ""; }; + 2E123FCC27691C4D00050176 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Main.strings; sourceTree = ""; }; + 2E123FCD27691C4D00050176 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Main.strings; sourceTree = ""; }; + 2E123FD027691D6400050176 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + 2E123FD127691F5400050176 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = ""; }; + 2E123FD227691FCB00050176 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = ""; }; A2D81A3D8A645E8C957C4863 /* Pods_ThinkpadAssistant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ThinkpadAssistant.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A7FFA5A32A931C74AFABA743 /* Pods-AutoLaunchHelper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoLaunchHelper.release.xcconfig"; path = "Target Support Files/Pods-AutoLaunchHelper/Pods-AutoLaunchHelper.release.xcconfig"; sourceTree = ""; }; AE92EEF7DF0DF77FC8C1D8CC /* Pods-ThinkpadAssistant.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThinkpadAssistant.release.xcconfig"; path = "Target Support Files/Pods-ThinkpadAssistant/Pods-ThinkpadAssistant.release.xcconfig"; sourceTree = ""; }; @@ -270,7 +275,6 @@ TargetAttributes = { FC56DEB91EE98AC7001ACE3F = { CreatedOnToolsVersion = 8.3.2; - DevelopmentTeam = 2Y3274NQLX; LastSwiftMigration = 1140; ProvisioningStyle = Automatic; SystemCapabilities = { @@ -281,7 +285,6 @@ }; FC56DECF1EE98B3A001ACE3F = { CreatedOnToolsVersion = 8.3.2; - DevelopmentTeam = 2Y3274NQLX; LastSwiftMigration = 1140; ProvisioningStyle = Automatic; SystemCapabilities = { @@ -303,6 +306,7 @@ "zh-Hans", it, cs, + pl, ); mainGroup = FC56DEB11EE98AC7001ACE3F; productRefGroup = FC56DEBB1EE98AC7001ACE3F /* Products */; @@ -428,6 +432,7 @@ C9B503772463269300673FFA /* zh-Hans */, F2567B322469343D007C3158 /* it */, F31BF22E24718B3900F40D56 /* cs */, + 2E123FD027691D6400050176 /* pl */, ); name = Localizable.strings; sourceTree = ""; @@ -439,6 +444,7 @@ C9B503762463269300673FFA /* zh-Hans */, F2567B312469343D007C3158 /* it */, F31BF22D24718B3900F40D56 /* cs */, + 2E123FD127691F5400050176 /* pl */, ); name = InfoPlist.strings; sourceTree = ""; @@ -450,6 +456,7 @@ C9B503782463269400673FFA /* zh-Hans */, F2567B332469343E007C3158 /* it */, F31BF22F24718B3900F40D56 /* cs */, + 2E123FD227691FCB00050176 /* pl */, ); name = InfoPlist.strings; sourceTree = ""; @@ -462,6 +469,7 @@ C9B503742463269300673FFA /* zh-Hans */, F2567B2F2469343D007C3158 /* it */, F31BF22B24718B3900F40D56 /* cs */, + 2E123FCC27691C4D00050176 /* pl */, ); name = Main.storyboard; sourceTree = ""; @@ -474,6 +482,7 @@ C9B503752463269300673FFA /* zh-Hans */, F2567B302469343D007C3158 /* it */, F31BF22C24718B3900F40D56 /* cs */, + 2E123FCD27691C4D00050176 /* pl */, ); name = Main.storyboard; sourceTree = ""; @@ -599,10 +608,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = ThinkpadAssistant/ThinkpadAssistant.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2Y3274NQLX; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = ThinkpadAssistant/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -628,10 +637,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = ThinkpadAssistant/ThinkpadAssistant.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2Y3274NQLX; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = ThinkpadAssistant/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -655,15 +664,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoLaunchHelper/AutoLaunchHelper.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 2Y3274NQLX; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = AutoLaunchHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = de.mszturc.AutoLaunchHelper; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -679,15 +689,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoLaunchHelper/AutoLaunchHelper.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 2Y3274NQLX; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = AutoLaunchHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = de.mszturc.AutoLaunchHelper; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/ThinkpadAssistant/AppDelegate.swift b/ThinkpadAssistant/AppDelegate.swift index 152956d..deb14c6 100644 --- a/ThinkpadAssistant/AppDelegate.swift +++ b/ThinkpadAssistant/AppDelegate.swift @@ -16,12 +16,32 @@ class AppDelegate: NSObject, NSApplicationDelegate { let helperBundleName = "de.mszturc.AutoLaunchHelper" @IBOutlet weak var statusBarMenu: NSMenu! - @IBOutlet weak var monitorCapslocksMenuItem: NSMenuItem! @IBOutlet weak var launchAtLoginMenuItem: NSMenuItem! func applicationDidFinishLaunching(_ aNotification: Notification) { - setupMenuBar() + func dialog(question: String, text: String) -> Bool { + let alert: NSAlert = NSAlert() + alert.messageText = question + alert.informativeText = text + alert.alertStyle = NSAlert.Style.warning + alert.addButton(withTitle: NSLocalizedString("No", comment: "")) + alert.addButton(withTitle: NSLocalizedString("Yes", comment: "")) + let ask = alert.runModal() + if ask == NSApplication.ModalResponse.alertFirstButtonReturn { + setupMenuBar() + return true + } + else { + let notification = NSUserNotification() + notification.title = "ThinkPad Assistant" + notification.subtitle = NSLocalizedString("RiB", comment: "") + notification.soundName = NSUserNotificationDefaultSoundName + NSUserNotificationCenter.default.deliver(notification) + return false + } + } + _ = dialog(question: "ThinkPad Assistant", text: NSLocalizedString("TrayQuestion", comment: "")) ShortcutManager.register() CapslockMonitor.register() } @@ -57,7 +77,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { statusItem.button?.image?.size = NSSize(width: 18, height: 18) statusItem.button?.alternateImage?.size = NSSize(width: 18, height: 18) - statusItem.menu = statusBarMenu + statusItem.menu = statusBarMenu let foundHelper = NSWorkspace.shared.runningApplications.contains { $0.bundleIdentifier == helperBundleName diff --git a/ThinkpadAssistant/Base.lproj/Main.storyboard b/ThinkpadAssistant/Base.lproj/Main.storyboard index 4920558..5aeaa64 100644 --- a/ThinkpadAssistant/Base.lproj/Main.storyboard +++ b/ThinkpadAssistant/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -79,7 +80,7 @@ - + @@ -101,7 +102,7 @@ - + @@ -118,6 +119,6 @@ - + diff --git a/ThinkpadAssistant/cs.lproj/Main.strings b/ThinkpadAssistant/cs.lproj/Main.strings index 7a5d30d..807be5d 100644 --- a/ThinkpadAssistant/cs.lproj/Main.strings +++ b/ThinkpadAssistant/cs.lproj/Main.strings @@ -22,3 +22,5 @@ /* Class = "NSWindow"; title = "About Thinkpad Assistant"; ObjectID = "eOf-uU-tUq"; */ "eOf-uU-tUq.title" = "O aplikaci Thinkpad Assistant"; + + diff --git a/ThinkpadAssistant/de.lproj/Main.strings b/ThinkpadAssistant/de.lproj/Main.strings index 2e72bdf..c97d029 100644 --- a/ThinkpadAssistant/de.lproj/Main.strings +++ b/ThinkpadAssistant/de.lproj/Main.strings @@ -21,4 +21,3 @@ /* Class = "NSTextFieldCell"; title = "Version 1.0.0"; ObjectID = "Yvs-Nm-uAg"; */ "Yvs-Nm-uAg.title" = "Version 1.0.0"; - diff --git a/ThinkpadAssistant/it.lproj/Main.strings b/ThinkpadAssistant/it.lproj/Main.strings index 9823d0e..27d92e5 100644 --- a/ThinkpadAssistant/it.lproj/Main.strings +++ b/ThinkpadAssistant/it.lproj/Main.strings @@ -21,3 +21,4 @@ /* Class = "NSTextFieldCell"; title = "Version 1.0.0"; ObjectID = "Yvs-Nm-uAg"; */ "Yvs-Nm-uAg.title" = "Versione 1.0.0"; + diff --git a/ThinkpadAssistant/pl.lproj/InfoPlist.strings b/ThinkpadAssistant/pl.lproj/InfoPlist.strings new file mode 100644 index 0000000..4d97aa0 --- /dev/null +++ b/ThinkpadAssistant/pl.lproj/InfoPlist.strings @@ -0,0 +1,7 @@ +/* Bundle name */ +"CFBundleName" = "ThinkpadAssistant"; + +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Matthäus Szturc. Wszelkie Prawa +zastrzeżone."; + diff --git a/ThinkpadAssistant/pl.lproj/Localizable.strings b/ThinkpadAssistant/pl.lproj/Localizable.strings new file mode 100644 index 0000000..1b53c74 --- /dev/null +++ b/ThinkpadAssistant/pl.lproj/Localizable.strings @@ -0,0 +1,74 @@ +/* No comment provided by engineer. */ +"Backlight\nbright" = "Podświetlenie
Jasne"; + +/* No comment provided by engineer. */ +"Backlight\ndimmed" = "Podświetlenie
Ciemne"; + +/* No comment provided by engineer. */ +"Backlight\noff" = "Podświetlenie
Wyłączone"; + +/* No comment provided by engineer. */ +"Bluetooth\ndisabled" = + "Bluetooth +Wyłączony"; + +/* No comment provided by engineer. */ +"Bluetooth\nenabled" = "Bluetooth +Włączony"; + +/* No comment provided by engineer. */ +"Capslock\ndisabled" = "Caps-Lock +Wyłączony"; + +/* No comment provided by engineer. */ +"Capslock\nenabled" = "Caps-Lock +Włączony"; + +/* No comment provided by engineer. */ +"Function\nKeys" = "Klawisze +Funkcyjne"; + +/* No comment provided by engineer. */ +"Media\nKeys" = "Klawisze +Multimedialne"; + +/* No comment provided by engineer. */ +"Microphone\nmuted" = +"Mikrofon +Wyciszony"; + +/* No comment provided by engineer. */ +"Microphone\nunmuted" = +"Mikrofon +Aktywny"; + +/* No comment provided by engineer. */ +"Screen\nextending" = "Rozszerzanie
Ekranu"; + +/* No comment provided by engineer. */ +"Screen\nmirroring" = "Klonowanie
Ekranu"; + +/* No comment provided by engineer. */ +"Version" = "Wersja"; + +/* No comment provided by engineer. */ +"Wi-Fi\ndisabled" = + "Wi-Fi +Wyłączone"; + +/* No comment provided by engineer. */ +"Wi-Fi\nenabled" = + "Wi-Fi +Włączone"; + +/* No comment provided by engineer. */ +"RiB" = "Asystent działa w tle."; + +/* No comment provided by engineer. */ +"TrayQuestion" = "Czy chcesz ukryć ikonę asystenta na pasku?"; + +/* No comment provided by engineer. */ +"No" = "Nie"; + +/* No comment provided by engineer. */ +"Yes" = "Tak"; diff --git a/ThinkpadAssistant/pl.lproj/Main.strings b/ThinkpadAssistant/pl.lproj/Main.strings new file mode 100644 index 0000000..2adcba8 --- /dev/null +++ b/ThinkpadAssistant/pl.lproj/Main.strings @@ -0,0 +1,24 @@ + +/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */ +"AYu-sK-qS6.title" = "Menu Główne"; + +/* Class = "NSTextFieldCell"; title = "Copyright © 2020 Matthäus Szturc. All rights reserved."; ObjectID = "Dsc-bK-vCJ"; */ +"Dsc-bK-vCJ.title" = "Copyright © 2020 Matthäus Szturc. Wszelkie Prawa zastrzeżone."; + +/* Class = "NSMenuItem"; title = "About Thinkpad Assistant"; ObjectID = "Kql-K9-yoI"; */ +"Kql-K9-yoI.title" = "O Thinkpad Assistant"; + +/* Class = "NSMenuItem"; title = "Launch on Login"; ObjectID = "Lcb-4h-zk2"; */ +"Lcb-4h-zk2.title" = "Uruchom przy starcie"; + +/* Class = "NSMenuItem"; title = "Monitor Capslock"; ObjectID = "Nth-Jo-BIN"; */ +"Nth-Jo-BIN.title" = "Pokaż Caps-Lock"; + +/* Class = "NSMenuItem"; title = "Quit"; ObjectID = "Q77-Nx-rEG"; */ +"Q77-Nx-rEG.title" = "Wyjdź"; + +/* Class = "NSTextFieldCell"; title = "Version 1.0.0"; ObjectID = "Yvs-Nm-uAg"; */ +"Yvs-Nm-uAg.title" = "Wersja 1.0.0"; + +/* Class = "NSWindow"; title = "About Thinkpad Assistant"; ObjectID = "eOf-uU-tUq"; */ +"eOf-uU-tUq.title" = "O Thinkpad Assistant"; diff --git a/ThinkpadAssistant/zh-Hans.lproj/Main.strings b/ThinkpadAssistant/zh-Hans.lproj/Main.strings index 7ecf887..a36f4cd 100644 --- a/ThinkpadAssistant/zh-Hans.lproj/Main.strings +++ b/ThinkpadAssistant/zh-Hans.lproj/Main.strings @@ -21,3 +21,4 @@ /* Class = "NSTextFieldCell"; title = "Version 1.0.0"; ObjectID = "Yvs-Nm-uAg"; */ "Yvs-Nm-uAg.title" = "版本 1.0.0"; +