Centralise sound preferences

RESOLVED FIXED in seamonkey2.4

Status

SeaMonkey
Preferences
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: Ian Neal, Assigned: Ian Neal)

Tracking

(Blocks: 1 bug)

Trunk
seamonkey2.4
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 540520 [details] [diff] [review]
centralise sound preferences [Checked in: Comment 3]

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)

Updated

7 years ago
Assignee: neil → iann_bugzilla
(Assignee)

Updated

7 years ago
Attachment #540520 - Flags: review?(neil) → review?(mnyromyr)

Comment 1

7 years ago
> +  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 2

7 years ago
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+
(Assignee)

Comment 3

7 years ago
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]
(Assignee)

Updated

7 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 7 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. :-(
(Assignee)

Updated

5 years ago
Blocks: 822441

Updated

3 years ago
Blocks: 357097
You need to log in before you can comment on or make changes to this bug.