Closed Bug 665603 Opened 8 years ago Closed 8 years ago

Centralise sound preferences

Categories

(SeaMonkey :: Preferences, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.4

People

(Reporter: iann_bugzilla, Assigned: iann_bugzilla)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

At the moment there is very similar code in pref-download.js, pref-popup.js and pref-notifications.js which could all be centralised into preferences.js and then called from the respective xul files.
This patch:
* Creates WriteSoundField, SelectSound and PlaySound functions in preferences.js
* Updates the relevant xul files to call these new functions instead.
* Removes unneeded code from the relevant js files, tweaking code where needed.
* Removes unneeded entities from pref-popups.dtd

This code depends on GetFileFromString helper which is part of bug 665569.
Attachment #540520 - Flags: review?(neil)
Assignee: neil → iann_bugzilla
Attachment #540520 - Flags: review?(neil) → review?(mnyromyr)
> +  var filterExts = "*.wav; *.wave";
> +  // On Mac, allow AIFF files too.
> +  if (/Mac/.test(navigator.platform))
> +    filterExts += "; *.aif; *.aiff";
Ah good show! I was going to mention Thunderbird Bug 491359.
Comment on attachment 540520 [details] [diff] [review]
centralise sound preferences [Checked in: Comment 3]

Review of attachment 540520 [details] [diff] [review]:
-----------------------------------------------------------------

::: suite/common/pref/preferences.js
@@ +71,5 @@
> +  var fp = Components.classes["@mozilla.org/filepicker;1"]
> +                     .createInstance(nsIFilePicker);
> +  var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
> +  fp.init(window, prefutilitiesBundle.getString("choosesound"),
> +          nsIFilePicker.modeOpen);

No need to wrap here, imo.
Attachment #540520 - Flags: review?(mnyromyr) → review+
Comment on attachment 540520 [details] [diff] [review]
centralise sound preferences [Checked in: Comment 3]

http://hg.mozilla.org/comm-central/rev/ae84f8b74c90
Attachment #540520 - Attachment description: centralise sound preferences → centralise sound preferences [Checked in: Comment 3]
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.4
Comment on attachment 540520 [details] [diff] [review]
centralise sound preferences [Checked in: Comment 3]

Review of attachment 540520 [details] [diff] [review]:
-----------------------------------------------------------------

::: suite/common/pref/pref-popups.js
@@ -40,4 @@
>  var gSoundUrlPref;
> -var gSelectSound;
> -
> -var gIOService;

http://mxr.mozilla.org/comm-central/source/suite/common/pref/pref-popups.js#60

Grr. :-(
Blocks: 822441
Blocks: 357097
You need to log in before you can comment on or make changes to this bug.