зеркало из https://github.com/mozilla/pjs.git
Fix for b40799, countrypicker UI for profile wizard.
This commit is contained in:
Родитель
9f847e4616
Коммит
810573d7b5
|
@ -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
|
|
@ -42,6 +42,8 @@ FILES = \
|
|||
profileSelection.js \
|
||||
confirmMigration.xul \
|
||||
confirmMigration.js \
|
||||
selectLang.xul \
|
||||
selectLang.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<box class="box-header" id="header" value="&profileWizard.title;"/>
|
||||
<box id="contentarea" flex="1">
|
||||
<html:iframe src="about:blank" style="width: 40em; height: 23em; overflow: auto;" name="content" id="content" flex="1"/>
|
||||
<html:iframe src="about:blank" style="width: 40em; height: 18em; overflow: auto;" name="content" id="content" flex="1"/>
|
||||
</box>
|
||||
<box id="wizardButtons"/>
|
||||
<box class="box-status" id="status" value="&window.title.label;" progress=""/>
|
||||
|
|
|
@ -39,6 +39,8 @@ FILES=\
|
|||
profileSelection.js \
|
||||
confirmMigration.xul \
|
||||
confirmMigration.js \
|
||||
selectLang.js \
|
||||
selectLang.xul \
|
||||
$(NULL)
|
||||
|
||||
install::
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -57,43 +57,15 @@
|
|||
</box>
|
||||
</box>
|
||||
|
||||
<titledbox>
|
||||
<title><text value="&langSelBox.title.label;" /></title>
|
||||
|
||||
<box id="localeListbox" flex="100">
|
||||
<box flex="10" orient="vertical">
|
||||
<text class="label"
|
||||
value="&langList.txt.label;"
|
||||
accesskey="l" for="langList"/>
|
||||
<menulist id="langList"
|
||||
ref="urn:mozilla:locale:root" datasources="rdf:chrome"
|
||||
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
||||
sortDirection="ascending"
|
||||
oncommand="selectionChanged()">
|
||||
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem value="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
||||
data="rdf:http://www.mozilla.org/rdf/chrome#name"
|
||||
uri="..."/>
|
||||
</menupopup>
|
||||
</template>
|
||||
</menulist>
|
||||
</box>
|
||||
<box flex="20" halign="right" orient="vertical">
|
||||
<spring flex="10"/>
|
||||
<!--
|
||||
<button flex="1" valign="bottom"
|
||||
value="&moreBtn.label;" />
|
||||
-->
|
||||
</box>
|
||||
</box>
|
||||
</titledbox>
|
||||
<!-- end here -->
|
||||
|
||||
<separator/>
|
||||
|
||||
|
||||
<box autostretch="never" halign="right">
|
||||
<button value="&langSelection.label;" oncommand="showLangDialog();"/>
|
||||
</box>
|
||||
|
||||
<!--spring flex="1"/-->
|
||||
<html id="finishtext">&pnl2.finish.text;</html>
|
||||
|
||||
<data id="ProfileLocale" />
|
||||
</window>
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/"?>
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/profile/selectLang.dtd">
|
||||
|
||||
<window id="selectLangWindow"
|
||||
title="&langSelBox.title.label;"
|
||||
orient="vertical" class="dialog"
|
||||
style="width: 30em; user-focus: ignore;"
|
||||
onload="Startup();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script language="JavaScript" src="chrome://communicator/content/profile/selectLang.js"></script>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<text class="label" value="&langList.txt.label;" for="langList"/>
|
||||
|
||||
<separator class="thin" />
|
||||
|
||||
<tree class="inset" id="langList" flex="1"
|
||||
ref="urn:mozilla:locale:root" datasources="rdf:chrome"
|
||||
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
||||
sortDirection="ascending">
|
||||
<treecolgroup>
|
||||
<treecol flex="1"/>
|
||||
</treecolgroup>
|
||||
|
||||
<template>
|
||||
<treechildren>
|
||||
<treeitem id="treechildren">
|
||||
<treerow>
|
||||
<treecell uri="..."
|
||||
value="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
||||
data="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</template>
|
||||
|
||||
</tree>
|
||||
|
||||
<box id="okCancelButtons"/>
|
||||
|
||||
</window>
|
|
@ -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
|
|
@ -39,6 +39,7 @@ FILES = \
|
|||
migration.properties \
|
||||
profileSelection.dtd \
|
||||
confirmMigration.dtd \
|
||||
selectLang.dtd \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -36,6 +36,7 @@ FILES=\
|
|||
migration.properties \
|
||||
profileSelection.dtd \
|
||||
confirmMigration.dtd \
|
||||
selectLang.dtd \
|
||||
$(NULL)
|
||||
|
||||
install::
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<!ENTITY pnl2.intro.text "If you create several profiles you can tell them apart by the profile names. You may use the name provided here or use one of your own.">
|
||||
<!ENTITY pnl2.pname.label "Enter New Profile name:">
|
||||
<!ENTITY pnl2.pdir.label "Your user settings, preferences, bookmarks and mail will be stored in: ">
|
||||
<!ENTITY pnl2.deffldr.label " the default folder.">
|
||||
<!ENTITY pnl2.finish.text "Click Finish to create this new profile.">
|
||||
<!ENTITY button.choosefolder.label "Choose Folder...">
|
||||
<!ENTITY button.usedefault.label "Use Default">
|
||||
<!ENTITY pnl2.defaultPName.label "Default User">
|
||||
|
||||
<!ENTITY langSelBox.title.label "Language/Region Selection">
|
||||
<!ENTITY langList.txt.label "Select UI Language and Regional Content">
|
||||
<!ENTITY moreBtn.label "For more choices...">
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
<!ENTITY langSelBox.title.label "Language/Region Selection">
|
||||
<!ENTITY langList.txt.label "Select UI Language and Regional Content">
|
||||
<!ENTITY moreBtn.label "For more choices...">
|
Загрузка…
Ссылка в новой задаче