New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] Adding QuickLook feature #7491
Conversation
This Pull Request adds macOS QuickLook previews and icons to FreeCAD. The patch in Info.plist makes *.FCStd files known as filetype FreeCAD needs to be built as a full macOS app ( |
@ipatch if you have any time, would you be available to test this PR ? |
sure, give me a few. |
Looking at the CI output, I saw that the I did fix the tab and space errors that I found in the branch, so they can be pulled. The tab errors in Anything else I need to fix, please let me know. Edit: Oh, and do you want me to do "Update branch" (in the GitHub PR page) with a merge commit or a rebase? |
per the github web ui recommendations for testing out this PR, i ran the below commands on my local build box (same box i use to build the bottles for the homebrew freecad tap). i'm using the macos mojave vm because it gives me the least amount friction when building an app bundle ie. a
i pushed your PR to my fork of freecad so you can see if might have messed something up, but so far from running those cmds on my setup cmake is giving me
obviously the local shell variables are just that, local for my particular build setup on this box. however i'm seeing the below output after running that cmake command in my build dir. output has been trimmed. can provide full output of the cmake command if needed.
and probably where cmake begins to fail,
i hope this helps. and let me know if i need to amend or update my PR branch at some point. below is a link to my fork freecad containing a branch of this PR https://github.com/ipatch/FreeCAD/tree/ipatch.builds.pr7491 cheers |
@ipatch Thanks for trying my code. I have not touched lines 37 to 40 in MacAppBundle/CMakeLists.txt. My changes are in lines 128 to 144. The lines handle some Python code location fixes and are unrelated to my changes. I have generally trouble compiling FreeCAD into a bundle. I am using Not sure if this is related at all, but some CMake parts expect HomeBrew to be in /usr/local which are in /opt/homebrew/ in a fresh homeprew setup: Homebrew Patch |
thanks. yeah i just popped this tab open again to update my response. indeed those lines are related to collecting / gathering the all that brings another issue though, i think these checks should be a tad bit more robust, but that's separate issue for another day. as my manually added
i believe the weekly builds are made using conda. which is something we should look into. as it looks this plugin might only be applicable for homebrew builds freecad which would be unfortunate for those who are using the conda build and would enjoy using this plugin. me personally i'm not familiar with the conda build system so you'll have to ping somebody who is familiar with that stuff.
actually the freecad source was setup a while ago where somebody (too lazy, to look through the git blame at the moment) but they added a useful cmake var where you add a all that said 😥, i'll finish the cmake configure, then run through |
Well, at least we get stuck at the same places. Same happens to me if I use cmake directly, but not if I use homebrew. So even with
I was missing files in the repo to even try conda, but then again, I know nothing about condo. I'll see if I find someone who does. Conda does build a bundle, and I hope (assumed) that it is based on cmake as well, so QuickLook would be part of the release. I'll follow up on that. |
You are right, the Conda script does indeed include its own Info.plist wich does not have the changes to register the file type. @looooo Hi Lorenz. Would it make sense and be possible to take the Info.plist from the main repo and also include my patches? I am not familiar with Condo, but the CMake setup has the basics to build app bundles and make QuickLook work. |
your PR build finished. 👍 ran
which is unrelated to your PR. however, is there post installation step that is required after building the so i'm seeing this using quicklook with finder |
The bundle must be moved to
If it does not, use Finder to throw the bundle in the Trash and then move it back into If the manager was found, you may need to restart Finder (Option-Rightclick, and select "Relaunch" in the menu). If all that still fails, you can at least check with Oh, and not all .FCStd files actually have an embedded preview file. Older versions of FreeCAD did not generate thise, and some versions just generated the FC logo as a thumbnail (unzip the FCStd file and search for All of the above is usually automatic when a user drags the |
I am not sure if this works. For the conda-based bundles the build and bundle process are two separate tasks. Are there any conditions for the Info.plist to be build? |
rebuilding your PR now, (i saw you force pushed some changes since my last build) BTW it looks your located in Germany, if my detective work 🕵🏻♂️ is correct. i'm located in merica 🦅, so if there is a delay in my responses it is mostly due to time zones. ie. me being US CST. ie. UTC -5. i generally mix in my computer work from afternoon to about 6PM (ie. freecad related when i can). also saw you're mixing tabs and spaces in your |
finished rebuilding your PR, and produced an app bundle. 👍
ran the the below commands.
i'm seeing the below in my mojave vm. do you mind attaching a file that does contain a thumbnail to this PR via a comment. and i can download that file and test? |
attached is a file I created with your app bundle below is a screen grab of what the file looks like, |
all that above should probably be opened in a separate issue, but add a link here for completeness sake, |
@ipatch The file you attached has no Thumbnail.png. You can enable this feature using the FreeCAD preferences. I attached a file that does have the thumbnail (just rename the FCStd file to something.zip and unzip it. Inside should be a folder named "thumbnails", containing a file named "Thumbnail.png"). Reminder to self: final output should be sized using the png size; output image could contain a note stating there was no Thumbnail; can we suggest that the user changes the preferences? ; should we start the entire FreeCAD app in the background to generate the Thumbnail.png (not good IMHO as FC will be launched for each preview or icon)? test8.FCStd.zip -> rename to test8.FCStd to preview, or to test8.zip to see contents. |
That's how it is supposed to look. Great! |
Is this ready to be reviewed ? |
Yes, it's ready |
@ipatch can you re-test and review ? @looooo there is FreeCAD/FreeCAD-Bundle#136 can we merge and have the macOS folk test it ? (bump the appimage weekly release to make that happen?) Edit: @looooo after this PR is merged of course |
@ipatch sorry for bugging you...any chance you can test this ? |
sure give me a few. |
i was able to build locally using my macos mojave vm. 👍 🎃 |
Fixed a typo: BUID_WITH_CONDA -> BUILD_WITH_CONDA
Typo in comment.
Since @ipatch reports success with this plugin above, I'm going to merge it in so we can get more OS X users in the loop, and can catch anything it's missing. This is a tough one to test! |
@chennes no need to revert any changes. i'm going to update the patch file for the freecad formula file in the homebrew-freecad tap to work with this recent merge. referenced this PR in the homebrew-freecad tap for posterity. |
* [macOS] Adding QuickLook feature * [macOS] Adding QuickLook support for Conda and Homebrew. * [macOS] Support non-square app icons in thumbnails. * [macOS] adding icon for .FCScript files
Thanks! |
* [macOS] Adding QuickLook feature * [macOS] Adding QuickLook support for Conda and Homebrew. * [macOS] Support non-square app icons in thumbnails. * [macOS] adding icon for .FCScript files
Thank you @MatthiasWM ! |
App
,Base
,Gui
or one of theMod
subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next onesThe code is located in
src/MacAppBundle/QuickLook
so it does not interfere with other platforms or macOS command line buildsThis PR is in relation to Forum: New feature: Quicklook for macOS
git pull --rebase upstream master
./bin/FreeCAD --run-test 0
This commit has no impact on the actual app. Also I will need hep at some point to build a full app on macOS Monterey.
Fixes typo in Draft Move command text
Draft: Fixed typos
And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 1.0 Changelog Forum Thread.
Will do.