[FIXED] AppletLoader al_logo and al_progressbar parameters should not be required

Started by arielsan, February 02, 2011, 16:31:46

Previous topic - Next topic

arielsan

AppletLoader al_logo and al_progressbar parameters should both have default values: appletlogo.png and appletprogress.gif, letting the user to avoid setting those on his <applet> tag unless he wants to override them. So, if someone uses default values, he will need less applet parameters.

The attached patch shows one possible impl.

arielsan


kappa

Yes, this was discussed briefly on IRC just after the 2.7 release but was a bit late to put it in.

I'm a tiny bit uncomfortable with hard coding file names into the code ("appletlogo.png" and "appletprogress.gif") and one of those supports animation (gif) and the others does not (maybe we can just make them both gif).

However the advantage here is pretty clear, it'll make the html code alot nicer and cleaner and it'll also be two parameters developers do not need to worry about until they are ready to customise the AppletLoader (making it easier to pick up).

Unless someone has good reasons why it shouldn't go in, I'd say it should go in.

arielsan

The patch is wrong a bit, it should be:

// load logos, if value is "" then skip
	logo 		= getImage(getParameter("al_logo", "appletlogo.png"));
	progressbar = getImage(getParameter("al_progressbar", "appletprogress.gif"));


without the check of:

if (getParameter("al_logo").length() > 0) {


and:

if (getParameter("al_progressbar").length() > 0) {


Sorry for that.

kappa

thx for the patch, this is now implemented.

al_logo and al_progress parameters are now optional and default to "appletlogo.gif" and "appletprogress.gif". This should make the appletloader easier and cleaner to use.

arielsan