From d73eacfaa078b0781f0324ac1dedbf09b66cedad Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 26 Apr 2010 03:54:04 +0000 Subject: [PATCH] create a sound timer/queue in menu_frame that gets inherited by child interfaces, and don't let it grab the one from data.xul if we try to share xulG._sound from window 1 with window 2, and window 1 is destroyed, the sound object no longer works correctly (it loses reference to the 'urls' variable and cannot find the sounds to play). May try a common sound file from data.xul later. As it is now, sound behavior between window 1 and window 2 is slightly different with fancy prompt on my workstation. In window 2, a sound queued before fancy prompt starts to play before the popup and then gets clipped. In window 1, the fancy prompt sound obj takes over the queue and plays the sound without clipping git-svn-id: svn://svn.open-ils.org/ILS/trunk@16294 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/main/menu.js | 4 +++- Open-ILS/xul/staff_client/server/main/data.xul | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 6cb2fd4d75..33dfac5e71 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -10,7 +10,7 @@ main.menu = function () { offlineStrings = document.getElementById('offlineStrings'); JSAN.use('util.error'); this.error = new util.error(); JSAN.use('util.window'); this.window = new util.window(); - JSAN.use('util.sound'); this.sound = new util.sound(); + JSAN.use('util.sound'); this.sound = new util.sound({'interval':500,'sig':'menu_constructor'}); JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'}); this.w = window; @@ -149,6 +149,8 @@ main.menu.prototype = { 'chrome,resizable'); netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); mframe.xulG = xulG; + /* This window should get its own objects for these */ + delete mframe.xulG['_sound']; delete mframe.xulG['_data']; } ], 'cmd_new_tab' : [ diff --git a/Open-ILS/xul/staff_client/server/main/data.xul b/Open-ILS/xul/staff_client/server/main/data.xul index e82eaec82b..6ca97b11e0 100644 --- a/Open-ILS/xul/staff_client/server/main/data.xul +++ b/Open-ILS/xul/staff_client/server/main/data.xul @@ -230,6 +230,7 @@ + '?server='+window.escape(xulG.url), 'main'+xulG.window.window_name_increment(),'chrome,resizable' ); + delete xulG['_sound']; // This came from util.error but I want menu.js to have its own mframe.xulG = xulG; // This is the xulG from main.js, with auth, url, and window } catch(E) { alert(E); -- 2.11.0