MozillaZine

Per-Extension Preferences

Talk about add-ons and extension development.
cdn

User avatar
 
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK

Post Posted February 1st, 2003, 4:42 am

Extension Options dialogue box has no title ?

comes up as 'phoenix-bin' for my cvs build

because, you have to set it yourself in the <dialog title=""/> : )

note to self [ : ) ] - read the diff posted by ben
Last edited by cdn on February 1st, 2003, 8:26 am, edited 1 time in total.

ehume

User avatar
 
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted February 1st, 2003, 8:12 am

djst wrote:
Code: Select all
______________________________________
| Settings for <ExtensionName>    [X]|
|____________________________________|
|                                    |
| [ ] Checkbox 1                     |
| (*) Radio 1                        |
| ( ) Radio 2                        |
|                                    |
|  (or whatever the author wants     |
|   to have here...)                 |
|                                    |
|                                    |
| Author: <AuthorNameOrLink>         |
| __________________________________ |
|                                    |
|                  [  OK  ] [Cancel] |
|____________________________________|
Please make sure that you include the name and version number of the extension in the template. That way, an absent-minded user like me will know if I need to upgrade if I can't remember whether the version I have is the same as the newest version that is out.

djst
Moderator

User avatar
 
Posts: 2826
Joined: November 5th, 2002, 1:34 am
Location: Sweden

Post Posted February 1st, 2003, 8:14 am

ehume wrote:Please make sure that you include the name and version number of the extension in the template. That way, an absent-minded user like me will know if I need to upgrade if I can't remember whether the version I have is the same as the newest version that is out.

I didn't get the impression that my "template" idea was accepted though, or did I miss something?

David James

User avatar
 
Posts: 1321
Joined: November 4th, 2002, 10:19 pm
Location: Ottawa, Ontario, Canada

Post Posted February 1st, 2003, 7:50 pm

bengoodger wrote:OK folks, I'm done with my patch and I'm going to try and land soon. To give you an idea of what it takes to update an extension to use this new scheme I've updated my tab downloader add-on to v2.02 so that it supports this. The diff that describes the changes I had to make to convert my pref panel into a settings dialog are here:

http://www.bengoodger.com/software/tabl ... ialog.diff

mboullet - I see now what you mean by it being a bit trickier - before you could just use the pref dialog's automated saving scheme to save your changes.. and I can see how supporting both systems might be a bit more complex now. However, here's a thought:

Create a pref panel file - and put the script in it that interacts with Mozilla's automated pref system

Ok, so this pref panel file should basically be the same pref overlay file that already exists in most extensions, right?
Create a dialog file - and put script in that that saves the prefs itself.

Create an overlay file that overlays into each, containing XUL and script that will be the same between the two.

It's here that you lose me... I need a new dialog file that produces a window as suggested by djst and cdn? and it needs some script to save the prefs (which I don't know how to code - I'm an Economics major, not a Comp Sci major :) ). Then I need another overlay file? Why? Why not just overlay the preferences file into the dialog file and then reference that dialog file in contents.rdf?
Pinball-Firefox maintainer.
http://david.jamesnet.ca/
Debian Sid, KDE 3.3

David James

User avatar
 
Posts: 1321
Joined: November 4th, 2002, 10:19 pm
Location: Ottawa, Ontario, Canada

Post Posted February 1st, 2003, 9:36 pm

To save the preferences is there not some existing javascript function that we can call upon, or am I missing something? After all, before extensions didn't require any special functions to save settings changes, it just used the Preferences 'OK' button to do that? If that's the case then it would certainly make building a template easier, as well as reducing the size of extensions.
Pinball-Firefox maintainer.
http://david.jamesnet.ca/
Debian Sid, KDE 3.3

cdn

User avatar
 
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK

Post Posted February 2nd, 2003, 6:40 am

David James wrote:
bengoodger wrote:Create a dialog file - and put script in that that saves the prefs itself.

Create an overlay file that overlays into each, containing XUL and script that will be the same between the two.

It's here that you lose me... I need a new dialog file that produces a window as suggested by djst and cdn? and it needs some script to save the prefs (which I don't know how to code - I'm an Economics major, not a Comp Sci major :) ). Then I need another overlay file? Why? Why not just overlay the preferences file into the dialog file and then reference that dialog file in contents.rdf?


I think ben might be talking about an overlay for Moz/Px extensions specific to Moz ?

David James wrote:To save the preferences is there not some existing javascript function that we can call upon, or am I missing something? After all, before extensions didn't require any special functions to save settings changes, it just used the Preferences 'OK' button to do that? If that's the case then it would certainly make building a template easier, as well as reducing the size of extensions.


you used to be able to use the prefs dialogue's js to save your prefs, but now that the prefs are in a separate window, they can no longer be seen by that js, hence needing to write your own, I already did this for the checkboxes that overlay the 'customize toolbar' dialogue for Compact Menu

Stefan

User avatar
 
Posts: 2051
Joined: November 5th, 2002, 2:46 am

Post Posted February 2nd, 2003, 8:21 am

cdn wrote:
David James wrote:To save the preferences is there not some existing javascript function that we can call upon, or am I missing something? After all, before extensions didn't require any special functions to save settings changes, it just used the Preferences 'OK' button to do that? If that's the case then it would certainly make building a template easier, as well as reducing the size of extensions.


you used to be able to use the prefs dialogue's js to save your prefs, but now that the prefs are in a separate window, they can no longer be seen by that js, hence needing to write your own, I already did this for the checkboxes that overlay the 'customize toolbar' dialogue for Compact Menu


Hmm, to not be able to "tap into" the built in JS functions seems like it's adding unnessecary bloat and complexity to extensions. Then again it might be tivial to add your own code (?)

David James

User avatar
 
