Add Workbench to Addon Manager: Difference between revisions

From FreeCAD Documentation
(Initial)
 
No edit summary
 
(10 intermediate revisions by one other user not shown)
Line 3: Line 3:
<translate>
<translate>


== Introduction ==
== Introduction == <!--T:1-->


<!--T:2-->
These are step-by-step instructions on how to add a Python workbench to the [[Std AddonMgr|Addon Manager]].
These are step-by-step instructions on how to add a Python workbench to the [[Std AddonMgr|Addon Manager]].


<!--T:3-->
Requirements:
Requirements:
* A local git repository.
* A local git repository.
Line 12: Line 14:
* Git must be installed.
* Git must be installed.


== Enable developer mode ==
== Enable developer mode == <!--T:4-->


<!--T:5-->
# Open the [[Preferences Editor|Preferences Editor]]: select the {{MenuCommand|Edit → [[Image:Std_DlgPreferences.svg|16px]] Preferences...}} option from the menu.
# Open the [[Preferences_Editor|Preferences Editor]]: select the {{MenuCommand|Edit → [[Image:Std_DlgPreferences.svg|16px]] Preferences...}} option from the menu.
# Select the {{MenuCommand|[[Image:Std_AddonMgr.svg|16px]] Addon Manager}} option in the left bar.
# Select the {{MenuCommand|[[Image:Std_AddonMgr.svg|16px]] Addon Manager}} option in the left bar.
# On the {{MenuCommand|Addon manager options}} tab check the {{MenuCommand|Addon developer mode}} checkbox. This will enable the {{Button|Developer tools...}} button in the Addon Manager.
# On the {{MenuCommand|Addon manager options}} tab check the {{MenuCommand|Addon developer mode}} checkbox. This will enable the {{Button|Developer tools...}} button in the Addon Manager.
# Press the {{Button|OK}} button to close the Preferences Editor.
# Press the {{Button|OK}} button to close the Preferences Editor.


== Create the package.xml file ==
== Create the package.xml file == <!--T:6-->


<!--T:7-->
# Open the [[Std AddonMgr|Addon Manager]]: select the {{MenuCommand|Tools → [[Image:Std_AddonMgr.svg|16px]] Addon manager}} option from the menu.
# Open the [[Std_AddonMgr|Addon Manager]]: select the {{MenuCommand|Tools → [[Image:Std_AddonMgr.svg|16px]] Addon manager}} option from the menu.
# Press the {{Button|Developer tools...}} button.
# Press the {{Button|Developer tools...}} button.
# The {{MenuCommand|Addon Developer Tools}} dialog opens.<br>[[Image:Addon_Manager_Addon_Developer_Tools_Dialog.png|350px]]
# The {{MenuCommand|Addon Developer Tools}} dialog opens.<br>[[Image:Addon_Manager_Addon_Developer_Tools_Dialog.png|350px]]
# Enter the following values:
# Enter the following:
#* {{MenuCommand|Path to Addon}}: The path to the local git repository.
#* {{MenuCommand|Path to Addon}}: The path to the local git repository.
#* {{MenuCommand|Addon Name}}: This will appear in the listings of the Addon Manager.
#* {{MenuCommand|Addon Name}}: This will appear in the listings of the Addon Manager.
Line 44: Line 48:
# Push the created file to your remote repository.
# Push the created file to your remote repository.


== Add the workbench to the .gitmodules file ==
== Add the workbench to the .gitmodules file == <!--T:8-->


<!--T:9-->
# Fork https://github.com/FreeCAD/FreeCAD-addons.
# Fork https://github.com/FreeCAD/FreeCAD-addons.
# Create a new branch.
# Create a new branch.
Line 52: Line 57:
# Submit a Pull Request to the FreeCAD-Addons repository with the new {{FileName|.gitmodules}} file.
# Submit a Pull Request to the FreeCAD-Addons repository with the new {{FileName|.gitmodules}} file.


== See also ==
== See also == <!--T:10-->


<!--T:11-->
* [[Workbench_creation|Workbench creation]]
* [[Workbench_creation|Workbench creation]]
* [[Package_Metadata|Package Metadata]]: Detailed information about the {{FileName|package.xml}} file.
* [[Package_Metadata|Package Metadata]]: Detailed information about the {{FileName|package.xml}} file.
Line 60: Line 66:
</translate>
</translate>
[[Category:Addons{{#translation:}}]]
[[Category:Addons{{#translation:}}]]
[[Category:Developer Documentation{{#translation:}}]]

Latest revision as of 21:40, 18 November 2022

Other languages:

Introduction

These are step-by-step instructions on how to add a Python workbench to the Addon Manager.

Requirements:

Enable developer mode

  1. Open the Preferences Editor: select the Edit → Preferences... option from the menu.
  2. Select the Addon Manager option in the left bar.
  3. On the Addon manager options tab check the Addon developer mode checkbox. This will enable the Developer tools... button in the Addon Manager.
  4. Press the OK button to close the Preferences Editor.

Create the package.xml file

  1. Open the Addon Manager: select the Tools → Addon manager option from the menu.
  2. Press the Developer tools... button.
  3. The Addon Developer Tools dialog opens.
  4. Enter the following:
    • Path to Addon: The path to the local git repository.
    • Addon Name: This will appear in the listings of the Addon Manager.
    • Description: Idem.
    • Version: Idem.
    • Repository URL
    • Primary branch
    • README URL: Recommended.
    • Icon: The icon must be part of the repository.
  5. Press the button at the bottom of the dialog.
  6. The Content Item dialog opens.
  7. The Content type should be set to Workbench.
  8. Check the This is the only item in the Addon checkbox.
  9. Enter the Workbench class name. This is the class name specified in the InitGui.py file.
  10. For the Subdirectory enter ./.
  11. Press the OK button to close the dialog.
  12. Press the Save button to close the Addon Developer Tools dialog and save the package.xml file.
  13. Press the Close button to close the Addon Manager.
  14. Push the created file to your remote repository.

Add the workbench to the .gitmodules file

  1. Fork https://github.com/FreeCAD/FreeCAD-addons.
  2. Create a new branch.
  3. Edit the .gitmodules file to include your new Addon, in alphabetical order.
  4. Push the new branch to GitHub.
  5. Submit a Pull Request to the FreeCAD-Addons repository with the new .gitmodules file.

See also