[Pkg-owncloud-commits] [owncloud-client] 250/470: OS X: Use app icon for "Share with ..." Finder menu #4472

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 6c283c7a4877a6117999e57b9a2c006511d8c741
Author: Markus Goetz <markus at woboq.com>
Date:   Wed Mar 30 11:20:44 2016 +0200

    OS X: Use app icon for "Share with ..." Finder menu #4472
    
    This works for both plain ownCloud and themed clients.
---
 shell_integration/MacOSX/CMakeLists.txt               |  6 ++++++
 .../OwnCloudFinderSync/FinderSyncExt/FinderSync.m     |  3 ++-
 .../OwnCloudFinderSync.xcodeproj/project.pbxproj      | 19 +++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/shell_integration/MacOSX/CMakeLists.txt b/shell_integration/MacOSX/CMakeLists.txt
index b7d602a..a5bcd67 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 440af7e..a86f948 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 2418b3c..f9a232e 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 = "";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list