diff options
author | Markus Goetz <markus@woboq.com> | 2016-03-30 16:53:54 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2016-03-30 16:53:54 +0300 |
commit | dd8b0c3e4a3263b936c2a860fe0bb2d592613802 (patch) | |
tree | 373c9999b7ce50576dae905dfd478a2fee6fa73a /shell_integration | |
parent | c1503500965b56a789c7cdba67ac3f8e2f9c92a0 (diff) | |
parent | 6c283c7a4877a6117999e57b9a2c006511d8c741 (diff) |
Merge pull request #4623 from owncloud/share_menu_icon_osx
OS X: Use app icon for "Share with ..." Finder menu #4472
Diffstat (limited to 'shell_integration')
3 files changed, 27 insertions, 1 deletions
diff --git a/shell_integration/MacOSX/CMakeLists.txt b/shell_integration/MacOSX/CMakeLists.txt index b7d602ad3..a5bcd67ba 100644 --- a/shell_integration/MacOSX/CMakeLists.txt +++ b/shell_integration/MacOSX/CMakeLists.txt @@ -7,6 +7,9 @@ add_custom_target( legacy_mac_overlayplugin ALL OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX} COMMENT building Legacy Mac Overlay icons) +# Contrary to popular belief, this is called like this no matter what theme/OEM. +set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/ownCloud.icns") + # The bundle identifier and application group need to have compatible values with the client # to be able to open a Mach port across the extension's sandbox boundary. # Pass the info through the xcodebuild command line and make sure that the project uses @@ -14,10 +17,13 @@ add_custom_target( legacy_mac_overlayplugin ALL add_custom_target( mac_overlayplugin ALL xcodebuild -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj -target FinderSyncExt -configuration Release SYMROOT=${CMAKE_CURRENT_BINARY_DIR} + OC_OEM_SHARE_ICNS=${OC_OEM_SHARE_ICNS} OC_APPLICATION_NAME=${APPLICATION_NAME} OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN} OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX} COMMENT building Mac Overlay icons) +add_dependencies(mac_overlayplugin ${APPLICATION_EXECUTABLE}) # for the ownCloud.icns to be generated + INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/SyncStateFinder.osax/Contents DESTINATION ${CMAKE_INSTALL_PREFIX}/Library/ScriptingAdditions/SyncStateFinder.osax/ ) diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m index 440af7e33..a86f9485b 100644 --- a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m +++ b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m @@ -103,7 +103,8 @@ if (_shareMenuTitle && !onlyRootsSelected) { NSMenu *menu = [[NSMenu alloc] initWithTitle:@""]; - [menu addItemWithTitle:_shareMenuTitle action:@selector(shareMenuAction:) keyEquivalent:@"title"]; + NSMenuItem *item = [menu addItemWithTitle:_shareMenuTitle action:@selector(shareMenuAction:) keyEquivalent:@"title"]; + item.image = [[NSBundle mainBundle] imageForResource:@"app.icns"]; return menu; } diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj index 2418b3c23..f9a232e8b 100644 --- a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj +++ b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj @@ -178,6 +178,7 @@ C2B573D31B1CD9CE00303B36 /* Sources */, C2B573D41B1CD9CE00303B36 /* Frameworks */, C2B573D51B1CD9CE00303B36 /* Resources */, + 5B3335471CA058E200E11A45 /* ShellScript */, ); buildRules = ( ); @@ -253,6 +254,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 5B3335471CA058E200E11A45 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ ${OC_OEM_SHARE_ICNS} ]]; then\n cp ${OC_OEM_SHARE_ICNS} ${BUILT_PRODUCTS_DIR}/FinderSyncExt.appex/Contents/Resources/app.icns\nfi"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ C2B573AD1B1CD91E00303B36 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -429,6 +446,7 @@ MTL_ENABLE_DEBUG_INFO = YES; OC_APPLICATION_NAME = ownCloud; OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient; + OC_OEM_SHARE_ICNS = ""; OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -476,6 +494,7 @@ MTL_ENABLE_DEBUG_INFO = NO; OC_APPLICATION_NAME = ownCloud; OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient; + OC_OEM_SHARE_ICNS = ""; OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = ""; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; |