diff --git a/doc/xcode.md b/doc/xcode.md new file mode 100644 index 0000000..30e06f0 --- /dev/null +++ b/doc/xcode.md @@ -0,0 +1,13 @@ +# XCode tips and tricks + +## xcodebuild requires Xcode + +``` +xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance +``` + +fixed with + +``` +sudo xcode-select -s /Applications/Xcode.app/Contents/Developer +``` diff --git a/syncthing.xcodeproj/project.pbxproj b/syncthing.xcodeproj/project.pbxproj index 73fe1bc..ddc901b 100644 --- a/syncthing.xcodeproj/project.pbxproj +++ b/syncthing.xcodeproj/project.pbxproj @@ -26,10 +26,6 @@ C4460A801D0DD2D500200C21 /* STPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4460A7D1D0DD2D500200C21 /* STPreferencesWindowController.m */; }; C4460A811D0DD2D500200C21 /* STStatusBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4460A7F1D0DD2D500200C21 /* STStatusBarController.m */; }; C4460A831D0DD38F00200C21 /* STPreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4460A821D0DD38F00200C21 /* STPreferencesWindowController.xib */; }; - C4576BE41D11E43C0031BCFD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C4576BE31D11E43C0031BCFD /* main.m */; }; - C4576BE61D11E79F0031BCFD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4576BE51D11E79F0031BCFD /* Foundation.framework */; }; - C4576BEA1D11E7E10031BCFD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4576BE91D11E7E10031BCFD /* CoreFoundation.framework */; }; - C4576BEB1D11E9280031BCFD /* XGSyncthing.m in Sources */ = {isa = PBXBuildFile; fileRef = C4FFB0641D0D7E4C0015D14A /* XGSyncthing.m */; }; C47F6C3A1D0DE68D00F36CF6 /* syncthing.icns in Resources */ = {isa = PBXBuildFile; fileRef = C47F6C391D0DE68D00F36CF6 /* syncthing.icns */; }; C48B83B61DA444BC0052A172 /* STConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C48B83B51DA444BC0052A172 /* STConfiguration.m */; }; C4946B011D5877F2008447A2 /* STAboutWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4946B001D5877F2008447A2 /* STAboutWindowController.xib */; }; @@ -40,15 +36,9 @@ C4A4156D1D0D579D00DC6018 /* STApplication.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4A4156B1D0D579D00DC6018 /* STApplication.xib */; }; C4D36D801DA3D53F0061FD08 /* STPreferencesAdvancedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4D36D7E1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.m */; }; C4D36D811DA3D53F0061FD08 /* STPreferencesAdvancedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4D36D7F1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.xib */; }; - C4D36D851DA3E2820061FD08 /* STPreferencesDevicesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4D36D831DA3E2820061FD08 /* STPreferencesDevicesViewController.m */; }; - C4D36D861DA3E2820061FD08 /* STPreferencesDevicesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4D36D841DA3E2820061FD08 /* STPreferencesDevicesViewController.xib */; }; C4D567A21D3A8DFE002AD881 /* STLoginItem.m in Sources */ = {isa = PBXBuildFile; fileRef = C4D567A11D3A8DFE002AD881 /* STLoginItem.m */; }; C4F0E82E1DA1B9CF00435310 /* STPreferencesGeneralViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F0E82C1DA1B9CF00435310 /* STPreferencesGeneralViewController.m */; }; C4F0E82F1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4F0E82D1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib */; }; - C4F0E8331DA1C7A800435310 /* STPreferencesFoldersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F0E8311DA1C7A800435310 /* STPreferencesFoldersViewController.m */; }; - C4F0E8341DA1C7A800435310 /* STPreferencesFoldersViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4F0E8321DA1C7A800435310 /* STPreferencesFoldersViewController.xib */; }; - C4F0E8381DA1CB0900435310 /* STPreferencesInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F0E8361DA1CB0900435310 /* STPreferencesInfoViewController.m */; }; - C4F0E8391DA1CB0900435310 /* STPreferencesInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4F0E8371DA1CB0900435310 /* STPreferencesInfoViewController.xib */; }; C4FFB0661D0D7F870015D14A /* XGSyncthing.m in Sources */ = {isa = PBXBuildFile; fileRef = C4FFB0641D0D7E4C0015D14A /* XGSyncthing.m */; }; /* End PBXBuildFile section */ @@ -63,15 +53,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - C4576BD91D11E3BB0031BCFD /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; C462613D1D57944400B16BC6 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -97,9 +78,6 @@ C4460A7F1D0DD2D500200C21 /* STStatusBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STStatusBarController.m; path = Controllers/STStatusBarController.m; sourceTree = ""; }; C4460A821D0DD38F00200C21 /* STPreferencesWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = STPreferencesWindowController.xib; path = UI/STPreferencesWindowController.xib; sourceTree = ""; }; C4576BD51D11E3210031BCFD /* create-dmg.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "create-dmg.sh"; path = "syncthing/Scripts/create-dmg.sh"; sourceTree = ""; }; - C4576BDB1D11E3BB0031BCFD /* xgsyncthing */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xgsyncthing; sourceTree = BUILT_PRODUCTS_DIR; }; - C4576BDD1D11E3BB0031BCFD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - C4576BE31D11E43C0031BCFD /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = syncthing/Tests/main.m; sourceTree = ""; }; C4576BE51D11E79F0031BCFD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; C4576BE71D11E7C00031BCFD /* libobjc.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libobjc.tbd; path = usr/lib/libobjc.tbd; sourceTree = SDKROOT; }; C4576BE91D11E7E10031BCFD /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; @@ -119,9 +97,6 @@ C4D36D7D1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPreferencesAdvancedViewController.h; path = UI/STPreferencesWindow/STPreferencesAdvancedViewController.h; sourceTree = ""; }; C4D36D7E1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STPreferencesAdvancedViewController.m; path = UI/STPreferencesWindow/STPreferencesAdvancedViewController.m; sourceTree = ""; }; C4D36D7F1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = STPreferencesAdvancedViewController.xib; path = UI/STPreferencesWindow/STPreferencesAdvancedViewController.xib; sourceTree = ""; }; - C4D36D821DA3E2820061FD08 /* STPreferencesDevicesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPreferencesDevicesViewController.h; path = UI/STPreferencesWindow/STPreferencesDevicesViewController.h; sourceTree = ""; }; - C4D36D831DA3E2820061FD08 /* STPreferencesDevicesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STPreferencesDevicesViewController.m; path = UI/STPreferencesWindow/STPreferencesDevicesViewController.m; sourceTree = ""; }; - C4D36D841DA3E2820061FD08 /* STPreferencesDevicesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = STPreferencesDevicesViewController.xib; path = UI/STPreferencesWindow/STPreferencesDevicesViewController.xib; sourceTree = ""; }; C4D567A11D3A8DFE002AD881 /* STLoginItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STLoginItem.m; sourceTree = ""; }; C4D567A31D3A8E34002AD881 /* STLoginItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STLoginItem.h; sourceTree = ""; }; C4D6DD581D0D93D80024D20A /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; @@ -129,27 +104,12 @@ C4F0E82B1DA1B9CF00435310 /* STPreferencesGeneralViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPreferencesGeneralViewController.h; sourceTree = ""; }; C4F0E82C1DA1B9CF00435310 /* STPreferencesGeneralViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPreferencesGeneralViewController.m; sourceTree = ""; }; C4F0E82D1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = STPreferencesGeneralViewController.xib; sourceTree = ""; }; - C4F0E8301DA1C7A800435310 /* STPreferencesFoldersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPreferencesFoldersViewController.h; path = UI/STPreferencesWindow/STPreferencesFoldersViewController.h; sourceTree = ""; }; - C4F0E8311DA1C7A800435310 /* STPreferencesFoldersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STPreferencesFoldersViewController.m; path = UI/STPreferencesWindow/STPreferencesFoldersViewController.m; sourceTree = ""; }; - C4F0E8321DA1C7A800435310 /* STPreferencesFoldersViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = STPreferencesFoldersViewController.xib; path = UI/STPreferencesWindow/STPreferencesFoldersViewController.xib; sourceTree = ""; }; - C4F0E8351DA1CB0900435310 /* STPreferencesInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPreferencesInfoViewController.h; path = UI/STPreferencesWindow/STPreferencesInfoViewController.h; sourceTree = ""; }; - C4F0E8361DA1CB0900435310 /* STPreferencesInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STPreferencesInfoViewController.m; path = UI/STPreferencesWindow/STPreferencesInfoViewController.m; sourceTree = ""; }; - C4F0E8371DA1CB0900435310 /* STPreferencesInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = STPreferencesInfoViewController.xib; path = UI/STPreferencesWindow/STPreferencesInfoViewController.xib; sourceTree = ""; }; C4FFB0631D0D7E440015D14A /* XGSyncthing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XGSyncthing.h; path = syncthing/XGSyncthing.h; sourceTree = SOURCE_ROOT; }; C4FFB0641D0D7E4C0015D14A /* XGSyncthing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XGSyncthing.m; path = syncthing/XGSyncthing.m; sourceTree = SOURCE_ROOT; }; FB3E4EE48CFC608AD4FBDE77 /* Pods-syncthing.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-syncthing.debug.xcconfig"; path = "Pods/Target Support Files/Pods-syncthing/Pods-syncthing.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C4576BD81D11E3BB0031BCFD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C4576BEA1D11E7E10031BCFD /* CoreFoundation.framework in Frameworks */, - C4576BE61D11E79F0031BCFD /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; C4A4155D1D0D579D00DC6018 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -180,22 +140,6 @@ name = Docs; sourceTree = ""; }; - C4576BDC1D11E3BB0031BCFD /* xgsyncthing */ = { - isa = PBXGroup; - children = ( - C4576BDD1D11E3BB0031BCFD /* main.m */, - ); - path = xgsyncthing; - sourceTree = ""; - }; - C4576BE21D11E40E0031BCFD /* Test */ = { - isa = PBXGroup; - children = ( - C4576BE31D11E43C0031BCFD /* main.m */, - ); - name = Test; - sourceTree = ""; - }; C46261361D578DA800B16BC6 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -212,19 +156,9 @@ C4460A7D1D0DD2D500200C21 /* STPreferencesWindowController.m */, C4F0E82B1DA1B9CF00435310 /* STPreferencesGeneralViewController.h */, C4F0E82C1DA1B9CF00435310 /* STPreferencesGeneralViewController.m */, - C4F0E82D1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib */, - C4F0E8301DA1C7A800435310 /* STPreferencesFoldersViewController.h */, - C4F0E8311DA1C7A800435310 /* STPreferencesFoldersViewController.m */, - C4F0E8321DA1C7A800435310 /* STPreferencesFoldersViewController.xib */, - C4F0E8351DA1CB0900435310 /* STPreferencesInfoViewController.h */, - C4F0E8361DA1CB0900435310 /* STPreferencesInfoViewController.m */, - C4F0E8371DA1CB0900435310 /* STPreferencesInfoViewController.xib */, C4D36D7D1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.h */, C4D36D7E1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.m */, C4D36D7F1DA3D53F0061FD08 /* STPreferencesAdvancedViewController.xib */, - C4D36D821DA3E2820061FD08 /* STPreferencesDevicesViewController.h */, - C4D36D831DA3E2820061FD08 /* STPreferencesDevicesViewController.m */, - C4D36D841DA3E2820061FD08 /* STPreferencesDevicesViewController.xib */, ); name = STPreferencesWindow; sourceTree = ""; @@ -233,6 +167,7 @@ isa = PBXGroup; children = ( C4460A821D0DD38F00200C21 /* STPreferencesWindowController.xib */, + C4F0E82D1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib */, ); name = STPreferencesWindow; sourceTree = ""; @@ -244,6 +179,8 @@ C4A415641D0D579D00DC6018 /* STApplication.m */, C4D567A11D3A8DFE002AD881 /* STLoginItem.m */, C4D567A31D3A8E34002AD881 /* STLoginItem.h */, + C4FFB0641D0D7E4C0015D14A /* XGSyncthing.m */, + C4FFB0631D0D7E440015D14A /* XGSyncthing.h */, C48B83B41DA444BC0052A172 /* STConfiguration.h */, C48B83B51DA444BC0052A172 /* STConfiguration.m */, 0BE9B8881F050E93002883E2 /* STStatusMonitor.h */, @@ -259,9 +196,7 @@ C4576BE71D11E7C00031BCFD /* libobjc.tbd */, C4D896141D0DF90E00D42F73 /* Scripts */, C4460A881D0DE58B00200C21 /* Docs */, - C4FFB0621D0D7E360015D14A /* Library */, C4A415621D0D579D00DC6018 /* Sources */, - C4576BDC1D11E3BB0031BCFD /* xgsyncthing */, C4A415611D0D579D00DC6018 /* Products */, 37B4D367252EC0BC94949322 /* Pods */, ); @@ -271,7 +206,6 @@ isa = PBXGroup; children = ( C4A415601D0D579D00DC6018 /* Syncthing.app */, - C4576BDB1D11E3BB0031BCFD /* xgsyncthing */, ); name = Products; sourceTree = ""; @@ -330,37 +264,9 @@ name = Scripts; sourceTree = ""; }; - C4FFB0621D0D7E360015D14A /* Library */ = { - isa = PBXGroup; - children = ( - C4576BE21D11E40E0031BCFD /* Test */, - C4FFB0641D0D7E4C0015D14A /* XGSyncthing.m */, - C4FFB0631D0D7E440015D14A /* XGSyncthing.h */, - ); - name = Library; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C4576BDA1D11E3BB0031BCFD /* xgsyncthing */ = { - isa = PBXNativeTarget; - buildConfigurationList = C4576BDF1D11E3BB0031BCFD /* Build configuration list for PBXNativeTarget "xgsyncthing" */; - buildPhases = ( - 45CC8E0944A58A08F2F95479 /* [CP] Check Pods Manifest.lock */, - C4576BD71D11E3BB0031BCFD /* Sources */, - C4576BD81D11E3BB0031BCFD /* Frameworks */, - C4576BD91D11E3BB0031BCFD /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = xgsyncthing; - productName = xgsyncthing; - productReference = C4576BDB1D11E3BB0031BCFD /* xgsyncthing */; - productType = "com.apple.product-type.tool"; - }; C4A4155F1D0D579D00DC6018 /* syncthing */ = { isa = PBXNativeTarget; buildConfigurationList = C4A415711D0D579D00DC6018 /* Build configuration list for PBXNativeTarget "syncthing" */; @@ -395,9 +301,6 @@ CreatedOnToolsVersion = 8.3.3; ProvisioningStyle = Automatic; }; - C4576BDA1D11E3BB0031BCFD = { - CreatedOnToolsVersion = 7.3.1; - }; C4A4155F1D0D579D00DC6018 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = C24U83K674; @@ -419,7 +322,6 @@ projectRoot = ""; targets = ( C4A4155F1D0D579D00DC6018 /* syncthing */, - C4576BDA1D11E3BB0031BCFD /* xgsyncthing */, 0B9C6B051F144DF1009C68CA /* syncthing-dmg */, ); }; @@ -430,13 +332,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C4F0E8391DA1CB0900435310 /* STPreferencesInfoViewController.xib in Resources */, C4D36D811DA3D53F0061FD08 /* STPreferencesAdvancedViewController.xib in Resources */, - C4D36D861DA3E2820061FD08 /* STPreferencesDevicesViewController.xib in Resources */, C47F6C3A1D0DE68D00F36CF6 /* syncthing.icns in Resources */, C4A4156A1D0D579D00DC6018 /* Assets.xcassets in Resources */, C4A4156D1D0D579D00DC6018 /* STApplication.xib in Resources */, - C4F0E8341DA1C7A800435310 /* STPreferencesFoldersViewController.xib in Resources */, C4460A831D0DD38F00200C21 /* STPreferencesWindowController.xib in Resources */, C4946B011D5877F2008447A2 /* STAboutWindowController.xib in Resources */, C4F0E82F1DA1B9CF00435310 /* STPreferencesGeneralViewController.xib in Resources */, @@ -459,24 +358,6 @@ shellPath = /bin/sh; shellScript = "${SOURCE_ROOT}/syncthing/Scripts/create-dmg.sh\n"; }; - 45CC8E0944A58A08F2F95479 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-xgsyncthing-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 76C4F2C92ED96E367934A99B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -532,32 +413,20 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C4576BD71D11E3BB0031BCFD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C4576BEB1D11E9280031BCFD /* XGSyncthing.m in Sources */, - C4576BE41D11E43C0031BCFD /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; C4A4155C1D0D579D00DC6018 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( C4D567A21D3A8DFE002AD881 /* STLoginItem.m in Sources */, C4FFB0661D0D7F870015D14A /* XGSyncthing.m in Sources */, - C4F0E8331DA1C7A800435310 /* STPreferencesFoldersViewController.m in Sources */, C4A415681D0D579D00DC6018 /* main.m in Sources */, C4946B031D587878008447A2 /* STAboutWindowController.m in Sources */, C4D36D801DA3D53F0061FD08 /* STPreferencesAdvancedViewController.m in Sources */, - C4D36D851DA3E2820061FD08 /* STPreferencesDevicesViewController.m in Sources */, C4460A811D0DD2D500200C21 /* STStatusBarController.m in Sources */, C48B83B61DA444BC0052A172 /* STConfiguration.m in Sources */, 0BE9B88A1F050E93002883E2 /* STStatusMonitor.m in Sources */, C4460A801D0DD2D500200C21 /* STPreferencesWindowController.m in Sources */, C4F0E82E1DA1B9CF00435310 /* STPreferencesGeneralViewController.m in Sources */, - C4F0E8381DA1CB0900435310 /* STPreferencesInfoViewController.m in Sources */, C4A415651D0D579D00DC6018 /* STApplication.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -598,28 +467,6 @@ }; name = Release; }; - C4576BE01D11E3BB0031BCFD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8936500B5F25163F49F1401D /* Pods-xgsyncthing.debug.xcconfig */; - buildSettings = { - DEAD_CODE_STRIPPING = YES; - GCC_DYNAMIC_NO_PIC = NO; - OTHER_CFLAGS = ""; - "OTHER_LDFLAGS[arch=*]" = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - C4576BE11D11E3BB0031BCFD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5BE33EE7B1F21764C8AA4890 /* Pods-xgsyncthing.release.xcconfig */; - buildSettings = { - DEAD_CODE_STRIPPING = YES; - OTHER_CFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; C4A4156F1D0D579D00DC6018 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -720,7 +567,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/3thparty/frameworks", ); INFOPLIST_FILE = syncthing/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -746,7 +592,6 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/3thparty/frameworks", ); INFOPLIST_FILE = syncthing/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -772,15 +617,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C4576BDF1D11E3BB0031BCFD /* Build configuration list for PBXNativeTarget "xgsyncthing" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C4576BE01D11E3BB0031BCFD /* Debug */, - C4576BE11D11E3BB0031BCFD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; C4A4155B1D0D579D00DC6018 /* Build configuration list for PBXProject "syncthing" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/syncthing/Controllers/STPreferencesWindowController.m b/syncthing/Controllers/STPreferencesWindowController.m index 5ff95d5..38cd784 100644 --- a/syncthing/Controllers/STPreferencesWindowController.m +++ b/syncthing/Controllers/STPreferencesWindowController.m @@ -8,9 +8,6 @@ #import "STPreferencesWindowController.h" #import "STPreferencesGeneralViewController.h" -#import "STPreferencesFoldersViewController.h" -#import "STPreferencesInfoViewController.h" -#import "STPreferencesDevicesViewController.h" #import "STPreferencesAdvancedViewController.h" @interface STPreferencesWindowController () @@ -22,9 +19,6 @@ @implementation STPreferencesWindowController enum { kGeneralView = 0, - kFoldersView, - kDevicesView, - kInfoView, kAdvancedView }; @@ -51,21 +45,6 @@ - (void) setViewFromId:(NSInteger) tag { _generalView = [[STPreferencesGeneralViewController alloc] init]; _currentViewController = self.generalView; break; - case kFoldersView: - if (self.foldersView == nil) - _foldersView = [[STPreferencesFoldersViewController alloc] init]; - _currentViewController = self.foldersView; - break; - case kDevicesView: - if (self.devicesView == nil) - _devicesView = [[STPreferencesDevicesViewController alloc] init]; - _currentViewController = self.devicesView; - break; - case kInfoView: - if (self.infoView == nil) - _infoView = [[STPreferencesInfoViewController alloc] init]; - _currentViewController = self.infoView; - break; case kAdvancedView: if (self.advancedView == nil) _advancedView = [[STPreferencesAdvancedViewController alloc] init]; @@ -89,99 +68,4 @@ - (IBAction) toolbarButtonClicked:(id)sender { [self setViewFromId:[button tag]]; } -/* - TODO: some day I will know how to dynamic resize the views without - views window height get broken - - //[[self window] setFrame:[currentView bounds] display:YES animate:YES]; - - // embed the current view to our host view - //[currentView addSubview:_currentViewController.view]; - - //[self resizeWindowWithContentSize:_currentViewController.view.frame.size animated:YES]; - //[self.window setContentSize:_currentViewController.view.frame.size]; - //[self setContentView:[_currentViewController view]]; - - // make sure we automatically resize the controller's view to the current window size - - //[self.window setContentSize:_currentViewController.view.frame.size]; - -- (CGFloat)toolbarHeight { - NSToolbar *toolbar = [self.window toolbar]; - CGFloat toolbarHeight = 0.0; - NSRect windowFrame; - - if (toolbar && [toolbar isVisible]) { - windowFrame = [self.window contentRectForFrameRect:self.window.frame - ]; - toolbarHeight = NSHeight(windowFrame) - - NSHeight([self.window.contentView frame]); - } - return toolbarHeight; -} - -- (void)resizeToSize:(NSSize)newSize { - CGFloat newHeight = newSize.height + [self toolbarHeight]; - CGFloat newWidth = newSize.width; - - NSRect aFrame = [self.window contentRectForFrameRect:self.window.frame - ]; - - aFrame.origin.y += aFrame.size.height; - aFrame.origin.y -= newHeight; - aFrame.size.height = newHeight; - aFrame.size.width = newWidth; - - aFrame = [self.window frameRectForContentRect:aFrame - ]; - [self.window setFrame:aFrame display:YES animate:YES]; -} - -- (void) setContentView:(NSView *)view { - //[self resizeToSize:view.frame.size]; - //[self.window setFrame:view.frame.size display:YES animate:YES]; - [self resizeWindowWithContentSize:view.frame.size animated:YES]; - [self.window setContentView:view]; -} - -- (void) resizeWindowWithContentSize:(NSSize)contentSize animated:(BOOL)animated { - CGFloat titleBarHeight = self.window.frame.size.height - ((NSView*)self.window.contentView).frame.size.height; - CGSize windowSize = windowSize = CGSizeMake(contentSize.width, contentSize.height + titleBarHeight); - - // Optional: keep it centered - float originX = self.window.frame.origin.x + (self.window.frame.size.width - windowSize.width) / 2; - float originY = self.window.frame.origin.y + (self.window.frame.size.height - windowSize.height) / 2; - NSRect windowFrame = CGRectMake(originX, originY, windowSize.width, windowSize.height); - - [self.window setFrame:windowFrame display:YES animate:animated]; -} - -- (void)resizeWindowForContentSize:(NSSize) size { - NSWindow *window = [self window]; - - NSRect windowFrame = [window contentRectForFrameRect:[window frame]]; - NSRect newWindowFrame = [window frameRectForContentRect: - NSMakeRect( NSMinX( windowFrame ), NSMaxY( windowFrame ) - size.height, size.width, size.height )]; - [window setFrame:newWindowFrame display:YES animate:[window isVisible]]; -} - - -- (void) setContentView:(NSView *)view { - - //NSRect wndFrame = [self.window frameRectForContentRect:[view bounds]]; - - //NSLog(@"wndFrame: %@", NSStringFromRect(wndFrame)); - //wndFrame.origin.x = self.window.frame.origin.x + (self.window.frame.size.width - view.frame.size.width) / 2; - //wndFrame.origin.y = self.window.frame.origin.y + (self.window.frame.size.height - view.frame.size.height) / 2; - - //[view setFrameOrigin:window.frame.origin]; - [self resizeWindowWithContentSize:view.frame.size animated:YES]; - //[self.window setFrame:wndFrame display:YES animate:YES]; - [[self window] setContentView:view]; - - //[[self window] setFrame:newWindowFrame display:YES animate:YES]; - //[[self window] setContentView:view]; -} -*/ - @end diff --git a/syncthing/Info.plist b/syncthing/Info.plist index 4838ad6..d88e252 100644 --- a/syncthing/Info.plist +++ b/syncthing/Info.plist @@ -47,6 +47,8 @@ https://xor-gate.github.io/syncthing-macosx/appcast.xml SUScheduledCheckInterval 86400 + NSUserNotificationAlertStyle + alert CFBundleGetInfoString syncthing project Group diff --git a/syncthing/STApplication.m b/syncthing/STApplication.m index 67aaa7a..0bdf8db 100644 --- a/syncthing/STApplication.m +++ b/syncthing/STApplication.m @@ -16,6 +16,8 @@ @interface STAppDelegate () @implementation STAppDelegate - (void) applicationDidFinishLaunching:(NSNotification *)aNotification { + [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self]; + _syncthing = [[XGSyncthing alloc] init]; [self applicationLoadConfiguration]; @@ -27,15 +29,21 @@ - (void) applicationDidFinishLaunching:(NSNotification *)aNotification { [_statusMonitor startMonitoring]; } +- (void) userNotificationCenter:(NSUserNotificationCenter *)center + didActivateNotification:(NSUserNotification *)notification +{ + NSDictionary *ui = notification.userInfo; + NSLog(@"ui %@", ui); + + [center removeDeliveredNotification:notification]; + notification = nil; +} + - (void) clickedFolder:(id)sender { NSString *path = [sender representedObject]; [[NSWorkspace sharedWorkspace] selectFile:path inFileViewerRootedAtPath:@""]; } -- (void) applicationWillTerminate:(NSNotification *)aNotification { - // TODO: is this needed -> remove? -} - - (void) awakeFromNib { _statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; _statusItem.menu = _Menu; @@ -43,7 +51,6 @@ - (void) awakeFromNib { [self updateStatusIcon:@"StatusIconNotify"]; } -// TODO: move to STConfiguration class - (void)applicationLoadConfiguration { static int configLoadAttempt = 1; @@ -91,13 +98,6 @@ - (void)applicationLoadConfiguration { } } -- (void) sendNotification:(NSString *)text { - NSUserNotification *notification = [[NSUserNotification alloc] init]; - notification.title = @"Syncthing"; - notification.informativeText = text; - [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; -} - - (void) updateStatusIcon:(NSString *)icon { _statusItem.button.image = [NSImage imageNamed:icon]; [_statusItem.button.image setTemplate:YES]; @@ -125,9 +125,7 @@ - (void) syncMonitorStatusChanged:(SyncthingStatus)status { } - (void) syncMonitorEventReceived:(NSDictionary *)event { - NSNumber *eventId = [event objectForKey:@"id"]; NSString *eventType = [event objectForKey:@"type"]; - NSDictionary *eventData = [event objectForKey:@"data"]; if ([eventType isEqualToString:@"ConfigSaved"]) { [self refreshDevices]; @@ -167,6 +165,7 @@ - (void) updateFoldersMenu:(NSMenu *)menu { NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"label" ascending:YES comparator:^NSComparisonResult(id obj1, id obj2) { return [(NSString *)obj1 compare:(NSString *)obj2 options:NSNumericSearch]; }]; + NSArray *folders = [[self.syncthing getFolders] sortedArrayUsingDescriptors:@[sort]]; for (id dir in folders) { diff --git a/syncthing/STStatusMonitor.m b/syncthing/STStatusMonitor.m index 3e6871c..c29a97e 100644 --- a/syncthing/STStatusMonitor.m +++ b/syncthing/STStatusMonitor.m @@ -96,10 +96,29 @@ - (void) processEvent:(NSDictionary *)event { self.folderStates[folder] = newState; [self updateCurrentStatus]; + } else if ([eventType isEqualToString:@"FolderRejected"]) { + [self processEventNotificationAcceptDecline:[NSString stringWithFormat:@"New folder %@", [eventData objectForKey:@"folderLabel"]] identifier:[NSString stringWithFormat:@"%@-%@", eventId, eventType] userInfo:[[NSDictionary alloc] initWithDictionary:event]]; + } else if ([eventType isEqualToString:@"DeviceRejected"]) { + [self processEventNotificationAcceptDecline:[NSString stringWithFormat:@"New device %@", [eventData objectForKey:@"name"]] identifier:[NSString stringWithFormat:@"%@-%@", eventId, eventType] userInfo:[[NSDictionary alloc] initWithDictionary:event]]; } [self.delegate syncMonitorEventReceived:event]; } +- (void) processEventNotificationAcceptDecline: (NSString *) informativeText identifier:(NSString *)identifier userInfo:(NSDictionary *)userInfo { + NSUserNotification *n = [[NSUserNotification alloc] init]; + + n.informativeText = informativeText; + n.identifier = identifier; + n.userInfo = userInfo; + + n.title = @"Syncthing"; + n.hasActionButton = true; + n.actionButtonTitle = @"Accept"; + n.otherButtonTitle = @"Decline"; + + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:n]; +} + - (void) updateStatusFromTimer { if (![_syncthing ping]) { self.currentStatus = SyncthingStatusOffline; diff --git a/syncthing/Tests/main.m b/syncthing/Tests/main.m deleted file mode 100644 index 5d04e4a..0000000 --- a/syncthing/Tests/main.m +++ /dev/null @@ -1,22 +0,0 @@ -#import -#import - -int main (int argc, const char * argv[]) -{ - XGSyncthing *st = [[XGSyncthing alloc] init]; - - [st setURI:@"http://localhost:8384"]; - [st setApiKey:@"83GgPHZcHFSi-GEj03mv8tEix6WUXW-K"]; - - if ([st ping]) - NSLog(@"Syncthing OK!"); - else - NSLog(@"Syncthing borken!"); - - /* Configured folder ids */ - for (id dir in [st getFolders]) { - NSLog(@"id: %@", [dir objectForKey:@"id"]); - } - - return 0; -} \ No newline at end of file diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.h b/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.h deleted file mode 100644 index 47bc0ff..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// STPreferencesDevicesViewController.h -// syncthing -// -// Created by Jerry Jacobs on 04/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import - -@interface STPreferencesDevicesViewController : NSViewController - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.m b/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.m deleted file mode 100644 index 3641dd4..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// STPreferencesDevicesViewController.m -// syncthing -// -// Created by Jerry Jacobs on 04/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import "STPreferencesDevicesViewController.h" - -@interface STPreferencesDevicesViewController () - -@end - -@implementation STPreferencesDevicesViewController - -- (void)viewDidLoad { - [super viewDidLoad]; -} - -- (id) init { - self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; - return self; -} - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.xib b/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.xib deleted file mode 100644 index 6dc294b..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesDevicesViewController.xib +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.h b/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.h deleted file mode 100644 index cd5f643..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// STPreferencesFoldersViewController.h -// syncthing -// -// Created by Jerry Jacobs on 03/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import - -@interface STPreferencesFoldersViewController : NSViewController - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.m b/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.m deleted file mode 100644 index 845351e..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// STPreferencesFoldersViewController.m -// syncthing -// -// Created by Jerry Jacobs on 03/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import "STPreferencesFoldersViewController.h" - -@interface STPreferencesFoldersViewController () - -@end - -@implementation STPreferencesFoldersViewController - -- (void)viewDidLoad { - [super viewDidLoad]; -} - -- (id) init { - self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; - return self; -} - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.xib b/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.xib deleted file mode 100644 index 4b6afe3..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesFoldersViewController.xib +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.h b/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.h deleted file mode 100644 index 504169e..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// STPreferencesInfoViewController.h -// syncthing -// -// Created by Jerry Jacobs on 03/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import - -@interface STPreferencesInfoViewController : NSViewController - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.m b/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.m deleted file mode 100644 index 5bb94ad..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// STPreferencesInfoViewController.m -// syncthing -// -// Created by Jerry Jacobs on 03/10/2016. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import "STPreferencesInfoViewController.h" - -@interface STPreferencesInfoViewController () - -@end - -@implementation STPreferencesInfoViewController - -- (void) viewDidLoad { - [super viewDidLoad]; -} - -- (id) init { - self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; - return self; -} - -@end diff --git a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.xib b/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.xib deleted file mode 100644 index 6162062..0000000 --- a/syncthing/UI/STPreferencesWindow/STPreferencesInfoViewController.xib +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/syncthing/XGSyncthing.m b/syncthing/XGSyncthing.m index 2130a37..ccc24a0 100644 --- a/syncthing/XGSyncthing.m +++ b/syncthing/XGSyncthing.m @@ -20,6 +20,8 @@ - (bool) runExecutable [_StTask setLaunchPath:_Executable]; [_StTask setArguments:@[@"-no-browser"]]; + [_StTask setStandardOutput:NULL]; + [_StTask setStandardError:NULL]; [_StTask setQualityOfService:NSQualityOfServiceBackground]; [_StTask launch]; diff --git a/xgsyncthing/main.m b/xgsyncthing/main.m deleted file mode 100644 index 2bfae70..0000000 --- a/xgsyncthing/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// xgsyncthing -// -// Created by Jerry Jacobs on 15/06/16. -// Copyright © 2016 Jerry Jacobs. All rights reserved. -// - -#import - -int main(int argc, const char * argv[]) { - @autoreleasepool { - // insert code here... - NSLog(@"Hello, World!"); - } - return 0; -}