diff --git a/profile/resources/content/MANIFEST b/profile/resources/content/MANIFEST index 36619e056c7..e69de29bb2d 100644 --- a/profile/resources/content/MANIFEST +++ b/profile/resources/content/MANIFEST @@ -1,14 +0,0 @@ -createProfileWizard.js -createProfileWizard.xul -deleteProfile.js -deleteProfile.xul -migrateAllProfile.xul -newProfile1_1.xul -newProfile1_1.js -newProfile1_2.xul -newProfile1_2.js -profileManager.js -profileSelection.js -profileSelection.xul -confirmMigration.xul -confirmMigration.js diff --git a/profile/resources/content/Makefile.in b/profile/resources/content/Makefile.in index 5b5d7993561..b61cb83aec2 100644 --- a/profile/resources/content/Makefile.in +++ b/profile/resources/content/Makefile.in @@ -42,6 +42,8 @@ FILES = \ profileSelection.js \ confirmMigration.xul \ confirmMigration.js \ + selectLang.xul \ + selectLang.js \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/profile/resources/content/createProfileWizard.js b/profile/resources/content/createProfileWizard.js index 3dd0966b6bb..4157c930d8a 100644 --- a/profile/resources/content/createProfileWizard.js +++ b/profile/resources/content/createProfileWizard.js @@ -53,8 +53,6 @@ function Startup( startPage, frame_id ) // set the button handler functions wizardManager.SetHandlers( null, null, onFinish, onCancel, null, null ); // load the start page - dump("calling loadpage...\n"); - dump("startPage:: " + startPage + "\n"); wizardManager.LoadPage( startPage, false ); // move to center of screen if no opener, otherwise, to center of opener if( window.opener ) @@ -90,14 +88,13 @@ function selectLocale(langcode) } catch(e) { dump("\n--> createPrifleWizard.js: selectLocale() failed!\n"); - return false; + return false; } return true; } function onFinish() { - dump("*** IN ONFINISH\n"); // check if we're at final stage if( !wizardManager.wizardMap[wizardManager.currentPageTag].finish ) @@ -107,22 +104,21 @@ function onFinish() wizardManager.WSM.SavePageData( tag, null, null, null ); var profName = wizardManager.WSM.PageData["newProfile1_2"].ProfileName.value; - dump("**** profName: "+ profName + "\n"); var profDir = wizardManager.WSM.PageData["newProfile1_2"].ProfileDir.value; + var profLocale = wizardManager.WSM.PageData["newProfile1_2"].ProfileLocale.value; // Get langcode - var langcode = window.frames["content"].document.getElementById("langList").selectedItem.getAttribute("data"); - proceed = processCreateProfileData( profName, profDir, langcode); + proceed = processCreateProfileData(profName, profDir, profLocale); if( proceed ) { if( window.opener ) { - window.opener.CreateProfile( profName, profDir ); + window.opener.CreateProfile(profName, profDir); window.close(); // select locale - selectLocale(langcode); + selectLocale(profLocale); } else { - profile.startApprunner( profName ); + profile.startApprunner(profName); ExitApp(); } } @@ -181,14 +177,11 @@ function processCreateProfileData( aProfName, aProfDir, langcode) fileSpec.appendRelativeUnixPath(aProfName); - if (fileSpec != null) { - if (fileSpec.exists()) { - useExistingDir = true; - } - } + if (fileSpec != null && fileSpec.exists()) + useExistingDir = true; dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n"); - profile.createNewProfile( aProfName, aProfDir, langcode, useExistingDir ); + profile.createNewProfile(aProfName, aProfDir, langcode, useExistingDir); return true; } diff --git a/profile/resources/content/createProfileWizard.xul b/profile/resources/content/createProfileWizard.xul index 0d6ed7968d1..9d5ecedeff1 100644 --- a/profile/resources/content/createProfileWizard.xul +++ b/profile/resources/content/createProfileWizard.xul @@ -29,7 +29,7 @@ - + diff --git a/profile/resources/content/makefile.win b/profile/resources/content/makefile.win index 560f1ac6342..dfa352bf44a 100644 --- a/profile/resources/content/makefile.win +++ b/profile/resources/content/makefile.win @@ -39,6 +39,8 @@ FILES=\ profileSelection.js \ confirmMigration.xul \ confirmMigration.js \ + selectLang.js \ + selectLang.xul \ $(NULL) install:: diff --git a/profile/resources/content/newProfile1_2.js b/profile/resources/content/newProfile1_2.js index 7f51d3c491f..a6d11ea9ca6 100644 --- a/profile/resources/content/newProfile1_2.js +++ b/profile/resources/content/newProfile1_2.js @@ -32,9 +32,11 @@ function GetFields() var profDir = document.getElementById("ProfileDir"); var profDirContent = profDir.hasChildNodes() ? profDir.firstChild.nodeValue : ""; var profDirRootFolder = profDir.getAttribute("rootFolder"); + var profLocale = document.getElementById("ProfileLocale").getAttribute("data"); var rv = { ProfileName: { id: "ProfileName", value: profName }, - ProfileDir: { id: "ProfileDir", value: profDirRootFolder } + ProfileDir: { id: "ProfileDir", value: profDirRootFolder }, + ProfileLocale: { id: "ProfileLocale", value: profLocale } } return rv; } @@ -43,12 +45,20 @@ function GetFields() // must provide its own SetFields function function SetFields( aElement, aValue, aDataObject ) { + dump("*** aElement = " + aElement + "\n"); element = document.getElementById( aElement ); - if(element.id == "ProfileDir" && aValue != "") { - chooseProfileFolder( aValue ); + switch (element.id) { + case "ProfileDir": + if (aValue) + chooseProfileFolder(aValue); + break; + case "ProfileName": + element.value = aValue; + break; + case "ProfileLocale": + document.getElementById("ProfileLocale").setAttribute("data", aValue); + break; } - else if(element.id == "ProfileName") - element.value = aValue; } // check to see if some user specified profile folder exists, otherwise use @@ -147,11 +157,8 @@ function setDisplayToDefaultFolder() updateProfileName(); } -function selectionChanged() +function showLangDialog() { - var selected = document.getElementById("langList").selectedItem; - dump("\n --> selectionChanged, val=" + selected.getAttribute("value") + - ", id=" + selected.getAttribute("id") + - ", data=" + selected.getAttribute("data") + - "\n"); + var selectedLanguage = document.getElementById("ProfileLocale").getAttribute("data"); + var selectLang = window.openDialog("chrome://communicator/content/profile/selectLang.xul","","modal=yes,resizable=no",selectedLanguage); } diff --git a/profile/resources/content/newProfile1_2.xul b/profile/resources/content/newProfile1_2.xul index 8bbffcd3862..7ecee83c0c8 100644 --- a/profile/resources/content/newProfile1_2.xul +++ b/profile/resources/content/newProfile1_2.xul @@ -57,43 +57,15 @@ - - <text value="&langSelBox.title.label;" /> - - - - - - - - - - - - - - - - - - + + +