Posts: 1321
Joined: November 4th, 2002, 10:19 pm
Location: Ottawa, Ontario, Canada

Post Posted February 2nd, 2003, 9:26 am

Stefan wrote:Hmm, to not be able to "tap into" the built in JS functions seems like it's adding unnessecary bloat and complexity to extensions. Then again it might be tivial to add your own code (?)

That's exactly my concern, that we've just made extension building for Phoenix that much more complicated (and therefore, less likely to occur). But if we could "tap into" the existing functions somehow then it would not be that difficult to build a template settings dialog for extension authors to employ into which an existing extension prefs overlay could overlay in Phoenix.
Pinball-Firefox maintainer.
http://david.jamesnet.ca/
Debian Sid, KDE 3.3

mariomartinez

User avatar
 
Posts: 9
Joined: January 25th, 2003, 8:41 pm

Post Posted February 2nd, 2003, 12:35 pm

Hi:
Since this topic is related to new builds and I don't want to create a new post just in case this a stupid question.

When I install an extension in a new build, I don't see the extension preferences.
I tried installing the tab extensions on today's build and I don't know how to customize it.
Is the extension not up to date with build changes?

Thank you
Mario

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted February 2nd, 2003, 12:51 pm

mariomartinez wrote:Hi:
Since this topic is related to new builds and I don't want to create a new post just in case this a stupid question.

When I install an extension in a new build, I don't see the extension preferences.
I tried installing the tab extensions on today's build and I don't know how to customize it.
Is the extension not up to date with build changes?

Thank you
Mario


Nope. Ben moved stuff all around and everything is currently unconfigurable. 20030131 was the last one that worked ok, afaik.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files

Chris Cook

User avatar
 
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada

Post Posted February 2nd, 2003, 12:51 pm

mariomartinez wrote:Is the extension not up to date with build changes?

That is correct. Most themes will need to be updated to fit into the new options scheme. So far only about 2 extensions have been updated (compact menu and tabbed downloader).

cdn

User avatar
 
Posts: 999
Joined: November 4th, 2002, 5:47 pm
Location: UK

Post Posted February 2nd, 2003, 12:57 pm

Chris Cook wrote:
mariomartinez wrote:Is the extension not up to date with build changes?

That is correct. Most themes will need to be updated to fit into the new options scheme. So far only about 2 extensions have been updated (compact menu and tabbed downloader).


and just to dash everyone's hopes...

Compact Menu only has the instruction 'this is what to use for prefs', it doesn't actually work in the 20030201 release

I have a bigger problem : http://www.mozillazine.org/forums/viewtopic.php?t=5326
(unless it's related to the toolbar customise horkage) : http://www.mozillazine.org/forums/viewtopic.php?t=5344

David James

User avatar
 
Posts: 1321
Joined: November 4th, 2002, 10:19 pm
Location: Ottawa, Ontario, Canada

Post Posted February 2nd, 2003, 9:06 pm

This is getting quite frustrating. I can't even create a simple dialog with the necessary script to actually make the OK button do something, like, say, close the damned dialog and save any preferences that might have been changed.

I am starting to have serious reservations about this whole per-extension preferences thing. I used to be able to convert a Mozilla-only extension to work with Phoenix in 10 minutes or so, including hooking into the preferences. I can still make them work, but now with no means of configuring them in any way. Like I wrote earlier, I'm an Economics major, not Comp. Eng., so everything I learn here has no use whatsoever in my studies; it's all on the side and I don't particularly want to learn javascript right now. Over the years, in addition to learning how an economy works, I've managed to learn how to use Linux, how to script HTML and some CSS, a little XUL, LaTeX and probably a couple of other minor things along the way but javascript, I simply don't have the time for right now. My training as an economics major is telling me that this extensions preferences concept is increasingly a waste of time. Now extension authors have to jump through another hurdle to convert their extensions to Phoenix; before I could do it myself and send them a patch -- now I can't. And this is assuming that extensions can be made to work in both Mozilla and Phoenix.

What we need to be able to do is this:

Have a template dialog (which can be posted at XUL Planet, mozdev.org and other sites) with the necessary javascript for the Ok button to implement any changes the user makes. That javascript must be universal like it was with the old preferences dialog; requiring each author to create a whole slew of extension-specific javascript is simply not on -- that will only bloat up extensions for no good reason and decrease the likelihood of extension authors to support Phoenix. The dialog must also have an overlay point, so that the existing extensions preferences .xul can be called from there with the usual chrome://goatifier/content/prefOverlay.xul type of thing, allowing the extension to support Phoenix and Mozilla at the same time. With such a template dialog in hand, reasonably able people like me should again be able to continue converting Moz extensions to Phoenix. Basically, the only thing that would need to be done is to specify the location of the chrome://goatifier/content/prefOverlay.xul type file.

If such a template dialog can't be created then we should seriously reconsider the direction in which we're heading with this per-extension preferences concept.
Pinball-Firefox maintainer.
http://david.jamesnet.ca/
Debian Sid, KDE 3.3

richwklein
 
Posts: 331
Joined: November 24th, 2002, 8:20 pm
Location: Iowa

Post Posted February 3rd, 2003, 8:22 am

It is not that difficult to set preferences with javascript. However, it does make sense to have some sort of re-usable dialog.

maubp
 
Posts: 281
Joined: December 5th, 2002, 12:36 pm
Location: UK

Post Posted February 3rd, 2003, 9:35 am

ehume wrote:Please make sure that you include the name and version number of the extension in the template. That way, an absent-minded user like me will know if I need to upgrade if I can't remember whether the version I have is the same as the newest version that is out.

I would go one step further - extension version number should be at the same top level as "Name", "Description" and "Author", and be shown on the Extensions page of the options.

In fact I think this should apply to themes as well.
Peter

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests