diff options
author | Markus Goetz <markus@woboq.com> | 2016-03-30 12:20:44 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2016-03-30 16:26:43 +0300 |
commit | 6c283c7a4877a6117999e57b9a2c006511d8c741 (patch) | |
tree | 37f33b8e84a7c1ae73bf76bed23642abd1349043 /shell_integration/MacOSX | |
parent | 02a69d54870168a22d53c3d40d016fd4b1299182 (diff) |
OS X: Use app icon for "Share with ..." Finder menu #4472
This works for both plain ownCloud and themed clients.
Diffstat (limited to 'shell_integration/MacOSX')
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 = ""; |