diff --git a/locales/en-US/chrome/chatzilla.properties b/locales/en-US/chrome/chatzilla.properties --- a/locales/en-US/chrome/chatzilla.properties +++ b/locales/en-US/chrome/chatzilla.properties @@ -1687,19 +1687,19 @@ pref.group.global.header.label = pref.group.global.header.help = Sets the default visibility for headers of views. Each view can override this default if necessary. pref.group.global.links.label = Links pref.group.global.links.help = The link preferences define how ChatZilla reacts to different kinds of clicks on links. You can re-arrange these to suit your preferences. pref.group.global.log.label = Log these view types pref.group.global.log.help = Sets the default logging state for views. Each view can override this default if necessary. pref.group.global.maxLines.label = Scrollback size pref.group.global.maxLines.help = The number of lines of text to keep in this view type. Once the limit is reached, the oldest lines are removed as new lines are added. pref.group.global.sounds.label = Sound Configuration -pref.group.global.sounds.help = -pref.group.global.soundEvts.label = Sound Events -pref.group.global.soundEvts.help = Sounds for certain client events. These preferences are a space-separated list of either "beep" or file: URLs. +pref.group.general.sounds.help = +pref.group.general.soundEvts.label = Sound Events +pref.group.general.soundEvts.help = Sounds for certain client events. These preferences are a space-separated list of either "beep" or file: URLs. # These are the prefs that get grouped # pref.autoperform.label = Auto-perform pref.autoperform.help = Enter any commands to be run when connecting to this network/joining this channel/opening this user's private chat. The commands are run in the order listed. pref.autoperform.channel.label = Channel pref.autoperform.channel.help = Enter any commands to be run when joining any channel. pref.autoperform.client.label = Client diff --git a/xul/content/prefs.js b/xul/content/prefs.js --- a/xul/content/prefs.js +++ b/xul/content/prefs.js @@ -212,24 +212,24 @@ function initPrefs() ["reconnect", true, ".connect"], ["websearch.url", "", "global"], ["showModeSymbols", false, "appearance.userlist"], ["sortUsersByMode", true, "appearance.userlist"], // Chat == "Activity" activity. // Event == "Superfluous" activity. // Stalk == "Attention" activity. // Start == When view it opened. - ["sound.channel.chat", "", "global.soundEvts"], - ["sound.channel.event", "", "global.soundEvts"], - ["sound.channel.stalk", "beep", "global.soundEvts"], - ["sound.channel.start", "", "global.soundEvts"], + ["sound.channel.chat", "", ".soundEvts"], + ["sound.channel.event", "", ".soundEvts"], + ["sound.channel.stalk", "beep", ".soundEvts"], + ["sound.channel.start", "", ".soundEvts"], ["sound.enabled", true, "global.sounds"], ["sound.overlapDelay", 2000, "global.sounds"], - ["sound.user.stalk", "beep", "global.soundEvts"], - ["sound.user.start", "beep beep", "global.soundEvts"], + ["sound.user.stalk", "beep", ".soundEvts"], + ["sound.user.start", "beep beep", ".soundEvts"], ["stalkWholeWords", true, "lists.stalkWords"], ["stalkWords", [], "lists.stalkWords"], ["tabLabel", "", "hidden"], ["tabGotoKeyModifiers", 0, "hidden"], ["timestamps", false, "appearance.timestamps"], ["timestamps.display", "[%H:%M]", "appearance.timestamps"], ["timestamps.log", "[%Y-%m-%d %H:%M:%S]", "hidden"], ["urls.display", 10, "hidden"], @@ -428,16 +428,22 @@ function getNetworkPrefManager(network) ["logFileName", makeLogNameNetwork, "hidden"], ["motif.current", defer, "appearance.motif"], ["nickname", defer, ".ident"], ["nicknameList", defer, "lists.nicknameList"], ["notifyList", [], "lists.notifyList"], ["outputWindowURL", defer, "hidden"], ["proxy.typeOverride", defer, ".connect"], ["reconnect", defer, ".connect"], + ["sound.channel.chat", defer, ".soundEvts"], + ["sound.channel.event", defer, ".soundEvts"], + ["sound.channel.stalk", defer, ".soundEvts"], + ["sound.channel.start", defer, ".soundEvts"], + ["sound.user.stalk", defer, ".soundEvts"], + ["sound.user.start", defer, ".soundEvts"], ["tabLabel", "", "hidden"], ["timestamps", defer, "appearance.timestamps"], ["timestamps.display", defer, "appearance.timestamps"], ["timestamps.log", defer, "hidden"], ["usermode", defer, ".ident"], ["username", defer, ".ident"] ]; @@ -515,16 +521,20 @@ function getChannelPrefManager(channel) ["displayHeader", client.prefs["channelHeader"], "appearance.misc"], ["font.family", defer, "appearance.misc"], ["font.size", defer, "appearance.misc"], ["hasPrefs", false, "hidden"], ["log", client.prefs["channelLog"], ".log"], ["logFileName", makeLogNameChannel, "hidden"], ["motif.current", defer, "appearance.motif"], ["outputWindowURL", defer, "hidden"], + ["sound.channel.chat", defer, ".soundEvts"], + ["sound.channel.event", defer, ".soundEvts"], + ["sound.channel.stalk", defer, ".soundEvts"], + ["sound.channel.start", defer, ".soundEvts"], ["tabLabel", "", "hidden"], ["timestamps", defer, "appearance.timestamps"], ["timestamps.display", defer, "appearance.timestamps"], ["timestamps.log", defer, "hidden"] ]; var branch = "extensions.irc.networks." + pref_mungeName(network.encodedName) + ".channels." + pref_mungeName(channel.encodedName) + "." @@ -571,16 +581,18 @@ function getUserPrefManager(user) ["displayHeader", client.prefs["userHeader"], "appearance.misc"], ["font.family", defer, "appearance.misc"], ["font.size", defer, "appearance.misc"], ["hasPrefs", false, "hidden"], ["log", client.prefs["userLog"], ".log"], ["logFileName", makeLogNameUser, "hidden"], ["motif.current", defer, "appearance.motif"], ["outputWindowURL", defer, "hidden"], + ["sound.user.stalk", defer, ".soundEvts"], + ["sound.user.start", defer, ".soundEvts"], ["tabLabel", "", "hidden"], ["timestamps", defer, "appearance.timestamps"], ["timestamps.display", defer, "appearance.timestamps"], ["timestamps.log", defer, "hidden"] ]; var branch = "extensions.irc.networks." + pref_mungeName(network.encodedName) + ".users." + pref_mungeName(user.encodedName) + "."; diff --git a/xul/content/static.js b/xul/content/static.js --- a/xul/content/static.js +++ b/xul/content/static.js @@ -1400,17 +1400,17 @@ function cycleView(amount) var destKey = (vk + amount) % len; /* wrap around */ if (destKey < 0) destKey += len; dispatch("set-current-view", { view: client.viewsArray[destKey].source }); } // Plays the sound for a particular event on a type of object. -function playEventSounds(type, event) +function playEventSounds(type, event, source) { if (!client.sound || !client.prefs["sound.enabled"]) return; // Converts .TYPE values into the event object names. // IRCChannel => channel, IRCUser => user, etc. if (type.match(/^IRC/)) type = type.substr(3, type.length).toLowerCase(); @@ -1419,20 +1419,22 @@ function playEventSounds(type, event) if (type == "dccchat") type = "user"; var ev = type + "." + event; if (ev in client.soundList) return; - if (!(("sound." + ev) in client.prefs)) + var src = source ? source : client; + + if (!(("sound." + ev) in src.prefs)) return; - var s = client.prefs["sound." + ev]; + var s = src.prefs["sound." + ev]; if (!s) return; if (client.prefs["sound.overlapDelay"] > 0) { client.soundList[ev] = true; setTimeout("delete client.soundList['" + ev + "']", @@ -2891,21 +2893,21 @@ function setTabState(source, what, callb /* We want to play sounds if they're from a non-current view, or we don't * have focus at all. Also make sure stalk matches always play sounds. * Also make sure we don't play on the 2nd half of the flash (Callback). */ if (!callback && (!window.isFocused || !current || (what == "attention"))) { if (what == "attention") - playEventSounds(source.TYPE, "stalk"); + playEventSounds(source.TYPE, "stalk", source); else if (what == "activity") - playEventSounds(source.TYPE, "chat"); + playEventSounds(source.TYPE, "chat", source); else if (what == "superfluous") - playEventSounds(source.TYPE, "event"); + playEventSounds(source.TYPE, "event", source); } // Only change the tab's colour if it's not the active view. if (!current) { var state = tb.getAttribute("state"); if (state == what) { @@ -3547,17 +3549,17 @@ function syncOutputFrame(obj, nesting) dd("caught exception showing session view, will try again later."); dd(dumpObjectTree(ex) + "\n"); setTimeout(tryAgain, 500, nesting + 1); } } function createMessages(source) { - playEventSounds(source.TYPE, "start"); + playEventSounds(source.TYPE, "start", source); source.messages = document.createElementNS(XHTML_NS, "html:table"); source.messages.setAttribute("class", "msg-table"); source.messages.setAttribute("view-type", source.TYPE); source.messages.setAttribute("role", "log"); source.messages.setAttribute("aria-live", "polite"); var tbody = document.createElementNS(XHTML_NS, "html:tbody");