Change onpreferenceread/onpreferencewrite to onsyncfrompreference/onsynctopreference

RESOLVED FIXED in mozilla1.8beta3

Status

()

Toolkit
Preferences
P2
normal
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: Ben Goodger (use ben at mozilla dot org for email), Assigned: mano)

Tracking

unspecified
mozilla1.8beta3
Points:
---
Bug Flags:
blocking1.8b3 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

When you write XUL using the new preference system:

<checkbox onpreferenceread="return foo();"
          onpreferencewrite="return bar();"/>

onpreferenceread:
  "initialize this element's .value with the value returned from this function
   or the default value from preferences, if this function returns undefined."
onpreferencewrite:
  "save state to the applicable <preference> element, using the value returned
   by this function, or the default .value of this element if the function
   returns undefined."

These method names are a little confusing and hard to wrap your head around,
even though they're sort of accurate.

A better set of names would be:

onsyncfrompreference / onsynctopreference

These names are *more* accurate, and a little easier to understand. 

I would like to get this change before Firefox 1.1 and people start relying on
the old names.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta2
Now or never.
Flags: blocking1.8b3?
Target Milestone: mozilla1.8beta2 → mozilla1.8beta3
Created attachment 187377 [details] [diff] [review]
patch
Assignee: bugs → bugs.mano
Attachment #187377 - Flags: second-review?(mscott)
Attachment #187377 - Flags: first-review?(mconnor)
Comment on attachment 187377 [details] [diff] [review]
patch

r=me, but please also update the various wiki docs on the prefwindow binding.

also, there's a typo buried in the patch you need to fix

@@ -269 +269 @@
-	       <menuitem value="20" label="20"/>
+	       <menuitem value="20" label="20"/>w
Attachment #187377 - Flags: first-review?(mconnor) → first-review+
Comment on attachment 187377 [details] [diff] [review]
patch

OK, thanks.
Attachment #187377 - Flags: approval-aviary1.1a2?
Scott, could you please review the mail/ part of this patch? We should land it
before b3.
Flags: blocking1.8b3? → blocking1.8b3+
Whiteboard: needs review mscott

Updated

12 years ago
Attachment #187377 - Flags: second-review?(mscott) → second-review+
Attachment #187377 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: needs review mscott

Comment 7

12 years ago
Is there any reason you decided to keep event's type "preferenceread" and
"preferencewrite"?

http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/preferences.xml#329
You need to log in before you can comment on or make changes to this bug.