[ci skip]
* Added the code needed for the proposed license templates. * ./src/templates.c * ./src/callbacks.c * ./data/geany.glade * ./data/Makefile.am * Added the proposed licenses to "templates=" in ./data/Makefile.am * Added AGPLv2 (GNU Affero General Public License v2) * Added AGPLv3 (GNU Affero General Public License v3) * Renamed ./data/templates/gpl to ./data/templates/gpl2 * This makes it clear that the license is version 2 * Added GPLv3 (GNU General Public License v3) * Many developers prefer GPLv3 over GPLv2 * Added LGPLv2 license (GNU Lesser General Public License v2) * Added LGPLv3 license (GNU Lesser General Public License v3) * The LGPL licenses are commonly used in libraries and other code * Added BSD 2-Clause License * Renamed ./data/templates/bsd to ./data/templates/bsd-3-clause (BSD 3-Clause License) * This makes it clear that the license is 3-Clause * Updated ./data/templates/bsd-3-clause (BSD 3-Clause License) * Ensured that this license matches the official BSD 3-Clause License * Variety is the spice of life; Some other commonly used licenses should be added * Added Apache License v2.0 * Added cc0 (CC0 1.0 Universal (CC0 1.0)) * Added the MIT License (MIT) * Added MPLv2 (Mozilla Public License v2.0) * Added zib/libpng License * I plan to add more licenses in the future (perhaps WTFPL)
The functions "editor_insert_snippet" and "editor_find_snippet" in ./src/editor.c dynamically find and add license templates to the "Edit > Insert Comments" sub-menu during compilation. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/752
-- Commit Summary --
* Create lgpl3 * Rename gpl to gpl2 * Create lgpl2 * Create cc0 * Create mpl2 * Create agpl3 * Create agpl2 * Create gpl3 * Create bsd-2-clause * Update and rename bsd to bsd-3-clause * Update bsd-2-clause * Create zlib-libpng * Create apache2 * Create mit * Update templates.c * Update callbacks.c * Update geany.glade * Update Makefile.am
-- File Changes --
M data/Makefile.am (15) M data/geany.glade (222) A data/templates/agpl2 (14) A data/templates/agpl3 (12) A data/templates/apache2 (13) A data/templates/bsd-2-clause (24) R data/templates/bsd-3-clause (5) A data/templates/cc0 (4) R data/templates/gpl2 (0) A data/templates/gpl3 (12) A data/templates/lgpl2 (14) A data/templates/lgpl3 (12) A data/templates/mit (21) A data/templates/mpl2 (3) A data/templates/zlib-libpng (13) M src/callbacks.c (123) M src/templates.c (32)
-- Patch Links --
https://github.com/geany/geany/pull/752.patch https://github.com/geany/geany/pull/752.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752
I will figure-out why this is still failing. Tips are more than welcome.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155667156
Whoops! I need to add some code to templates.h
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155667675
@codebrainz and @elextr , I successfully added all of the needed code. What do you think of this PR? Now that I know that I needed to edit additional files, I hope that my future PRs will be more pleasing to the team.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155669896
If this PR is accepted, would all of my contributions at that point be enough to earn a place in the "Credits" of Geany's "About" window?
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155670158
If this PR is accepted, would all of my contributions at that point be enough to earn a place in the "Credits" of Geany's "About" window?
That list is probably out of date. A pull request which updated it based on the Git history/log would surely (and necessarily) ensure your place therein :)
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155675818
I haven't tested yet, but this looks much more promising.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155677791
Looks better, but I wonder if all those almost identical callbacks could be combined into one or two and use the user_data to pass which template to use?
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155689661
@elextr , I am sure a for-loop could be used to generate a template at compile-time. I have not tried templating in C. However, in Python3, developers can create a list (special Python array) containing the license names. Then, the for-loop would dynamically generate the needed code. Perhaps, something like this can be done in C/C++ so that Geany developers can just add the license file and an array-entry.
@codebrainz , so my name will be added (via a script)? Will my name be in the "Credits"? Would you like me to manually update the "Credits"?
I am glad you all like my contribution. I look forward to upgrading to Geany v1.26 and v1.27.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-155805940
@elextr , I am sure a for-loop could be used to generate a template at compile-time. I have not tried templating in C. However, in Python3, developers can create a list (special Python array) containing the license names. Then, the for-loop would dynamically generate the needed code. Perhaps, something like this can be done in C/C++ so that Geany developers can just add the license file and an array-entry.
As @codebrainz has already said, the "best" way of doing this is for the menu to be constructed from the files in the system and user `data/templates` directories.
As I have said before, the file creation templates work this way, the menu is populated from the files in `data/templates/files` and the user `config/templates/files` directories so that means there is some existing code for you to re-use if you want to try this.
@codebrainz , so my name will be added (via a script)? Will my name be in the "Credits"? Would you like me to manually update the "Credits"?
See my comment elsewhere about this. Unless @b4n contradicts me I don't think we actually have a published process for updating credits. Maybe now is the time to automate it since the contributors list hasn't been updated since Matthew Brush was added in Jan 2011, and I find it hard to believe there have been no new contributors since then.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-156000547
@elextr , true, but if you would like, I can manually update the contributor list myself (if I can see the automatically generated list that is made by that script you mentioned).
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/752#issuecomment-156139050
github-comments@lists.geany.org