Thread Closed

#1
And I was about to file a bug with Tb.. since custom toolbars is just so obvious a feature.

Anyway, on Cancel any buttons dragged to a custom toolbar remain, yet are removed only from the 2 standard toolbars.
ReportQuote
#2
Nope that is a Thunderbird bug, well a Firefox one at any rate. Most of the code that makes the custom toolbars work in Thunderbird is already there and part of the default toolbar functionality. I did little more than place the "Add New Toolbar" button in the customize toolbar window.

It really needs to be fixed with in Thunderbird and Firefox not by some temporary hack, please to file the bug report.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#3
i guess you're using addcustomtoolbar code. do they represent that this is a complete published working api? they don't add the button themselves because perhaps it isn't ready or meant to be used this way.

in this case, it's up to you to make it work, if you choose to provide a button. or request them to finalize the api before attempting to use it.
ReportQuote
#4
You missed the point. The button is in Firefox, and the same bug exists, tell them it is broken in Firefox and you should see the fix in Thunderbird too. There are quite a number of problems with the Firefox custom toolbar implementation (such as you can't hide them they come back as soon as you restart Firefox) and I don't want to fix them all. To fix it I would need to modify some core Firefox/Thunderbird files and that would come at a certain risk that I don't want to take. Being in grade 12 is also severally hampering any of my attempts to do anything :(
Since the api is in Firefox and is exactly the same in Thunderbird minus the button I would presume it to be "finalize".

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#5
yes, you are correct that it exists in Fx. but Fx has cheated and removed the Cancel button rather than fix the core problems. Tb has forked Customize and now has its own version (bug 363208) with Cancel and without Add. and i hear Sunbird/Lightning now has created their own version - so it's one big mess.

if i may throw out a general idea - perhaps you could create the buttons using the CustomButtons framework? people could have the same Customize dnd behavior, but with the big benefit of being able to tweak button behavior. CB is great but it's nicer to have a starting point - and an icon! just a thought..

anyway, best of luck in school. the buttons project is really useful, one of the first things to add in a new install.
ReportQuote
#6
Hum, maybe I should just hide the cancel button then :P the version of Sunbird I have installed (0.3 I should really update it but I don't use it) copies Firefox. Though the window sizes its self in an annoying way. I knew I was getting in hot water when it all seamed to easy to add.

When you mean use the CustomButtons framework, are you talking about adding it to this http://codefisher.org/toolbar_button/toolbar_button_maker ? The problem is many of the buttons use methods that can't be done in CB with out rewriting much of the code (in a very ugly way) and the only solution would be to make my own CustomButtons extension that works differently. I better shut up :D

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#7
well, it's your button and it is sorta broken.. for sure due to Customize being a mess.

hey, that's a very nice way to build your own button pack. but no i meant that each button's code/icon, instead of being closed, could be exposed for edit like CustomButtons are. so if your button command is restart(); then using CB one could see that, and perhaps edit it to alert("restart"); restart();. while the button pack builder is finite customization, this would really be infinite customization.

you'd still make the buttons/icons, and even package/release them the same way, but the code would be visible. right now there are really very few buttons for the new CB. and they've built a very nice infrastructure for button code maintenance etc.

not sure what you mean by rewriting the button code it should be exactly the same in CB..no?
ReportQuote
#8
Yes the button is kind of mine, but for a none essential feature in a mirror extension I am not going to spend hours patching it. Two of my other extensions get over 100 times the number of downloads between them, I would far rather spend time working on them.

If only the code for the restart button was that simple, I have pasted at the end of this post the function that I had to write to do it.

The code for the buttons in some cases would be the same but there are a number of things that would create havoc. One would be the calls to the translated strings, CB has no way of including them. The extension contains a file (like many others do) that creates a number of preferences and assigns a default value to them. If they don't exist many of the buttons would error out when the preference was requested. CB only allows you to use one image, some of the buttons use a few images to indicate that the action has been preformed (such as the toggle flash/movies/html buttons). You can see I have added comments to the code below to indicate a few lines that would not work

I realize though that being able to do what you want would be very useful, and the reason I made my online custom bottom maker. I do plan to take it to the next step and build a extension that implements a completely new frame work for creating custom buttons with a lot of added flexibility.

/* Restart Application */
function restartMozilla() {
  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
	.getService(Components.interfaces.nsIPromptService);

		var prefs = Components.classes["@mozilla.org/preferences-service;1"].
		getService(Components.interfaces.nsIPrefBranch);

	if(prefs.getBoolPref("extension.tbutton.restart") != true){  // Not would in CB
		 var stringsBundle = document.getElementById("string-bundle"); // Not would in CB

		var restartQuestion = stringsBundle.getString("restart-question"); // Not would in CB
			var dontAsk = stringsBundle.getString("dont-ask"); // Not would in CB
			var restartTitle = stringsBundle.getString("restart"); // Not would in CB
		var check = {value: false}; 
		var result = promptService.confirmCheck(null, restartTitle, restartQuestion, dontAsk, check);
		prefs.setBoolPref("extension.tbutton.restart", check.value); 
		if(result == true){
		  var restart = true;
		} else {
		  var restart = false;
		}
	} else {
		var restart = true;
	}

	if(restart == true) {
		a=Components.interfaces.nsIAppStartup,Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(a).quit(a.eRestart | a.eAttemptQuit);
		a.focus();
	}
}

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote
#9
re CB: i think it'd be more efficient to leverage CB than recreate that functionality in a new extension.. reinvent the wheel and all.

CB does have multiple images per button functionality (via data:image or do you mean multiple images in a .png). and certainly accesses nsIPrefBranch and any document element.

what i'm suggesting is when you install your button pack extension, the button code is in CB format and merely appended to the CB buttonsoverlay.xul file as a <toolbarbutton> entry. take a look at the file in your profile.. you then also install any prefs and strings just like now. so your code above would barely change, maybe you'd define the function in Init tab and run it in Code tab. just make sure the user knows CB must be installed first, or you can do a twofer deal etc.

and i'm sure if you asked CB they would be glad to include the things you need. you've got button cred for sure plus they're pretty good about things.

take the easier road!
ReportQuote
#10
Depending on another extension is always a bad idea, I have done so with MinimizeToTray Enhancer and I regret it. If a person wants to edit my extension they can unpack it and do what they like to all the text files it contains. If you want to port my extension to CB format yourself go ahead, but be prepared to spend a few weeks working on it, I am not kidding it would take many many hours of hard work. And it would only appeal to a few geeky users. It would also make the extension larger and harder to maintain which is also another reason I would not do it. I have pushed CB as far as it can go, and know my extension inside out, the code would have to change quite a bit and I don't want to do that.

Reinventing the wheel to make 'tank tracks' might just be easier. Besides I have already done something like that in the Text Formatting Toolbar beta, so all I need to do it take it the little be further.

I realize it can access prefs, but if the pref does not exist, it dies.

Have I helped you? Do you like my add-ons?
Would you consider donating to show your appreciation for my efforts?

/images/paypal.png
ReportQuote

Thread Closed