diff --git a/profile/resources/Makefile.in b/profile/resources/Makefile.in index 77de9cb81722..70e4bffde8f2 100644 --- a/profile/resources/Makefile.in +++ b/profile/resources/Makefile.in @@ -22,25 +22,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = locale - -FILES = \ - common.css \ - cpw.css \ - cpw.js \ - cpw.xul \ - pm.css \ - pm.js \ - pm.xul \ - pmDelete.xul \ - pmMigrateAll.xul \ - pmrename.xul \ - test-content1_1.xul \ - test-content1_2.xul \ - $(NULL) +DIRS = content skin locale include $(topsrcdir)/config/rules.mk - -install:: - $(INSTALL) $(addprefix $(srcdir)/, $(FILES)) $(DIST)/bin/res/profile - diff --git a/profile/resources/common.css b/profile/resources/common.css deleted file mode 100644 index 73d5430a7061..000000000000 --- a/profile/resources/common.css +++ /dev/null @@ -1,51 +0,0 @@ -window { - display: block; - width: 100%; - background-color: white; -} - -tree { - display: table; - background-color: #000000; - border: none; - border-spacing: 0px; - //border-collapse: collapse; - width: 100%; -} - -treeitem { - display: table-row; -} - -treehead { - display: table-header-group; -} - -treebody { - display: table-row-group; - -} - -treecell { - display: table-cell; - color: white; - font-family: Verdana; - font-size: 10pt; -} - -treehead treeitem treecell { - background-color: #a0a0a0; - border: thin black solid; - color: black; -} - -icon { - display: list-item; - height: 16px; - width: 16px; - list-style-image: url("resource:/res/mailnews/messenger/closedMailFolder.gif"); -} - -treecell[selected] { - background-color: #000080; -} diff --git a/profile/resources/content/Makefile.in b/profile/resources/content/Makefile.in index 4c62ff27d128..888f96b0dc88 100644 --- a/profile/resources/content/Makefile.in +++ b/profile/resources/content/Makefile.in @@ -26,12 +26,12 @@ include $(DEPTH)/config/autoconf.mk FILES = \ createProfileWizard.js \ createProfileWizard.xul \ - profileManager.js \ - profileManager.xul \ + profileManager.js \ + profileManager.xul \ deleteProfile.xul \ migrateAllProfile.xul \ renameProfile.xul \ - newProfile1_1.xul \ + newProfile1_1.xul \ newProfile1_2.xul \ $(NULL) diff --git a/profile/resources/content/createProfileWizard.js b/profile/resources/content/createProfileWizard.js index 4bce35dd09a1..1824e1a166d2 100644 --- a/profile/resources/content/createProfileWizard.js +++ b/profile/resources/content/createProfileWizard.js @@ -4,8 +4,8 @@ var wizardHash = new Array; var firstTime = true; var testMap = { - newProfile1_1: { next: "newProfile1_2" }, - newProfile1_2: { previous: "newProfile1_1" }, + newProfile1_1: { previous: null, next: "newProfile1_2" }, + newProfile1_2: { previous: "newProfile1_1", next: null}, } var pagePostfix=".xul"; @@ -15,25 +15,22 @@ var currentPageTag; var profName = ""; var profDir = ""; -var toolkitCore; - - -// hack for inability to gray out finish button in first screen on first load -var isProfileData = false; - function wizardPageLoaded(tag) { - dump("**********wizardPageLoaded\n"); + //dump("**********wizardPageLoaded\n"); if (firstTime) { Startup(); } - currentPageTag = tag; - dump("currentPageTag: "+currentPageTag+"\n"); - + currentPageTag = tag; + //dump("currentPageTag: "+currentPageTag+"\n"); + SetButtons(); populatePage(); } +var backButton = null; +var nextButton = null; +var finishButton = null; function loadPage(thePage) { @@ -41,24 +38,62 @@ function loadPage(thePage) saveData(); } - dump("**********loadPage\n"); - dump("thePage: "+thePage+"\n"); + //dump("**********loadPage\n"); + //dump("thePage: "+thePage+"\n"); displayPage(thePage); firstTime = false; return(true); } +function SetButtons() +{ + if (!currentPageTag) return; + if (!backButton) { + backButton = document.getElementById("back"); + } + if (!nextButton) { + nextButton = document.getElementById("next"); + } + if (!finishButton) { + finishButton = document.getElementById("finish"); + } + + //dump("currentPageTag == " + currentPageTag + "\n"); + nextTag = testMap[currentPageTag].next; + //dump("nextTag == " + nextTag + "\n"); + if (nextTag) { + //dump("next on, finish off\n"); + nextButton.setAttribute("disabled", "false"); + finishButton.setAttribute("disabled", "true"); + } + else { + //dump("next off, finish on\n"); + nextButton.setAttribute("disabled", "true"); + finishButton.setAttribute("disabled", "false"); + } + + prevTag = testMap[currentPageTag].previous; + //dump("prevTag == " + prevTag + "\n"); + if (prevTag) { + //dump("back on\n"); + backButton.setAttribute("disabled", "false"); + } + else { + //dump("back off\n"); + backButton.setAttribute("disabled", "true"); + } +} function onNext() { - dump("***********onNext\n"); - - if (currentPageTag == "newProfile1_1") { - isProfileData = true; + if (nextButton.getAttribute("disabled") == "true") { + return; } + //dump("***********onNext\n"); + if (currentPageTag != "newProfile1_2") { saveData(); var nextPageTag = testMap[currentPageTag].next; @@ -69,19 +104,22 @@ function onNext() function onBack() { - dump("***********onBack\n"); + if (backButton.getAttribute("disabled") == "true") { + return; + } - if (currentPageTag != "newProfile1_1") { + if (currentPageTag != "newProfile1_2") { saveData(); previousPageTag = testMap[currentPageTag].previous; - var url = getUrlFromTag(previousPageTag); + var url = grtUrlFromTag(previousPageTag); displayPage(url); } } function displayPage(content) { - dump("********INSIDE DISPLAYPAGE\n\n"); + //dump(content + "\n"); + //dump("********INSIDE DISPLAYPAGE\n\n"); if (content != "") { @@ -96,47 +134,47 @@ function displayPage(content) function populatePage() { - dump("************initializePage\n"); + //dump("************initializePage\n"); var contentWindow = window.frames["content"]; var doc = contentWindow.document; for (var i in wizardHash) { var formElement=doc.getElementById(i); - dump("formElement: "+formElement+"\n"); + //dump("formElement: "+formElement+"\n"); if (formElement) { formElement.value = wizardHash[i]; - dump("wizardHash["+"i]: "+wizardHash[i]+"\n"); + //dump("wizardHash["+"i]: "+wizardHash[i]+"\n"); } } } function saveData() { - dump("************ SAVE DATA\n"); + //dump("************ SAVE DATA\n"); var contentWindow = window.frames["content"]; var doc = contentWindow.document; var inputs = doc.getElementsByTagName("FORM")[0].elements; - dump("There are " + inputs.length + " input tags\n"); + //dump("There are " + inputs.length + " input tags\n"); for (var i=0 ; i - + - + - + - + diff --git a/profile/resources/content/deleteProfile.xul b/profile/resources/content/deleteProfile.xul index 1ec55239badc..ad2dc47f69ed 100644 --- a/profile/resources/content/deleteProfile.xul +++ b/profile/resources/content/deleteProfile.xul @@ -1,8 +1,8 @@ - + - + FILES=\ - createProfileWizard.js \ - createProfileWizard.xul \ - profileManager.js \ - profileManager.xul \ - deleteProfile.xul \ - migrateAllProfile.xul \ - renameProfile.xul \ - newProfile1_1.xul \ - newProfile1_2.xul \ + createProfileWizard.js \ + createProfileWizard.xul \ + deleteProfile.xul \ + migrateAllProfile.xul \ + newProfile1_1.xul \ + newProfile1_2.xul \ + profileManager.js \ + profileManager.xul \ + renameProfile.xul \ $(NULL) install:: diff --git a/profile/resources/content/migrateAllProfile.xul b/profile/resources/content/migrateAllProfile.xul index f84d533e74b7..f9147bca884e 100644 --- a/profile/resources/content/migrateAllProfile.xul +++ b/profile/resources/content/migrateAllProfile.xul @@ -1,8 +1,8 @@ - + - + &intro; - + diff --git a/profile/resources/content/newProfile1_1.xul b/profile/resources/content/newProfile1_1.xul index c63d3713ed46..a7f097b71153 100644 --- a/profile/resources/content/newProfile1_1.xul +++ b/profile/resources/content/newProfile1_1.xul @@ -18,7 +18,7 @@ --> - + diff --git a/profile/resources/content/newProfile1_2.xul b/profile/resources/content/newProfile1_2.xul index 64eed7b06b3b..c0ba40a094f2 100644 --- a/profile/resources/content/newProfile1_2.xul +++ b/profile/resources/content/newProfile1_2.xul @@ -31,6 +31,7 @@ xmlns:html="http://www.w3.org/TR/REC-html40" function foo() { + // what the hell is this? } function InitializeValues() diff --git a/profile/resources/content/profileManager.js b/profile/resources/content/profileManager.js index c40577469cd4..f93d3e79e8fb 100644 --- a/profile/resources/content/profileManager.js +++ b/profile/resources/content/profileManager.js @@ -1,12 +1,14 @@ -var profileCore = ""; var selected = null; var currProfile = ""; +var profile = Components.classes["component://netscape/profile/manager"].createInstance(); +profile = profile.QueryInterface(Components.interfaces.nsIProfile); +//dump("profile = " + profile + "\n"); function openCreateProfile() { // Need to call CreateNewProfile xuls - var win = window.openDialog('createProfileWizard.xul', 'CPW', 'chrome'); - return win; + var win = window.openDialog('chrome://profile/content/createProfileWizard.xul', 'CPW', 'chrome'); + return win; } function CreateProfile() @@ -18,7 +20,7 @@ function RenameProfile(w) { if (!selected) { - dump("Select a profile to rename.\n"); + //dump("Select a profile to rename.\n"); return; } @@ -28,12 +30,12 @@ function RenameProfile(w) if (migrate == "true") { - dump("Migrate this profile before renaming it.\n"); + //dump("Migrate this profile before renaming it.\n"); return; } //dump("RenameProfile : " + oldName + " to " + newName + "\n"); - profileCore.RenameProfile(oldName, newName); + profile.renameProfile(oldName, newName); //this.location.replace(this.location); this.location.href = "chrome://profile/content/profileManager.xul"; } @@ -42,7 +44,7 @@ function DeleteProfile(deleteFilesFlag) { if (!selected) { - dump("Select a profile to delete.\n"); + //dump("Select a profile to delete.\n"); return; } @@ -50,7 +52,7 @@ function DeleteProfile(deleteFilesFlag) var name = selected.getAttribute("rowName"); //dump("Delete '" + name + "'\n"); - profileCore.DeleteProfile(name, deleteFilesFlag); + profile.deleteProfile(name, deleteFilesFlag); //this.location.replace(this.location); //this.location.href = this.location; this.location.href = "chrome://profile/content/profileManager.xul"; @@ -58,10 +60,10 @@ function DeleteProfile(deleteFilesFlag) function StartCommunicator() { - dump("************Inside Start Communicator prof\n"); + //dump("************Inside Start Communicator prof\n"); if (!selected) { - dump("Select a profile to migrate.\n"); + //dump("Select a profile to migrate.\n"); return; } @@ -70,49 +72,42 @@ function StartCommunicator() if (migrate == "true") { - profileCore.MigrateProfile(name); + profile.migrateProfile(name); } - dump("************name: "+name+"\n"); - profileCore.StartCommunicator(name); + //dump("************name: "+name+"\n"); + profile.startCommunicator(name); ExitApp(); } function ExitApp() { - var toolkitCore = XPAppCoresManager.Find("toolkitCore"); - if (!toolkitCore) { - toolkitCore = new ToolkitCore(); - - if (toolkitCore) { - toolkitCore.Init("toolkitCore"); - } - } - if (toolkitCore) { - toolkitCore.CloseWindow(parent); - } + // Need to call this to stop the event loop + var appShell = Components.classes['component://netscape/appshell/appShellService'].getService(); + appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService); + appShell.Quit(); } function showSelection(node) { - dump("************** In showSelection routine!!!!!!!!! \n"); + //dump("************** In showSelection routine!!!!!!!!! \n"); // (see tree's onclick definition) // Tree events originate in the smallest clickable object which is the cell. The object // originating the event is available as event.target. We want the cell's row, so we go // one further and get event.target.parentNode. selected = node; var num = node.getAttribute("rowNum"); - dump("num: "+num+"\n"); + //dump("num: "+num+"\n"); var name = node.getAttribute("rowName"); - dump("name: "+name+"\n"); + //dump("name: "+name+"\n"); //dump("Selected " + num + " : " + name + "\n"); } function addTreeItem(num, name, migrate) { - dump("Adding element " + num + " : " + name + "\n"); + //dump("Adding element " + num + " : " + name + "\n"); var body = document.getElementById("theTreeBody"); var newitem = document.createElement('treeitem'); @@ -143,18 +138,21 @@ function addTreeItem(num, name, migrate) function loadElements() { - dump("****************hacked onload handler adds elements to tree widget\n"); + //dump("****************hacked onload handler adds elements to tree widget\n"); var profileList = ""; - profileCore = Components.classes["component://netscape/profile/profile-services"].createInstance(); - profileCore = profileCore.QueryInterface(Components.interfaces.nsIProfileServices); - dump("profile = " + profileCore + "\n"); - - profileList = profileCore.GetProfileList(); + profileList = profile.getProfileList(); //dump("Got profile list of '" + profileList + "'\n"); profileList = profileList.split(","); - currProfile = profileCore.GetCurrentProfile(); + try { + currProfile = profile.currentProfile; + } + catch (ex) { + if (profileList != "") { + currProfile = profileList; + } + } for (var i=0; i < profileList.length; i++) { @@ -165,15 +163,17 @@ function loadElements() function openRename() { - if (!selected) - dump("Select a profile to rename.\n"); + if (!selected) { + //dump("Select a profile to rename.\n"); + } else { var migrate = selected.getAttribute("rowMigrate"); - if (migrate == "true") - dump("Migrate the profile before renaming it.\n"); + if (migrate == "true") { + //dump("Migrate the profile before renaming it.\n"); + } else - var win = window.openDialog('renameProfile.xul', 'Renamer', 'chrome'); + var win = window.openDialog('chrome://profile/content/renameProfile.xul', 'Renamer', 'chrome'); } } @@ -182,7 +182,7 @@ function ConfirmDelete() { if (!selected) { - dump("Select a profile to delete.\n"); + //dump("Select a profile to delete.\n"); return; } @@ -191,18 +191,18 @@ function ConfirmDelete() if (migrate == "true") { - dump("Migrate this profile before deleting it.\n"); + //dump("Migrate this profile before deleting it.\n"); return; } - var win = window.openDialog('deleteProfile.xul', 'Deleter', 'chrome'); + var win = window.openDialog('chrome://profile/content/deleteProfile.xul', 'Deleter', 'chrome'); return win; } function ConfirmMigrateAll() { - var win = window.openDialog('migrateAllProfile.xul', 'MigrateAll', 'chrome'); + var win = window.openDialog('chrome://profile/content/profileManagerMigrateAll.xul', 'MigrateAll', 'chrome'); return win; } diff --git a/profile/resources/content/renameProfile.xul b/profile/resources/content/renameProfile.xul index 210831485614..2c989ac12541 100644 --- a/profile/resources/content/renameProfile.xul +++ b/profile/resources/content/renameProfile.xul @@ -1,8 +1,8 @@ - + - + - - - - - - - - - - - - - &newprofile.title; - - - - - - - - - - - - - - - - - diff --git a/profile/resources/locale/en-US/MANIFEST b/profile/resources/locale/en-US/MANIFEST index a72fef025c54..8dd32581a0e5 100644 --- a/profile/resources/locale/en-US/MANIFEST +++ b/profile/resources/locale/en-US/MANIFEST @@ -1,7 +1,7 @@ -cpw.dtd -pm.dtd -pmDelete.dtd -pmMigrateAll.dtd -pmrename.dtd -test-content1_1.dtd -test-content1_2.dtd +createProfileWizard.dtd +newProfile1_1.dtd +newProfile1_2.dtd +profileManager.dtd +profileManagerDelete.dtd +profileManagerMigrateAll.dtd +profileManagerRename.dtd diff --git a/profile/resources/locale/en-US/Makefile.in b/profile/resources/locale/en-US/Makefile.in index 978b34409094..f6debbe13c52 100644 --- a/profile/resources/locale/en-US/Makefile.in +++ b/profile/resources/locale/en-US/Makefile.in @@ -24,14 +24,14 @@ include $(DEPTH)/config/autoconf.mk FILES = \ - cpw.dtd \ - pm.dtd \ - pmDelete.dtd \ - pmMigrateAll.dtd \ - pmrename.dtd \ - test-content1_1.dtd \ - test-content1_2.dtd \ - $(NULL) + createProfileWizard.dtd \ + newProfile1_1.dtd \ + newProfile1_2.dtd \ + profileManager.dtd \ + profileManagerDelete.dtd \ + profileManagerMigrateAll.dtd \ + profileManagerRename.dtd \ + $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/profile/resources/locale/en-US/cpw.dtd b/profile/resources/locale/en-US/cpw.dtd deleted file mode 100644 index 6e46e84daf1b..000000000000 --- a/profile/resources/locale/en-US/cpw.dtd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/profile/resources/locale/en-US/makefile.win b/profile/resources/locale/en-US/makefile.win index fac594f721dd..da009bf8ba30 100644 --- a/profile/resources/locale/en-US/makefile.win +++ b/profile/resources/locale/en-US/makefile.win @@ -21,13 +21,13 @@ MODULE=profile include <$(DEPTH)\config\rules.mak> FILES=\ - cpw.dtd \ - pm.dtd \ - pmDelete.dtd \ - pmMigrateAll.dtd \ - pmrename.dtd \ - test-content1_1.dtd \ - test-content1_2.dtd \ + createProfileWizard.dtd \ + newProfile1_1.dtd \ + newProfile1_2.dtd \ + profileManager.dtd \ + profileManagerDelete.dtd \ + profileManagerMigrateAll.dtd \ + profileManagerRename.dtd \ $(NULL) install:: diff --git a/profile/resources/locale/en-US/pm.dtd b/profile/resources/locale/en-US/pm.dtd deleted file mode 100644 index 655db3bc5aea..000000000000 --- a/profile/resources/locale/en-US/pm.dtd +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/profile/resources/locale/en-US/pmDelete.dtd b/profile/resources/locale/en-US/pmDelete.dtd deleted file mode 100644 index c7d4704b1542..000000000000 --- a/profile/resources/locale/en-US/pmDelete.dtd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/profile/resources/locale/en-US/pmMigrateAll.dtd b/profile/resources/locale/en-US/pmMigrateAll.dtd deleted file mode 100644 index e1782557b6a7..000000000000 --- a/profile/resources/locale/en-US/pmMigrateAll.dtd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/profile/resources/locale/en-US/pmrename.dtd b/profile/resources/locale/en-US/pmrename.dtd deleted file mode 100644 index da83d3b03c19..000000000000 --- a/profile/resources/locale/en-US/pmrename.dtd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/profile/resources/locale/en-US/test-content1_1.dtd b/profile/resources/locale/en-US/test-content1_1.dtd deleted file mode 100644 index a9964be0a00d..000000000000 --- a/profile/resources/locale/en-US/test-content1_1.dtd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/profile/resources/locale/en-US/test-content1_2.dtd b/profile/resources/locale/en-US/test-content1_2.dtd deleted file mode 100644 index b37d9a099d4e..000000000000 --- a/profile/resources/locale/en-US/test-content1_2.dtd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/profile/resources/makefile.win b/profile/resources/makefile.win index fe7625e5aa89..c8b10663f2ec 100644 --- a/profile/resources/makefile.win +++ b/profile/resources/makefile.win @@ -18,23 +18,6 @@ DEPTH=..\.. MODULE=profile -DIRS= locale +DIRS=locale content skin + include <$(DEPTH)\config\rules.mak> - -FILES=\ - common.css \ - cpw.css \ - cpw.js \ - cpw.xul \ - pm.css \ - pm.js \ - pm.xul \ - pmDelete.xul \ - pmMigrateAll.xul \ - pmRename.xul \ - test-content1_1.xul \ - test-content1_2.xul \ - $(NULL) - -install:: - -for %i in ($(FILES:/=\)) do $(MAKE_INSTALL) %i $(DIST)\bin\res\profile diff --git a/profile/resources/pm.css b/profile/resources/pm.css deleted file mode 100644 index b3be7c2e90b0..000000000000 --- a/profile/resources/pm.css +++ /dev/null @@ -1,43 +0,0 @@ -window { - background-color: white; -} - -tree { - background-color: #FFFFFF; - border: 5px ridge; - border-spacing: 0px; - width: 75%; -} - -treecol[id="migration"] { - width: 25%; -} - -treecol[id="username"] { - width: 75%; -} - -treecell { - font-family: Verdana, Sans-Serif; - font-size: 8pt; - white-space: nowrap; -} - -treeitem[selected] { - background-color: yellow; -} - -//treecell[selectedcell] { - //background-color: yellow; -//} - -treehead treeitem treecell { - background-color: #00C0FF; - border: outset 1px; - border-color: white #707070 #707070 white; - vertical-align: middle; -} - -//popup { - //display: none; -//} diff --git a/profile/resources/pm.js b/profile/resources/pm.js deleted file mode 100644 index 065af1fd091b..000000000000 --- a/profile/resources/pm.js +++ /dev/null @@ -1,212 +0,0 @@ -var selected = null; -var currProfile = ""; -var profile = Components.classes["component://netscape/profile/manager"].createInstance(); -profile = profile.QueryInterface(Components.interfaces.nsIProfile); -//dump("profile = " + profile + "\n"); - -function openCreateProfile() -{ - // Need to call CreateNewProfile xuls - var win = window.openDialog('cpw.xul', 'CPW', 'chrome'); - return win; -} - -function CreateProfile() -{ - this.location.href = "resource:/res/profile/pm.xul"; -} - -function RenameProfile(w) -{ - if (!selected) - { - //dump("Select a profile to rename.\n"); - return; - } - - var newName = w.document.getElementById("NewName").value; - var oldName = selected.getAttribute("rowName"); - var migrate = selected.getAttribute("rowMigrate"); - - if (migrate == "true") - { - //dump("Migrate this profile before renaming it.\n"); - return; - } - - //dump("RenameProfile : " + oldName + " to " + newName + "\n"); - profile.RenameProfile(oldName, newName); - //this.location.replace(this.location); - this.location.href = "resource:/res/profile/pm.xul"; -} - -function DeleteProfile(deleteFilesFlag) -{ - if (!selected) - { - //dump("Select a profile to delete.\n"); - return; - } - - var migrate = selected.getAttribute("rowMigrate"); - - var name = selected.getAttribute("rowName"); - //dump("Delete '" + name + "'\n"); - profile.DeleteProfile(name, deleteFilesFlag); - //this.location.replace(this.location); - //this.location.href = this.location; - this.location.href = "resource:/res/profile/pm.xul"; -} - -function StartCommunicator() -{ - //dump("************Inside Start Communicator prof\n"); - if (!selected) - { - //dump("Select a profile to migrate.\n"); - return; - } - - var migrate = selected.getAttribute("rowMigrate"); - var name = selected.getAttribute("rowName"); - - if (migrate == "true") - { - profile.migrateProfile(name); - } - - //dump("************name: "+name+"\n"); - profile.startCommunicator(name); - ExitApp(); -} - -function ExitApp() -{ - // Need to call this to stop the event loop - var appShell = Components.classes['component://netscape/appshell/appShellService'].getService(); - appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService); - appShell.Quit(); -} - -function showSelection(node) -{ - //dump("************** In showSelection routine!!!!!!!!! \n"); - // (see tree's onclick definition) - // Tree events originate in the smallest clickable object which is the cell. The object - // originating the event is available as event.target. We want the cell's row, so we go - // one further and get event.target.parentNode. - selected = node; - var num = node.getAttribute("rowNum"); - //dump("num: "+num+"\n"); - - var name = node.getAttribute("rowName"); - //dump("name: "+name+"\n"); - - //dump("Selected " + num + " : " + name + "\n"); -} - -function addTreeItem(num, name, migrate) -{ - //dump("Adding element " + num + " : " + name + "\n"); - var body = document.getElementById("theTreeBody"); - - var newitem = document.createElement('treeitem'); - var newrow = document.createElement('treerow'); - newrow.setAttribute("rowNum", num); - newrow.setAttribute("rowName", name); - newrow.setAttribute("rowMigrate", migrate); - - var elem = document.createElement('treecell'); - - // Hack in a differentation for migration - if (migrate) - var text = document.createTextNode('Migrate'); - else - var text = document.createTextNode(''); - - elem.appendChild(text); - newrow.appendChild(elem); - - var elem = document.createElement('treecell'); - var text = document.createTextNode(name); - elem.appendChild(text); - newrow.appendChild(elem); - - newitem.appendChild(newrow); - body.appendChild(newitem); -} - -function loadElements() -{ - //dump("****************hacked onload handler adds elements to tree widget\n"); - var profileList = ""; - - profileList = profile.getProfileList(); - - //dump("Got profile list of '" + profileList + "'\n"); - profileList = profileList.split(","); - try { - currProfile = profile.currentProfile; - } - catch (ex) { - if (profileList != "") { - currProfile = profileList; - } - } - - for (var i=0; i < profileList.length; i++) - { - var pvals = profileList[i].split(" - "); - addTreeItem(i, pvals[0], (pvals[1] == "migrate")); - } -} - -function openRename() -{ - if (!selected) { - //dump("Select a profile to rename.\n"); - } - else - { - var migrate = selected.getAttribute("rowMigrate"); - if (migrate == "true") { - //dump("Migrate the profile before renaming it.\n"); - } - else - var win = window.openDialog('pmrename.xul', 'Renamer', 'chrome'); - } -} - - -function ConfirmDelete() -{ - if (!selected) - { - //dump("Select a profile to delete.\n"); - return; - } - - var migrate = selected.getAttribute("rowMigrate"); - var name = selected.getAttribute("rowName"); - - if (migrate == "true") - { - //dump("Migrate this profile before deleting it.\n"); - return; - } - - var win = window.openDialog('pmDelete.xul', 'Deleter', 'chrome'); - return win; -} - - -function ConfirmMigrateAll() -{ - var win = window.openDialog('pmMigrateAll.xul', 'MigrateAll', 'chrome'); - return win; -} - - -// -------------------------------------------- begin Hack for OnLoad handling -setTimeout('loadElements()', 0); -// -------------------------------------------- end Hack for OnLoad handling diff --git a/profile/resources/pm.xul b/profile/resources/pm.xul deleted file mode 100644 index 78215fe5aea7..000000000000 --- a/profile/resources/pm.xul +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - -&intro; -&intro.new; -&intro.delete; -&intro.rename; - - - - - - - - - - &migration.label; - &user.label; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/profile/resources/pmDelete.xul b/profile/resources/pmDelete.xul deleted file mode 100644 index 981221bf22d2..000000000000 --- a/profile/resources/pmDelete.xul +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - -&intro; - - - - - - - - diff --git a/profile/resources/pmMigrateAll.xul b/profile/resources/pmMigrateAll.xul deleted file mode 100644 index a9936f0a22af..000000000000 --- a/profile/resources/pmMigrateAll.xul +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - -&intro; - - - - - - - diff --git a/profile/resources/pmrename.xul b/profile/resources/pmrename.xul deleted file mode 100644 index 1b9283a4583e..000000000000 --- a/profile/resources/pmrename.xul +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - -&intro; - - - - - - - - - diff --git a/profile/resources/skin/Makefile.in b/profile/resources/skin/Makefile.in index e30cb8b620a2..c78f02fa7760 100644 --- a/profile/resources/skin/Makefile.in +++ b/profile/resources/skin/Makefile.in @@ -24,7 +24,7 @@ include $(DEPTH)/config/autoconf.mk FILES = \ - common.css \ + profile.css \ createProfileWizard.css \ profileManager.css \ $(NULL) diff --git a/profile/resources/skin/common.css b/profile/resources/skin/common.css deleted file mode 100644 index 73d5430a7061..000000000000 --- a/profile/resources/skin/common.css +++ /dev/null @@ -1,51 +0,0 @@ -window { - display: block; - width: 100%; - background-color: white; -} - -tree { - display: table; - background-color: #000000; - border: none; - border-spacing: 0px; - //border-collapse: collapse; - width: 100%; -} - -treeitem { - display: table-row; -} - -treehead { - display: table-header-group; -} - -treebody { - display: table-row-group; - -} - -treecell { - display: table-cell; - color: white; - font-family: Verdana; - font-size: 10pt; -} - -treehead treeitem treecell { - background-color: #a0a0a0; - border: thin black solid; - color: black; -} - -icon { - display: list-item; - height: 16px; - width: 16px; - list-style-image: url("resource:/res/mailnews/messenger/closedMailFolder.gif"); -} - -treecell[selected] { - background-color: #000080; -} diff --git a/profile/resources/skin/makefile.win b/profile/resources/skin/makefile.win index 8b4b547f50e6..61ac312da0f5 100644 --- a/profile/resources/skin/makefile.win +++ b/profile/resources/skin/makefile.win @@ -21,7 +21,7 @@ MODULE=profile include <$(DEPTH)\config\rules.mak> FILES=\ - common.css \ + profile.css \ createProfileWizard.css \ profileManager.css \ $(NULL) diff --git a/profile/resources/test-content1_1.xul b/profile/resources/test-content1_1.xul deleted file mode 100644 index 7819bdd2cd12..000000000000 --- a/profile/resources/test-content1_1.xul +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - -&heading; - - -&title; -¶.one; - - -¶.two; - - -¶.three; - -¶.four; - - - diff --git a/profile/resources/test-content1_2.xul b/profile/resources/test-content1_2.xul deleted file mode 100644 index 6481c6006b3d..000000000000 --- a/profile/resources/test-content1_2.xul +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - -function foo() -{ -} - -function InitializeValues() -{ - element = document.getElementById("ProfileName"); - element.value = parent.profName; - - element = document.getElementById("ProfileDir"); - element.value = parent.profDir; -} - -function commit() -{ - var element; - - element = document.getElementById("ProfileName"); - parent.SetValue(element.id, element.value); - parent.profName = element.value; - - element = document.getElementById("ProfileDir"); - data += "ProfileDir="+element.value+"%"; - parent.SetValue(element.id, element.value); - parent.profDir = element.value; -} - -setTimeout("foo()", 0); - - - - -&intro; - -&profile.name; - - - - -&profile.dir; - - - - - - - - diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index 12f52f7c76e3..75cc87609a71 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -97,10 +97,12 @@ #define REGISTRY_DIRECTORY_STRING "directory" #define REGISTRY_NEED_MIGRATION_STRING "NeedMigration" -#define PROFILE_PREG_URL "resource:/res/profile/cpwPreg.xul" -#define PROFILE_MANAGER_URL "resource:/res/profile/pm.xul" +// this used to be cpwPreg.xul, that no longer exists. we need to fix this. +#define PROFILE_PREG_URL "chrome://profile/content/createProfileWizard.xul" + +#define PROFILE_MANAGER_URL "chrome://profile/content/profileManager.xul" #define PROFILE_MANAGER_CMD_LINE_ARG "-ProfileManager" -#define PROFILE_WIZARD_URL "resource:/res/profile/cpw.xul" +#define PROFILE_WIZARD_URL "chrome://profile/content/createProfileWizard.xul" #define PROFILE_WIZARD_CMD_LINE_ARG "-ProfileWizard" #define INSTALLER_CMD_LINE_ARG "-installer" #define CREATE_PROFILE_CMD_LINE_ARG "-CreateProfile" @@ -159,6 +161,7 @@ private: nsCString & profileURLStr); nsresult LoadDefaultProfileDir(nsCString & profileURLStr); nsresult OpenRegistry(); + nsresult CloseRegistry(); char mNewProfileData[_MAX_NUM_PROFILES][_MAX_LENGTH]; char mProfiles[_MAX_NUM_PROFILES][_MAX_LENGTH]; @@ -244,6 +247,14 @@ NS_IMETHODIMP nsProfile::Startup(const char *filename) return rv; } +nsresult +nsProfile::CloseRegistry() +{ + nsresult rv; + rv = m_reg->Close(); + return rv; +} + nsresult nsProfile::OpenRegistry() { @@ -295,13 +306,13 @@ nsProfile::StartupWithArgs(nsICmdLineService *cmdLineArgs) rv = LoadDefaultProfileDir(profileURLStr); // Closing the registry that was opened in Startup() - m_reg->Close(); + rv = CloseRegistry(); #ifdef DEBUG_profile printf("Profile Manager : Profile Wizard and Manager activites : End\n"); #endif - return NS_OK; + return rv; } @@ -1701,7 +1712,9 @@ NS_IMETHODIMP nsProfile::StartCommunicator(const char* profileName) NS_WITH_SERVICE(nsIBookmarksService, bookmarks, kBookmarksCID, &rv); if (NS_FAILED(rv)) return rv; rv = bookmarks->ReadBookmarks(); + if (NS_FAILED(rv)) return rv; + rv = CloseRegistry(); return rv; }