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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
&pnl2.finish.text;
+
+
diff --git a/profile/resources/content/selectLang.js b/profile/resources/content/selectLang.js
new file mode 100644
index 00000000000..7d824565d17
--- /dev/null
+++ b/profile/resources/content/selectLang.js
@@ -0,0 +1,30 @@
+function Startup()
+{
+ doSetOKCancel(onOK);
+ var selectedLanguage = window.arguments.length ? window.arguments[0] : null;
+ var tree = document.getElementById("langList");
+ if (selectedLanguage) {
+ var elements = tree.getElementsByAttribute("data", selectedLanguage);
+ if (elements.length)
+ tree.selectItem(elements[0].parentNode.parentNode);
+ }
+ else {
+ var kids = document.getElementById("treechildren");
+ tree.selectItem(kids);
+ }
+}
+
+function onOK()
+{
+ var tree = document.getElementById("langList");
+ var selectedItem = tree.selectedItems.length ? tree.selectedItems[0] : null;
+ if (selectedItem) {
+ var langName = selectedItem.firstChild.firstChild.getAttribute("data");
+ var langStore = opener.document.getElementById("ProfileLocale");
+ if (langStore)
+ langStore.setAttribute("data", langName);
+ }
+ window.close();
+}
+
+
diff --git a/profile/resources/content/selectLang.xul b/profile/resources/content/selectLang.xul
new file mode 100644
index 00000000000..7fb369b2235
--- /dev/null
+++ b/profile/resources/content/selectLang.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/profile/resources/locale/en-US/MANIFEST b/profile/resources/locale/en-US/MANIFEST
index 11d25dd7042..e69de29bb2d 100644
--- a/profile/resources/locale/en-US/MANIFEST
+++ b/profile/resources/locale/en-US/MANIFEST
@@ -1,11 +0,0 @@
-createProfileWizard.dtd
-newProfile1_1.dtd
-newProfile1_2.dtd
-profileManager.properties
-profileManagerDelete.dtd
-profileManagerMigrateAll.dtd
-createProfileWizard.properties
-newProfile1_2.properties
-profileSelection.dtd
-confirmMigration.dtd
-migration.properties
diff --git a/profile/resources/locale/en-US/Makefile.in b/profile/resources/locale/en-US/Makefile.in
index 6d6b702b3b9..cc68581e2ef 100644
--- a/profile/resources/locale/en-US/Makefile.in
+++ b/profile/resources/locale/en-US/Makefile.in
@@ -39,6 +39,7 @@ FILES = \
migration.properties \
profileSelection.dtd \
confirmMigration.dtd \
+ selectLang.dtd \
$(NULL)
include $(topsrcdir)/config/rules.mk
diff --git a/profile/resources/locale/en-US/makefile.win b/profile/resources/locale/en-US/makefile.win
index 1447e816a52..9c21ec8ced7 100644
--- a/profile/resources/locale/en-US/makefile.win
+++ b/profile/resources/locale/en-US/makefile.win
@@ -36,6 +36,7 @@ FILES=\
migration.properties \
profileSelection.dtd \
confirmMigration.dtd \
+ selectLang.dtd \
$(NULL)
install::
diff --git a/profile/resources/locale/en-US/newProfile1_2.dtd b/profile/resources/locale/en-US/newProfile1_2.dtd
index 8290d9c0bf7..e69de29bb2d 100644
--- a/profile/resources/locale/en-US/newProfile1_2.dtd
+++ b/profile/resources/locale/en-US/newProfile1_2.dtd
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/profile/resources/locale/en-US/selectLang.dtd b/profile/resources/locale/en-US/selectLang.dtd
new file mode 100644
index 00000000000..e03eef9483e
--- /dev/null
+++ b/profile/resources/locale/en-US/selectLang.dtd
@@ -0,0 +1,4 @@
+
+
+
+