From 38ac598122b45f58234c934c32a25fa9672cc05d Mon Sep 17 00:00:00 2001 From: "srilatha%netscape.com" Date: Fri, 8 Jun 2001 01:32:38 +0000 Subject: [PATCH] Fix for bug# 79922. Propagates the name modification from properties dialog to the LDAP Directory Server dialogs. r=mohanb, sr=sspitzer, a=dbaron. --- .../resources/content/pref-directory-add.js | 5 ++++- .../prefs/resources/content/pref-directory.js | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mailnews/addrbook/prefs/resources/content/pref-directory-add.js b/mailnews/addrbook/prefs/resources/content/pref-directory-add.js index de56ee878fb..603c906e03a 100644 --- a/mailnews/addrbook/prefs/resources/content/pref-directory-add.js +++ b/mailnews/addrbook/prefs/resources/content/pref-directory-add.js @@ -204,7 +204,10 @@ function onOK() pref_string_content = false; } window.opener.gNewServer = description; - window.opener.gNewServerString = gPref_string_desc; + window.opener.gNewServerString = gPref_string_desc; + // set window.opener.gUpdate to true so that LDAP Directory Servers + // dialog gets updated + window.opener.gUpdate = true; window.close(); } else diff --git a/mailnews/addrbook/prefs/resources/content/pref-directory.js b/mailnews/addrbook/prefs/resources/content/pref-directory.js index 82558329bbf..4ac285ef455 100644 --- a/mailnews/addrbook/prefs/resources/content/pref-directory.js +++ b/mailnews/addrbook/prefs/resources/content/pref-directory.js @@ -6,6 +6,7 @@ var gRefresh = false; var gNewServer = null; var gNewServerString = null; var gFromGlobalPref = false; +var gUpdate = false; function onEditDirectories() { @@ -359,6 +360,24 @@ function editDirectory() window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul", "editDirectory", "chrome,modal=yes,resizable=no", args); } + if(gUpdate) + { + // directory server properties have changed. So, update the + // LDAP Directory Servers dialog. + var directoriesTree = document.getElementById("directoriesTree"); + var selectedNode = directoriesTree.selectedItems[0]; + var row = selectedNode.firstChild; + var cell = row.firstChild; + cell.setAttribute('label', gNewServer); + cell.setAttribute('string', gNewServerString); + // set gUpdate to false since we have updated the server name in the list. + gUpdate = false; + // window.opener is either global pref window or + // mail/news account settings window. + // set window.opener.gRefresh to true such that the + // dropdown list box gets updated + window.opener.gRefresh = true; + } } function removeDirectory()