On Mon, Aug 08, 2005 at 09:07:55PM -0400, Adam Hooper wrote: >On Mon, 2005-08-08 at 22:19 +0100, Magnus Therning wrote: >>Is there such an extension somewhere that I can use as a guide for >>performing the same sort of magic? >> >>I have an extension that needs some configuration by the user and I >>think it'd be best to include that configuration in the preferences >>dialogue rather than add a new extension-specific preferences >>dialogue. > >No, this hasn't been done before. You can use >ephy_shell_get_prefs_dialog() to start. I've played with the Python >Console a bit, and here's what I came up with. I suggest you open the >Python Console and type in the following to see what happens at each >step: [..] Thanks for your pointers I'll do some experimenting and see where it leads me :-) >I've just got to reiterate the general caution I always give when people >talk about adding preferences: do you really NEED to do it? That dialog >doesn't really look nice with more than 4 tabs... and if *you* add that >to your extension, everybody else will start doing it, too :). Imagine >the prefs dialog with 7-8 tabs: it'd be a disaster. Yes. I do see your point. At the moment the configuration that my extension needs is done at install time. It's done in the source. Clearly not a very good thing in the long run either. What I need the user to enter: Username Password A keyword It'd be cool to be able to put the password in the built-in password manager, but I've decided to leave that for later (unless someone can offer some pointers :-) In the current form the extension can only handle one account, but I'm planning on adding the ability to handle several accounts, simultaneously. This would mean that a one-off configuration isn't enough. However, I might go for a one-off configuration (at the time the extension is activated) initially, just to minimize the work I'm required to do to make my extension even remotely usable :-) >Though I do wonder if we should add some helper APIs for preferences. I >forget how EphyDialog works, but I don't think there's a simple way to >add new widgets and have them auto-connect to GConf -- at least, not >with the EphyDialog API. Maybe there's some other simple utility >function in GConf or egg which does it. I'm too lazy to look into any >of this now. On a related note. Should I use GConf to store my extensions settings (state)? Where do I put them? Is there a rule on this? I'm considering /apps/epiphany/extensions/<my extension>/. Any thoughts on this? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus therning org http://therning.org/magnus Software is not manufactured, it is something you write and publish. Keep Europe free from software patents, we do not want censorship by patent law on written works. Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems. -- Jamie Zawinski
Attachment:
pgpUfuY90iuS2.pgp
Description: PGP signature