Would like to write a Creative Commons generating plugin
I would like to write a Creative Commons generating plugin, however it seems at the time you can't edit the copyright part of the score? Is there plans to add support for editing that as a string, like the composer and title, etc.?
For the time being I may try to make one where the user has to copy and paste the outcome, but I'd like to be able to have the plugin automatically edit the copyright string value.
Comments
I decided to write the plugin to generate a Creative Commons license, and just have the user copy and paste the license into the Copyright section, however I'm running into a problem. When I run things like " if(form.myQRadioButton.checked) { some code} ", nothing happens, in fact I can not access anything using the form.someQuiObject. I know I initialized the QT UI correctly, because if I don't try to access anything it starts up just find, I can click the buttons, and I can get initialization from the OK button, using " form.buttonBox.accepted.connect(accept); ", but any time I try to access anything else it simply doesn't work. Do you need to create signals and slots for them? Because when I was looking through some of the other plugins like the Scales plugin, they don't seem to have them.
Any help is appreciated, thanks.
If someone could maybe make a very simple test to see if they can get feedback from a UI, like an if statement for a QRadioButton.checked, it should return a boolean. I don't seem to be doing anything wrong, I can't test the Scales plugin, it is having an irrelevant error. Maybe this is a bug with the latest MuseScore? If someone could confirm for me that you can in fact get a response from a form.someObject, like form.someQTextObject.setText or something, because I simply can not get it to work.
Thanks again.
In reply to If someone could maybe make a by KoRnKloWn
Signals / Slots are used if you want your plugin to be aware of the state change in "real time". If not you don't need them. If you used a layout in your UI file, it could be that you need to add it in the hierarchy to get the checkbox so something like
form.someLayout.someObject
Maybe you could attach the UI file? Btw, if you are familiar with github (http://github.com) it could be a good place to host your plugins. I put mine on http://github.com/lasconic
In reply to Signals / Slots are used if by [DELETED] 5
OK, I got it, it was because of the hierarchy, I tried it before, but it's because I was looking at the hierarchy in QT Designer, and it shows gridLayout, not gridLayoutWidget, once I added widget to the name it works fine! Thanks, I wouldn't have thought to look at that in more detail if you hadn't pointed it out.
Once I write more plugins, and eventually when I write more advanced programs (at least in Java), I may create a github account, but for now I only have the two plugins.
Just finished my plugin, and it seems to work great, I'll upload it now, so you can find it in the plugin area.
In reply to Just finished my plugin, and by KoRnKloWn
I tested your plugin and I got an error dialog on startup. You should remove the onClose property.
Regarding the plugin itself. I'm not sure to understand the following sentence. As a CC user, I miss the name of the guy I should attribute if I reuse this work. Did you used http://creativecommons.org/choose/?lang=en as a reference ?
"Licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported License
Based on test by nicolas".
In reply to I tested your plugin and I by [DELETED] 5
Strange, I never got that error message? I'll look at it, and remove the part you are referring to later tonight.
For reference I used the standard Creative Commons generator at the link you posted, along with some creative commons sheet music I found online, I changed the wording to something that fits a license for sheet music. You don't put your own name or the name of the work because those are already on the score, the name and title are to attribute to someone else if you based your score off of someone else's music. If you hover over the 3 text boxes in the plugin there are tool tips that say what they are for.
In reply to I tested your plugin and I by [DELETED] 5
OK, I removed the onClose thing (I was originally going to but completely forgot), and I added a blank init() function just to make sure it won't throw an error message to anyone for that. Not sure why it was even giving you an error message though, because it wasn't for me o_O
What do you mean when you say you can't edit the copyright area? Do you mean double clicking the copyright message at the bottom of the score doesn't put you into edit mode as it does for other text elements, or what?
In reply to What do you mean when you say by Marc Sabatella
I think he means you can't edit copyright text from the plugin framework
In reply to I think he means you can't by [DELETED] 5
That's exactly what I mean.