The AddOns.xcu file in an extension describes what menus or toolbars an extension adds/modifies/removes. Well-commented examples for it can be found in the sdk-examples repository at: https://gerrit.libreoffice.org/gitweb?p=sdk-examples.git;a=summary e.g. the TuesdayPython/Addons.xcu. The XML format of these is pretty verbose and cumbersome -- and handwriting these can be errorprone. It would be nice to have script (in Python or somesuch) wizard that can generate these.
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
Hi, I would like to work on this bug.
A polite ping, still working on this bug ?
A polite ping, still working on this bug
Hi, sorry for the delayed response. Yes, I would like to continue working on this. But was a bit preoccupied lately. If anyone wants to continue, you are welcome to do so. Thank you.
A polite ping, still working on this bug?
Hello, I would like to work on this Bug.
Please provide me little guidance to proceed. thank you.
(In reply to codetronaut from comment #13) > Please provide me little guidance to proceed. > thank you. Where are you stuck at the moment? What did you try and research so far?
one thing, can I take reference to this:https://blog.mdda.net/oss/2011/10/07/python-libreoffice also, I saw .xcu is somewhat like .xml so should I create python script for the same?
(In reply to codetronaut from comment #15) > one thing, can I take reference to > this:https://blog.mdda.net/oss/2011/10/07/python-libreoffice > > also, I saw .xcu is somewhat like .xml so should I create python script for > the same? The .xcu files contain XML. Björn's proposal was to create a wizard-like script to help with their generation. I assume the idea was to simply have the script ask questions on the command line about what menu or toolbar items should be modified. In other words, I don't believe the idea was to create a LibreOffice *extension*.
okay, so the task is to create a wizard-like script which first generates the logs(i.e adds/modifies/removes) of extension in .xcu (i.e in XML) and then converts it to some human-readable format. Right?
my bad *not logs I mean description of.
(In reply to codetronaut from comment #17) > okay, so the task is to create a wizard-like script which first generates > the logs(i.e adds/modifies/removes) of extension in .xcu (i.e in XML) and > then converts it to some human-readable format. Right? Right, except skip the last part, because Björn did not mention any conversion to a human-readable format. The TuesdayPython Addons.xcu refers to this document, which is helpful: https://wiki.openoffice.org/wiki/Framework/Article/Addon_Menu_Toolbar_Merging
From where should I take reference for the generation of logs/descriptions I tried to implement a script for the generation of .xml file, i.e from where should this script will take data from. Please bear with me I am a little beginner.
(In reply to codetronaut from comment #20) > From where should I take reference for the generation of logs/descriptions I > tried to implement a script for the generation of .xml file, i.e from where > should this script will take data from. > > Please bear with me I am a little beginner. Björn would be the best one to comment, but from what I understand: 1. Have template fragments based on what is listed at https://wiki.openoffice.org/wiki/Framework/Article/Addon_Menu_Toolbar_Merging 2. Take the data to fill the template fragments from command line, asking questions from the script user
okay, please have a look if I am going right, https://pastebin.com/pcSijHwx what I did is created a script that forms an XML file and later I will be giving the user to enter according to the particular bug.
Dear codetronaut, This bug has been in ASSIGNED status for more than 3 months without any activity. Resetting it to NEW. Please assign it back to yourself if you're still working on this.
python3 addon_console.py.py --addon-name org.openoffice.Office \ --merge-type menu \ --merge-name org.libreoffice.TuesdayPrinter.menus \ --merge-point .uno:PickList\.uno:Print \ --merge-command Replace \ --merge-fallback AddAfter \ --output-dir /path/to/output_directory /path/to/output_directory with the desired output directory where you want to save the Addons.xcu file, if not given then in the end prompt will ask you - > Save Addons.xcu file to desktop or specify a path to custom directory? (d/c): d For the toolbar merge, you would execute a similar command, adjusting the --merge-type, --merge-name, --merge-point, --merge-command, and --merge-fallback parameters accordingly. Dummy Example i/p - Input Parameters: ----------------- Addon Name: For Menu Merge: Merge Name: org.libreoffice.TuesdayPrinter.menus Merge Point: .uno:PickList\.uno:Print Merge Command: Replace Merge Fallback: AddAfter Item Name: submenu1 Title: Print on Tuesdays URL: service:org.libreoffice.TuesdayPrinter?printontuesday Image Identifier: %origin%/images/printtuesday For Toolbar Merge: Merge Name: org.libreoffice.TuesdayPrinter.standardbar Merge Point: .uno:PrintDefault Merge Command: Replace Merge Fallback: AddAfter Item Name: button1 Title: Print on Tuesdays URL: service:org.libreoffice.TuesdayPrinter?printontuesday Image Identifier: %origin%/images/printtuesday > ======================================================================== > o/p from terminal - python3 addon_console.py --addon-name MyAddon --merge-type menu --merge-name MyMerge --merge-point .uno:FileMenu --merge-command AddBefore --merge-fallback AddAfter Select the application module context for the merge instruction: 1. Writer 2. Spreadsheet 3. Presentation 4. Draw 5. Formula 6. Chart 7. Bibliography Enter your choice (1-7): 1 Enter item name (or 'done' to finish): OfficeMenuBarMerging Enter item title: Print on Tuesdays Enter item URL: service:org.libreoffice.TuesdayPrinter?printontuesday Enter path to item image (optional): %origin%/images/printtuesday Error: Invalid path: Path does not exist Enter item name (or 'done' to finish): org.libreoffice.TuesdayPrinter.menus Enter item title: MergePoint Enter item URL: uno:PickList\.uno:Print Enter path to item image (optional): Enter item name (or 'done' to finish): done Are you done entering items? (yes/no): yes Save Addons.xcu file to desktop or specify a path to custom directory? (d/c): d
varshneydevansh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5e8813b22a9b73d1639f63fce3a8bed8baf6d0bb tdf#97448 Add helper script to generate Addons.xcu It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
OMG! My first major code PR is accepted <3 Thank you Ilmari and Hossein :)
One more thing I wanna ask is what about the documentation of this? Where should I add this information?
(In reply to Devansh Varshney from comment #27) > One more thing I wanna ask is what about the documentation of this? Where > should I add this information? You can start by adding an entry about it in the release notes: https://wiki.documentfoundation.org/ReleaseNotes/24.8
Adding a REAME.md wouldn't that bad, too.
Okay I'll do it.