Closed
Bug 342988
Opened 18 years ago
Closed 18 years ago
Allow plugins to rebuild menu(s) after changing client.menuSpecs
Categories
(Other Applications :: ChatZilla, defect)
Other Applications
ChatZilla
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bugzilla-mozilla-20000923, Assigned: Gijs)
References
(Blocks 1 open bug)
Details
(Whiteboard: [cz-0.9.76][cz-0.9.78])
Attachments
(3 obsolete files)
To allow for plugins to modify the menus when they load/unload, we need to allow them to trigger a rebuild of all the menus (on all windows once bug 76175 is done). I'm thinking: client.menuManager.updateMenus(); which can be called after any change to client.menuSpecs to sync things (only one way). We should get plugins into the habit of calling this as soon as possible, so that when we get to the new ChatZilla service code and multiple windows stuff, it actually works for most existing plugins.
Reporter | ||
Comment 1•18 years ago
|
||
After some discussion in #chatzilla, it was decided that allowing an array of menuSpec keys as an optional parameter is wise. This would allow the plugin to only trigger the updating on menus it knew it had changed (including ones it has added and/or removed).
Reporter | ||
Updated•18 years ago
|
Assignee: rginda → silver
Assignee | ||
Comment 2•18 years ago
|
||
Taking this for a bit; I think this patch will do, it sufficed in my testing, but given that I wrote the 'fun' bits while in a conference (being mildly distracted at times) it might need some care.
Assignee: silver → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #239501 -
Flags: review?(silver)
Assignee | ||
Comment 3•18 years ago
|
||
Argh. I want a 'keep assignee CC-ed' field. Seriously.
Assignee | ||
Comment 4•18 years ago
|
||
Patch with a different API, in a different place.
Attachment #239501 -
Attachment is obsolete: true
Attachment #243909 -
Flags: review?(silver)
Attachment #239501 -
Flags: review?(silver)
Reporter | ||
Comment 5•18 years ago
|
||
Comment on attachment 243909 [details] [diff] [review] [checked in w/ nits] Better patch >+ if (!menu.parentNode) >+ parentNode.insertBefore(menu, beforeNode); >+ I'm going to trust you that the code works, but can we at least have a comment for why this moved? r=silver with that commented.
Attachment #243909 -
Flags: review?(silver) → review+
Assignee | ||
Comment 6•18 years ago
|
||
Fixed with additional comment: Checking in mozilla/extensions/irc/js/lib/menu-manager.js; /cvsroot/mozilla/extensions/irc/js/lib/menu-manager.js,v <-- menu-manager.js new revision: 1.9; previous revision: 1.8 done Checking in mozilla/extensions/irc/xul/content/static.js; /cvsroot/mozilla/extensions/irc/xul/content/static.js,v <-- static.js new revision: 1.213; previous revision: 1.212 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•18 years ago
|
Whiteboard: [cz-0.9.76]
Assignee | ||
Comment 7•18 years ago
|
||
So, there's a small problem which Toast and I stumbled upon when writing a new version of ChattyTunes: 1. Write a plugin that adds a new menuspec 2. run client.updateMenus("mainmenu:yourmenu") in your enable code. 3. Autoload your plugin 4. Your menu is duplicated. This is, afaict, because right now createMenus doesn't really give a shit if your menu is there already, it'll just re-add all the items! Oops. I'm curious whether it will live if one just replaces calls to createMenus with updateMenus, but I can try that later.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 8•18 years ago
|
||
The original plan was that calls to client.updateMenus would do nothing if they were called before initMenus() or whatever it is that creates the initial set. That's what needs to happen here.
Assignee | ||
Comment 9•18 years ago
|
||
Well, yeah. That was fairly straightforward. Prevented any problems from showing on ChattyTunes on Fx 2.0 w/ CZ trunk + this patch.
Attachment #247732 -
Flags: review?(silver)
Assignee | ||
Updated•18 years ago
|
Attachment #243909 -
Attachment description: Better patch → [checked in w/ nits] Better patch
Attachment #243909 -
Attachment is obsolete: true
Reporter | ||
Updated•18 years ago
|
Attachment #247732 -
Flags: review?(silver) → review+
Assignee | ||
Comment 10•18 years ago
|
||
Checking in mozilla/extensions/irc/xul/content/static.js; /cvsroot/mozilla/extensions/irc/xul/content/static.js,v <-- static.js new revision: 1.220; previous revision: 1.219 done
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Attachment #247732 -
Attachment description: Patch to fix it not to do anything on startup → [checked in] Patch to fix it not to do anything on startup
Attachment #247732 -
Attachment is obsolete: true
Reporter | ||
Updated•18 years ago
|
Whiteboard: [cz-0.9.76] → [cz-0.9.76][cz-0.9.78]
You need to log in
before you can comment on or make changes to this bug.
Description
•