Last Comment Bug 287111 - Change onpreferenceread/onpreferencewrite to onsyncfrompreference/onsynctopreference
: Change onpreferenceread/onpreferencewrite to onsyncfrompreference/onsynctopre...
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Preferences (show other bugs)
: unspecified
: All All
: P2 normal (vote)
: mozilla1.8beta3
Assigned To: Mano (::mano, needinfo? for any questions; not reading general bugmail)
: Nobody; OK to take it and work on it
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-21 13:17 PST by Ben Goodger (use ben at mozilla dot org for email)
Modified: 2005-07-08 16:36 PDT (History)
4 users (show)
benjamin: blocking1.8b3+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (26.93 KB, patch)
2005-06-27 01:12 PDT, Mano (::mano, needinfo? for any questions; not reading general bugmail)
mconnor: first‑review+
mscott: second‑review+
benjamin: approval‑aviary1.1a2+
Details | Diff | Review

Description Ben Goodger (use ben at mozilla dot org for email) 2005-03-21 13:17:29 PST
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.
Comment 1 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2005-06-27 00:26:00 PDT
Now or never.
Comment 2 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2005-06-27 01:12:10 PDT
Created attachment 187377 [details] [diff] [review]
patch
Comment 3 Mike Connor [:mconnor] 2005-06-27 08:19:54 PDT
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
Comment 4 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2005-06-27 08:23:02 PDT
Comment on attachment 187377 [details] [diff] [review]
patch

OK, thanks.
Comment 5 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2005-06-28 06:37:40 PDT
Scott, could you please review the mail/ part of this patch? We should land it
before b3.
Comment 6 Mano (::mano, needinfo? for any questions; not reading general bugmail) 2005-06-28 13:09:19 PDT
fixed.
Comment 7 Nickolay_Ponomarev 2005-07-08 16:36:08 PDT
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

Note You need to log in before you can comment on or make changes to this bug.