rgoodger%ihug.co.nz 2000-01-13 04:21:25 +00:00
Родитель 3523a8a7d6
Коммит 69b38f3b27
26 изменённых файлов: 636 добавлений и 365 удалений

Просмотреть файл

@ -1,5 +1,6 @@
createProfileWizard.js
createProfileWizard.xul
deleteProfile.js
deleteProfile.xul
migrateAllProfile.xul
newProfile1_1.xul

Просмотреть файл

@ -32,6 +32,7 @@ FILES = \
createProfileWizard.xul \
profileManager.js \
profileManager.xul \
deleteProfile.js \
deleteProfile.xul \
migrateAllProfile.xul \
renameProfile.xul \

Просмотреть файл

@ -56,6 +56,11 @@ function Startup( startPage, frame_id )
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 )
moveToAlertPosition();
else
centerWindowOnScreen();
}
function onCancel()
@ -75,20 +80,27 @@ function onCancel()
function onFinish()
{
dump("*** IN ONFINISH\n");
// check if we're at final stage
if( !wizardManager.wizardMap[wizardManager.currentPageTag].finish )
return;
var tag = wizardManager.WSM.GetTagFromURL( wizardManager.content_frame.src, "/", ".xul" );
wizardManager.WSM.SavePageData( tag, null, null, null );
proceed = processCreateProfileData();
var profName = wizardManager.WSM.PageData["newProfile1_2"].ProfileName.value;
dump("**** profName: "+ profName + "\n");
var profDir = wizardManager.WSM.PageData["newProfile1_2"].ProfileDir.value;
proceed = processCreateProfileData( profName, profDir );
if( proceed ) {
if( window.opener ) {
window.opener.CreateProfile();
window.opener.CreateProfile( profName, profDir );
window.close();
}
else
else {
profile.startApprunner( profName );
ExitApp();
}
}
else
return;
@ -99,12 +111,8 @@ function onFinish()
* - in: nothing
* - out: nothing
**/
function processCreateProfileData()
function processCreateProfileData( aProfName, aProfDir )
{
//Process Create Profile Data
var profName = wizardManager.WSM.PageData["newProfile1_2"].ProfileName.value;
var profDir = wizardManager.WSM.PageData["newProfile1_2"].ProfileDir.value;
try {
// note: deleted check for empty profName string here as this should be
// done by panel. -bmg (31/10/99)
@ -114,11 +122,10 @@ function processCreateProfileData()
// or.. some sort of onblur notification. like a dialog then, or a
// dropout layery thing. yeah. something like that to tell them when
// it happens, not when the whole wizard is complete. blah.
if( profile.profileExists( profName ) ) {
if( profile.profileExists( aProfName ) ) {
return false;
}
profile.createNewProfile( profName, profDir );
profile.startApprunner( profName );
profile.createNewProfile( aProfName, aProfDir );
return true;
}
catch(e) {

Просмотреть файл

@ -1,11 +1,12 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://profile/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/createProfileWizard.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/wizardOverlay.xul"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://profile/locale/createProfileWizard.dtd">
<window title="&window.title.label;" align="vertical"
<window title="&newprofile.title;" align="vertical"
class="dialog"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -18,26 +19,22 @@
<html:script language="javascript" src="chrome://global/content/wizardManager.js" />
<html:script language="javascript" src="chrome://global/content/widgetStateManager.js" />
<box id="header" align="vertical" flex="100%">
<toolbar class="decorated header" align="horizontal">
<titledbutton id="profileIcon" class="button28"/>
<box align="vertical">
<html:div id="cplabel">&createprofile.heading;</html:div>
<html:div id="thatline"/>
<html:div id="cpsubl">&createprofile.subheading;</html:div>
<spring flex="100%"/>
<html:div class="headertext">&newprofile.title;</html:div>
<spring flex="100%"/>
</box>
<tabcontrol align="vertical">
<tabbox align="horizontal">
<tab class="selected" style="margin-top: -2px;">&newprofile.title;</tab>
<!-- <tab class="nonselected" onclick="loadPage('mailnews.xul');">&mailnews.title;</tab> -->
<spring flex="100%"/>
<html:div id="progress"/>
</tabbox>
<tabpanel flex="100%"/>
<!-- <tabpanel flex="100%"/> -->
</tabcontrol>
</box>
<box id="contentsink" flex="100%" style="margin-top: -2px;">
<spring flex="100%"/>
</toolbar>
<box id="contentsink" flex="100%">
<html:iframe src="about:blank" style="width: 400px; height: 200px;" name="content" id="content" scrolling="auto" flex="100%"/>
</box>
<box id="wizardButtons" style="width: 450px; margin-top: -5px; margin-bottom: 3px; margin-right: -11px;"/>
<box id="wizardButtons"/>
<toolbar class="standard title">
<html:div class="dimmed-highcontrast">&window.title.label;</html:div>
<spring flex="100%"/>
<html:div id="progress" class="dimmed-highcontrast"/>
</toolbar>
</window>

Просмотреть файл

@ -0,0 +1,33 @@
var bundle = window.opener.bundle;
function Startup()
{
doSetOKCancel( onDontDeleteFiles, onCancel, onDeleteFiles, null );
var okButton = document.getElementById("ok");
var Button2 = document.getElementById("Button2");
var cancelButton = document.getElementById("cancel");
okButton.setAttribute( "value", bundle.GetStringFromName("dontDeleteFiles") );
okButton.setAttribute( "class", ( okButton.getAttribute("class") + " padded" ) );
Button2.setAttribute( "value", bundle.GetStringFromName("deleteFiles") );
Button2.setAttribute( "class", ( okButton.getAttribute("class") + " padded" ) );
Button2.setAttribute( "style", "display: inherit;" );
cancelButton.setAttribute( "value", bundle.GetStringFromName("cancel") );
cancelButton.setAttribute( "class", ( cancelButton.getAttribute("class") + " padded" ) );
}
function onDeleteFiles()
{
opener.DeleteProfile( true );
window.close();
}
function onDontDeleteFiles()
{
opener.DeleteProfile( false );
window.close();
}
function onCancel()
{
window.close();
}

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://profile/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/profileManager.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://profile/locale/profileManagerDelete.dtd" >
<window
@ -8,17 +8,36 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog"
title="&title;">
align="vertical"
style="width: 350px;"
title="&title;"
onload="Startup();">
<html:div flex="100%">
<html:script language="javascript" src="chrome://profile/content/deleteProfile.js"/>
<box align="horizontal" flex="100%">
<spring style="width: 7px;"/>
<box align="vertical" flex="100%">
<html:div class="label">&intro;</html:div>
<html:div class="label">&question;</html:div>
<spring style="height: 10px;"/>
<html:div class="separator" align="horizontal"/>
<html:center>
<html:div>&intro;</html:div>
<html:br />
<titledbutton value="&delete.yes.label;" class="push" onclick="opener.DeleteProfile(true);window.close();" />
<titledbutton value="&delete.no.label;" class="push" onclick="opener.DeleteProfile(false);window.close();" />
<titledbutton value="&cancel.label;" class="push" onclick="window.close();" />
</html:center>
<box align="horizontal">
<spring flex="100%"/>
<box id="okCancelButtons" class="Button1"/>
<!-- old buttons
<titledbutton value="&delete.yes.label;" class="dialog padded push" onclick="opener.DeleteProfile(true);window.close();" />
<spring flex="20%"/>
<titledbutton value="&delete.no.label;" class="dialog padded push" onclick="opener.DeleteProfile(false);window.close();" />
<spring flex="20%"/>
<titledbutton value="&cancel.label;" class="dialog padded push" onclick="window.close();" />
-->
<spring flex="100%"/>
</box>
<spring style="height: 7px;"/>
</box>
<spring style="width: 7px;"/>
</box>
</html:div>
</window>

Просмотреть файл

@ -27,6 +27,7 @@ include <$(DEPTH)\config\rules.mak>
FILES=\
createProfileWizard.js \
createProfileWizard.xul \
deleteProfile.js \
deleteProfile.xul \
migrateAllProfile.xul \
newProfile1_1.xul \

Просмотреть файл

@ -22,23 +22,21 @@
<!-- this is PAGE ONE of the Profile Creation Wizard -->
<?xml-stylesheet href="chrome://profile/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/pwiz_panels.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://profile/locale/newProfile1_1.dtd" >
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="dialog wizardPanel"
onload="parent.wizardManager.onPageLoad('newProfile1_1');">
<box flex="100%" align="vertical">
<html:div>&pnl1.p1.text;</html:div>
<spring flex="50%"/>
<html:div>&pnl1.p1.text;</html:div>
<spring style="height: 10px;"/>
<html:div>&pnl1.p2.text;</html:div>
<spring flex="50%"/>
<spring style="height: 10px;"/>
<html:div>&pnl1.p3.text;</html:div>
<spring flex="50%"/>
<spring style="height: 10px;"/>
<html:div>&pnl1.p4.text;</html:div>
<spring flex="50%"/>
</box>
</window>

Просмотреть файл

@ -108,6 +108,7 @@ function getProfileDir(folder, showPopup)
if(!detect) {
var useDefault = document.createElement("titledbutton");
useDefault.setAttribute("value",bundle.GetStringFromName("useDefaultFolder"));
useDefault.setAttribute("class","dialog push");
useDefault.setAttribute("id","useDefaultButton");
useDefault.setAttribute("onclick","UseDefaultFolder();");
document.getElementById("folderbuttons").appendChild(useDefault);

Просмотреть файл

@ -21,28 +21,27 @@
<!-- this is PAGE TWO of the Profile Creation Wizard -->
<?xml-stylesheet href="chrome://profile/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/pwiz_panels.css" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/newProfile1_2.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://profile/locale/newProfile1_2.dtd" >
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="dialog wizardPanel"
width="500" height="500"
align="vertical"
onload="parent.wizardManager.onPageLoad('newProfile1_2');">
<html:script language="javascript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="newProfile1_2.js"/>
<box flex="100%" align="vertical">
<html:div>&pnl2.intro.text;</html:div>
<spring flex="50%"/>
<spring style="height: 7px;"/>
<html:div>&pnl2.pname.label;</html:div>
<html:div class="input1">
<html:input type="text" id="ProfileName" value="mozProfile" style="width: 95%"
onkeyup="ProfileNameExists(this);"/>
<spring flex="5%"/>
</html:div>
<spring flex="15%"/>
<box align="horizontal">
<html:input type="text" id="ProfileName" value="mozProfile" flex="100%"/>
</box>
<spring flex="15%"/>
<html:div id="folderintro" style="padding-bottom: 0px;">
&pnl2.pdir.label;
<html:span id="deffoldername">&pnl2.deffldr.label;</html:span>
@ -55,13 +54,13 @@
</html:div>
<spring flex="100%"/>
<box align="vertical" id="folderbuttons">
<titledbutton value="&button.choosefolder.label;" onclick="getProfileDir(null,true);"/>
<titledbutton class="dialog push" value="&button.choosefolder.label;" onclick="getProfileDir(null,true);"/>
</box>
<spring flex="5%"/>
</box>
<spring flex="85%"/>
<html:div id="finishtext">&pnl2.finish.text;</html:div>
<spring flex="50%"/>
</box>
<spring flex="15%"/>
</window>

Просмотреть файл

@ -20,260 +20,251 @@
*
*/
var selected = null;
var currProfile = "";
var profile = Components.classes["component://netscape/profile/manager"].createInstance();
profile = profile.QueryInterface(Components.interfaces.nsIProfile);
//dump("profile = " + profile + "\n");
var bundle = srGetStrBundle("chrome://profile/locale/profileManager.properties");
var profileManagerMode = "selection";
var set = null;
function openCreateProfile()
// invoke the createProfile Wizard
function CreateProfileWizard()
{
// Need to call CreateNewProfile xuls
window.openDialog('chrome://profile/content/createProfileWizard.xul', 'CPW', 'chrome');
}
function CreateProfile()
// update the display to show the additional profile
function CreateProfile( aProfName, aProfDir )
{
this.location.href = "chrome://profile/content/profileManager.xul";
AddItem( "profilekids", aProfName, aProfName );
}
function RenameProfile(w)
// rename the selected profile
function RenameProfile()
{
renameButton = document.getElementById("rename");
if (renameButton.getAttribute("disabled") == "true") {
renameButton = document.getElementById("renbutton");
if( renameButton.getAttribute("disabled") == "true" )
return;
var profileTree = document.getElementById( "profiles" );
if( !profileTree.selectedItems.length ) {
alert( bundle.GetStringFromName("noneselectedrename") );
return;
}
if (!selected) {
alert("Select a profile to rename.");
else if( profileTree.selectedItems.length != 1 ) {
alert( bundle.GetStringFromName("wrongnumberselectedrename") );
return;
}
var newName = w.document.getElementById("NewName").value;
var oldName = selected.getAttribute("rowName");
var migrate = selected.getAttribute("rowMigrate");
if (migrate == "true") {
alert("Migrate this profile before renaming it.");
return;
}
//dump("RenameProfile : " + oldName + " to " + newName + "\n");
try {
profile.renameProfile(oldName, newName);
}
catch (ex) {
alert("Sorry, failed to rename profile.");
}
//this.location.replace(this.location);
this.location.href = "chrome://profile/content/profileManager.xul";
}
function DeleteProfile(deleteFiles)
{
deleteButton = document.getElementById("delete");
if (deleteButton.getAttribute("disabled") == "true") {
return;
}
if (!selected) {
alert("Select a profile to delete.");
return;
}
var migrate = selected.getAttribute("rowMigrate");
var name = selected.getAttribute("rowName");
//dump("Delete '" + name + "'\n");
try {
profile.deleteProfile(name, deleteFiles);
}
catch (ex) {
alert("Sorry, failed to delete profile.");
}
//this.location.replace(this.location);
//this.location.href = this.location;
this.location.href = "chrome://profile/content/profileManager.xul";
}
function onStart()
{
//dump("************Inside Start Communicator prof\n");
startButton = document.getElementById("start");
if (startButton.getAttribute("disabled") == "true") {
return;
}
if (!selected) {
alert("Select a profile to start.");
return;
}
var migrate = selected.getAttribute("rowMigrate");
var name = selected.getAttribute("rowName");
if (migrate == "true") {
// pass true for show progress as modal window
profile.migrateProfile(name, true);
}
//dump("************name: "+name+"\n");
try {
profile.startApprunner(name);
ExitApp();
}
catch (ex) {
alert("Failed to start communicator with the " + name + " profile.");
}
}
function onExit()
{
try {
profile.forgetCurrentProfile();
}
catch (ex) {
//dump("Failed to forget current profile.\n");
}
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 setButtonsDisabledState(state)
{
startButton = document.getElementById("start");
deleteButton = document.getElementById("delete");
renameButton = document.getElementById("rename");
deleteButton.setAttribute("disabled", state);
renameButton.setAttribute("disabled", state);
startButton.setAttribute("disabled", state);
}
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");
// turn on all the buttons that should be on
// when something is selected.
setButtonsDisabledState("false");
}
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) {
elem.setAttribute("value", "Migrate");
}
newrow.appendChild(elem);
var elem = document.createElement('treecell');
elem.setAttribute("value", name);
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()
{
renameButton = document.getElementById("rename");
if (renameButton.getAttribute("disabled") == "true") {
return;
}
if (!selected) {
alert("Select a profile to rename.");
}
else {
var migrate = selected.getAttribute("rowMigrate");
if (migrate == "true") {
alert("Migrate the profile before renaming it.");
var selected = profileTree.selectedItems[0];
if( selected.getAttribute("rowMigrate") == "true" ) {
// auto migrate if the user wants to
if( confirm( bundle.GetStringFromName("migratebeforerename") ) )
profile.migrateProfile( profilename, true );
else
return false;
}
else {
var oldName = selected.getAttribute("rowName");
var newName = prompt( bundle.GetStringFromName("renameprofilepromptA") + oldName + bundle.GetStringFromName("renameprofilepromptB"), "" );
if( newName == "" || !newName )
return false;
var migrate = selected.getAttribute("rowMigrate");
dump("*** oldName = "+ oldName+ ", newName = "+ newName+ ", migrate = "+ migrate+ "\n");
try {
profile.renameProfile(oldName, newName);
selected.firstChild.firstChild.setAttribute( "value", newName );
selected.setAttribute( "rowName", newName );
selected.setAttribute( "profile_name", newName );
}
catch (ex) {
alert( bundle.GetStringFromName("renamefailed") );
}
}
else
window.openDialog('chrome://profile/content/renameProfile.xul', 'Renamer', 'chrome');
}
// set the button state
DoEnabling();
}
function ConfirmDelete()
{
deleteButton = document.getElementById("delete");
if (deleteButton.getAttribute("disabled") == "true") {
deleteButton = document.getElementById("delbutton");
if( deleteButton.getAttribute("disabled") == "true" )
return;
var profileTree = document.getElementById( "profiles" );
if( !profileTree.selectedItems.length ) {
alert( bundle.GetStringFromName( "noneselecteddelete" ) );
return;
}
if (!selected) {
alert("Select a profile to delete.");
else if( profileTree.selectedItems.length != 1 ) {
alert( bundle.GetStringFromName("wrongnumberselectedrename") );
return;
}
var migrate = selected.getAttribute("rowMigrate");
var selected = profileTree.selectedItems[0];
var name = selected.getAttribute("rowName");
if (migrate == "true") {
alert("Migrate this profile before deleting it.");
return;
if( selected.getAttribute("rowMigrate") == "true" ) {
// auto migrate if the user wants to. THIS IS REALLY REALLY DUMB PLEASE FIX THE BACK END.
if( confirm( bundle.GetStringFromName("migratebeforedelete") ) )
profile.migrateProfile( profilename, true );
else
return false;
}
var win = window.openDialog('chrome://profile/content/deleteProfile.xul', 'Deleter', 'chrome');
var win = window.openDialog('chrome://profile/content/deleteProfile.xul', 'Deleter', 'chrome,modal=yes');
return win;
}
// Delete the profile, with the delete flag set as per instruction above.
function DeleteProfile( deleteFiles )
{
var profileTree = document.getElementById( "profiles" );
var profileKids = document.getElementById( "profilekids" )
var selected = profileTree.selectedItems[0];
var name = selected.getAttribute( "rowName" );
try {
profile.deleteProfile( name, deleteFiles );
profileKids.removeChild( selected );
}
catch (ex) {
alert( bundle.GetStringFromName("deletefailed") );
}
// set the button state
DoEnabling();
}
function ConfirmMigrateAll()
{
var win = window.openDialog('chrome://profile/content/profileManagerMigrateAll.xul', 'MigrateAll', 'chrome');
return win;
if( confirm( bundle.GetStringFromName("migrateallprofiles") ) )
return true;
else
return false;
}
function SwitchProfileManagerMode()
{
var prattleIndex = null;
var captionLine = null;
var buttonDisplay = null;
var selItems = [];
if( profileManagerMode == "selection" )
{
prattleIndex = 1; // need to switch to manager's index
captionLine = bundle.GetStringFromName( "pm_title" ); // get manager's caption
manageButton = bundle.GetStringFromName( "pm_button" ); // get the manage button caption
buttonDisplay = "display: inherit;"; // display the manager's buttons
profileManagerMode = "manager"; // swap the mode
PersistAndLoadElements( selItems ); // save the selection and load elements
}
else {
prattleIndex = 0;
captionLine = bundle.GetStringFromName( "ps_title" );
manageButton = bundle.GetStringFromName( "ps_button" );
buttonDisplay = "display: none;";
profileManagerMode = "selection";
PersistAndLoadElements( selItems );
}
// swap deck
var deck = document.getElementById( "prattle" );
deck.setAttribute( "index", prattleIndex )
// update the manager button.
var manage = document.getElementById( "manage" );
manage.setAttribute( "value", manageButton );
// swap caption
ChangeCaption( captionLine );
// display the management buttons
var buttons = document.getElementById( "managementbox" );
buttons.setAttribute( "style", buttonDisplay );
// switch set
if( set )
set = false;
else
set = true;
}
// save which elements are selected in this mode and load elements into other mode,
// then reselect selected elements
function PersistAndLoadElements( aSelItems )
{
// persist the profiles that are selected;
var profileTree = document.getElementById("profiles");
var selItemNodes = profileTree.selectedItems;
for( var i = 0; i < selItemNodes.length; i++ )
{
aSelItems[i] = selItemNodes[i].getAttribute("profile_name");
}
loadElements(); // reload list of profiles
for( var i = 0; i < aSelItems.length; i++ )
{
var item = document.getElementsByAttribute("profile_name", aSelItems[i]);
if( item.length ) {
var item = item[0];
profileTree.addItemToSelection( item );
}
}
}
// change the title of the profile manager/selection window.
function ChangeCaption( aCaption )
{
var caption = document.getElementById( "caption" );
while( caption.hasChildNodes() )
{
caption.removeChild( caption.firstChild );
}
newCaption = document.createTextNode( aCaption );
caption.appendChild( newCaption );
}
// do button enabling based on tree selection
function DoEnabling()
{
var renbutton = document.getElementById( "renbutton" );
var delbutton = document.getElementById( "delbutton" );
var start = document.getElementById( "ok" );
var profileTree = document.getElementById( "profiles" );
var items = profileTree.selectedItems;
if( items.length != 1 )
{
renbutton.setAttribute( "disabled", "true" );
delbutton.setAttribute( "disabled", "true" );
start.setAttribute( "disabled", "true" );
}
else {
if( renbutton.getAttribute( "disabled" ) == "true" )
renbutton.removeAttribute( "disabled", "true" );
if( delbutton.getAttribute( "disabled" ) == "true" )
delbutton.removeAttribute( "disabled", "true" );
if( start.getAttribute( "disabled" ) == "true" )
start.removeAttribute( "disabled", "true" );
}
}
// handle key event on trees
function HandleKeyEvent( aEvent )
{
switch( aEvent.which )
{
case 13:
onStart();
break;
case 46:
if( profileManagerMode != "manager" )
return;
ConfirmDelete();
break;
case "VK_F2":
if( profileManagerMode != "manager" )
return;
RenameProfile();
break;
}
}

Просмотреть файл

@ -19,7 +19,7 @@
* Rights Reserved.
*
* Contributor(s):
* Ben Goodger (28/10/99)
* Ben Goodger (03/01/00)
* Seth Spitzer (28/10/99)
*/
@ -33,13 +33,18 @@ var unset = true;
function StartUp()
{
// bundle = srGetStrBundle("chrome://profile/locale/profileSelection.properties");
loadElements();
SetUpOKCancelButtons();
centerWindowOnScreen();
if( window.location.search == "?manage=true" )
SwitchProfileManagerMode();
// bundle = srGetStrBundle("chrome://profile/locale/profileSelection.properties");
loadElements();
DoEnabling();
}
// function : <profileSelection.js>::AddItem();
// purpose : utility function for adding items to a tree.
function AddItem(aChildren,aCells,aIdfier)
function AddItem( aChildren, aCells, aIdfier, aMigrate)
{
var kids = document.getElementById(aChildren);
var item = document.createElement("treeitem");
@ -47,9 +52,14 @@ function AddItem(aChildren,aCells,aIdfier)
var cell = document.createElement("treecell");
cell.setAttribute("value",aCells);
cell.setAttribute("align","left");
if( aMigrate )
cell.setAttribute("class", "dimmed-lowcontrast" );
row.appendChild(cell);
item.appendChild(row);
item.setAttribute("profile_name", aIdfier);
item.setAttribute("rowName", aIdfier);
if( aMigrate )
item.setAttribute("rowMigrate", "true");
// 23/10/99 - no roaming access yet!
// var roaming = document.getElementById("roamingitem");
// kids.insertBefore(item,roaming);
@ -72,11 +82,21 @@ function loadElements()
currProfile = profileList;
}
// remove existing nodes...
var profilekids = document.getElementById( "profilekids" );
while( profilekids.hasChildNodes() )
{
profilekids.removeChild( profilekids.firstChild );
}
for (var i = 0; i < profileList.length; i++) {
var pvals = profileList[i].split(" - ");
// only add profiles that have been migrated
if (pvals[1] != "migrate") {
AddItem("profilekids",pvals[0],pvals[0]);
if( profileManagerMode == "selection" && pvals[1] != "migrate" ) {
AddItem( "profilekids", pvals[0], pvals[0], false );
}
else if( profileManagerMode == "manager" ){
AddItem( "profilekids", pvals[0], pvals[0], ( pvals[1] == "migrate" ) );
}
}
}
@ -85,14 +105,21 @@ function loadElements()
// purpose : starts mozilla given the selected profile (user choice: "Start Mozilla")
function onStart()
{
startButton = document.getElementById("start");
if (startButton.getAttribute("disabled") == "true")
var startButton = document.getElementById("ok");
var profileTree = document.getElementById("profiles");
if( startButton.getAttribute("disabled") == "true" ||
profileTree.selectedItems.length != 1 )
return;
if (!selected)
return;
var selected = profileTree.selectedItems[0];
var profilename = selected.getAttribute("profile_name");
if( selected.getAttribute("rowMigrate") == "true" ) {
if( confirm( bundle.GetStringFromName("migratebeforestart") ) )
profile.migrateProfile( profilename, true );
else
return false;
}
try {
dump("start with profile: " + profilename + "\n");
profile.startApprunner(profilename);
@ -128,27 +155,11 @@ function ExitApp()
appShell.Quit();
}
// function : <profileSelection.js>::setButtonsDisabledState();
// purpose : sets the enabling of buttons
function setButtonsDisabledState(state)
{
startButton = document.getElementById("start");
startButton.setAttribute("disabled", state);
}
// function : <profileSelection.js>::showSelection();
// purpose : selects the profile and enables the start button
function showSelection(node)
{
// (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 item in the
// cell's row, so we got passed event.target.parentNode.parentNode
selected = node;
var tree = document.getElementById("profiles");
if (tree.selectedItems.length > 0)
setButtonsDisabledState("false");
DoEnabling();
}
// function : <profileSelection.js>::startWithProfile();
@ -166,27 +177,34 @@ function onManageProfiles()
function foo()
{
var welcome = document.getElementById("welcometo");
var mozilla = document.getElementById("mozilla");
if (welcome.hasChildNodes() && mozilla.hasChildNodes()) {
if (unset) {
oldA = welcome.lastChild.nodeValue;
oldB = mozilla.lastChild.nodeValue;
welcome.removeChild(welcome.lastChild)
var text = document.createTextNode("What Is");
welcome.appendChild(text);
mozilla.removeChild(mozilla.lastChild)
var text = document.createTextNode("MOZOLLIA?");
mozilla.appendChild(text);
unset = false;
} else {
welcome.removeChild(welcome.lastChild)
var text = document.createTextNode(oldA);
welcome.appendChild(text);
mozilla.removeChild(mozilla.lastChild)
var text = document.createTextNode(oldB);
mozilla.appendChild(text);
unset = true;
if( !set ) {
if( profileManagerMode == "manager" )
oldCaptionManager = document.getElementById( "caption" ).firstChild.nodeValue;
else
oldCaptionSelection = document.getElementById( "caption" ).firstChild.nodeValue;
ChangeCaption( "What Is Mozollia?" ); // DO NOT LOCALIZE!
set = true;
}
else {
var tempCaption = document.getElementById( "caption" ).firstChild.nodeValue;
if( profileManagerMode == "manager" ) {
ChangeCaption( oldCaptionManager );
oldCaptionManager = tempCaption;
}
else {
ChangeCaption( oldCaptionSelection )
oldCaptionSelection = tempCaption;
}
set = false;
}
}
function SetUpOKCancelButtons()
{
doSetOKCancel( onStart, onExit, null, null );
var okButton = document.getElementById("ok");
var cancelButton = document.getElementById("cancel");
okButton.setAttribute( "value", bundle.GetStringFromName("startButton") );
okButton.setAttribute( "class", ( okButton.getAttribute("class") + " padded" ) );
cancelButton.setAttribute( "value", bundle.GetStringFromName("exitButton") );
}

Просмотреть файл

@ -28,11 +28,12 @@
-->
<?xml-stylesheet href="chrome://profile/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://profile/skin/profileSelection.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://profile/locale/profileSelection.dtd" >
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
width="475" height="335"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog profile"
title="&windowtitle.label;"
@ -41,43 +42,72 @@
<html:script language="javascript" src="chrome://global/content/strres.js" />
<html:script language="javascript" src="chrome://profile/content/profileSelection.js"/>
<html:script language="javascript" src="chrome://profile/content/profileManager.js"/>
<box align="horizontal" id="header">
<box align="vertical" style="width: 245px;">
<html:div id="welcometo">&welcometo.label;</html:div>
<html:div id="mozilla">&mozilla.label;</html:div>
<spring style="height: 7px;"/>
<box align="vertical" id="prattle">
<html:div class="label">&introgeneral.label;</html:div>
<!-- sspitzer roaming not supported yet 10-28-199
<html:div class="label">&introroaming.label;</html:div>
-->
</box>
<toolbar class="decorated header" align="horizontal">
<titledbutton id="profileIcon" class="button28"/>
<box align="vertical">
<spring flex="100%"/>
<html:div class="headertext" id="caption">&windowtitle.label;</html:div>
<spring flex="100%"/>
</box>
<spring flex="100%"/>
</toolbar>
<spring style="height: 4px;"/>
<box align="horizontal" flex="100%">
<spring style="width: 7px;"/>
<!-- instructions -->
<deck id="prattle">
<box align="vertical" id="selection">
<html:div class="label" style="width: 200px;">&introgeneral.label;</html:div>
<!-- sspitzer roaming not supported yet 10-28-199
<html:div class="label">&introroaming.label;</html:div>
-->
</box>
<box align="vertical" id="manager">
<html:div class="label" style="width: 200px;">&pmTextA.label;</html:div>
<spring flex="30%"/>
<box align="horizontal" flex="100%">
<spring flex="100%"/>
<box align="vertical">
<titledbutton id="delbutton" class="dialog push padded" value="&deleteButton.label;" onclick="ConfirmDelete();"/>
<titledbutton id="renbutton" class="dialog push padded" value="&renameButton.label;" onclick="RenameProfile();"/>
<titledbutton id="newbutton" class="dialog push padded" value="&newButton.label;" onclick="CreateProfileWizard();"/>
</box>
<spring flex="100%"/>
</box>
<html:div class="label" style="width: 200px; display: none;">
<titledbutton class="unMigratedProfile plain"/>
&pmTextB.label;
</html:div>
</box>
</deck>
<spring style="width: 7px;"/>
<box align="vertical" flex="100%">
<html:div style="width: 190px; height: 172px;">
<spring style="height: 1px;"/>
<tree
id="profiles" class="inset" style="width: 190px; height: 150px;"
onclick="return showSelection(event.target.parentNode.parentNode);"
ondblclick="return onStart();"
onkeypress="if (event.which == 13) return onStart();">
id="profiles" class="inset" style="height: 175px; width: 220px;" flex="100%"
onclick="if( event.clickCount == 2 ) return onStart(); else return showSelection(event.target.parentNode.parentNode);"
onkeypress="HandleKeyEvent( event );">
<treehead>
<treerow>
<treecell value="&availprofiles.label;"/>
</treerow>
</treehead>
<treechildren id="profilekids">
<!-- sspitzer roaming not supported yet 10-28-199
<!-- sspitzer roaming not supported yet 10-28-199
<treeitem id="roamingitem">
<treerow>
<treecell id="roamingcell" value="Roaming Access Profile"/>
</treerow>
</treeitem>
-->
-->
</treechildren>
</tree>
<!-- sspitzer workoffline not supported yet 10-28-199
<!-- sspitzer workoffline not supported yet 10-28-199
<html:table>
<html:tr>
<html:td valign="middle"><html:input type="checkbox" id="offline"/></html:td>
@ -86,25 +116,32 @@
</html:td>
</html:tr>
</html:table>
-->
</html:div>
</box>
<box align="vertical">
<spring style="width: 15px; height: 58px;"/>
<spring id="makeup"/>
-->
<spring style="height: 3px"/>
<box id="managementbox" align="vertical" style="display: none;"/>
</box>
<spring style="width: 7px;"/>
</box>
<spring style="height: 10px;"/>
<html:div class="separator" align="horizontal"/>
<spring style="height: 5px;"/>
<box class="selection" align="horizontal">
<titledbutton class="dialog push padded" id="manage" value="&manage.label;" onclick="onManageProfiles();"/>
<spring style="width: 5px;"/>
<titledbutton class="dialog push padded" id="manage" value="&manage.label;" onclick="SwitchProfileManagerMode();"/>
<spring flex="100%"/>
<titledbutton class="dialog push" id="exit" value="&exit.label;" onclick="onExit();"/>
<box id="okCancelButtons"/>
<!-- older, but nonetheless prettier buttons.
<titledbutton class="dialog push padded" id="exit" value="&exit.label;" onclick="onExit();"/>
<spring style="width: 5px;"/>
<titledbutton class="dialog push padded" id="start" value="&start.label;" onclick="onStart();"/>
<spring style="width: 19px;"/>
-->
<spring style="width: 5px;"/>
</box>
<spring style="height: 4px;"/>
<toolbar class="standard title">
<html:div class="dimmed-highcontrast">&profilemanager.label;</html:div>
<spring flex="100%"/>
<html:div id="progress"/>
</toolbar>
<keyset>
<key id="fooKey" key="s" xulkey="true" shift="true" onkeydown="foo()"/>

Просмотреть файл

@ -2,6 +2,7 @@ createProfileWizard.dtd
newProfile1_1.dtd
newProfile1_2.dtd
profileManager.dtd
profileManager.properties
profileManagerDelete.dtd
profileManagerMigrateAll.dtd
profileManagerRename.dtd

Просмотреть файл

@ -32,6 +32,7 @@ FILES = \
newProfile1_1.dtd \
newProfile1_2.dtd \
profileManager.dtd \
profileManager.properties \
profileManagerDelete.dtd \
profileManagerMigrateAll.dtd \
profileManagerRename.dtd \

Просмотреть файл

@ -1,5 +1,6 @@
<!-- extracted from cpw.xul -->
<!ENTITY profileWizard.title "Create New Profile">
<!ENTITY window.title.label "Mozilla Profile Manager">
<!ENTITY newprofile.title "Create New Profile">
<!ENTITY dialup.title "Dialup">

Просмотреть файл

@ -29,6 +29,7 @@ FILES=\
newProfile1_1.dtd \
newProfile1_2.dtd \
profileManager.dtd \
profileManager.properties \
profileManagerDelete.dtd \
profileManagerMigrateAll.dtd \
profileManagerRename.dtd \

Просмотреть файл

@ -0,0 +1,25 @@
noneselectedrename=You must select a profile to rename.
wrongnumberselectedrename=You can only rename one profile at a time. Please select only one profile and try again.
migratebeforerename=The profile you have selected was created with a previous version of Communicator and must be converted to a Mozilla profile before it can be renamed. \n\n Do you want to convert this profile now?
migratebeforedelete=The profile you have selected was created with a previous version of Communicator and must be converted to a Mozilla profile before it can be deleted. \n\n Do you want to convert this profile now?\n\nIts really really stupid to enforce this. Please let us not require someone to migrate a profile before deleting it! --Ben.
migratebeforestart=The profile you have selected was created with a previous version of Communicator and must be converted before you can use it with Mozilla. \n\nMozilla can convert this profile for you automatically, but once converted you will not be able to use it in the version of Communicator that created it. \n\nChoose OK to convert the profile, or Cancel to return to the Profile Manager and select another.\n\n
renamefailed=Sorry, Mozilla has failed to rename the profile you have selected.\n\nResolution:\n1) Restart Mozilla and try again. \n2) Close other applications or restart your computer.\n3) Check to ensure the profile files are not damaged.
renameprofilepromptA=Rename the profile "
renameprofilepromptB=" to:
noneselecteddelete=You must select a profile to delete.
deletefailed=Sorry, Mozilla has failed to delete the profile you have selected.\n\nResolution:\n1) Restart Mozilla and try again. \n2) Close other applications or restart your computer.\n3) Check to ensure the profile files are not damaged.
pm_title=Manage User Profiles
ps_title=Select User Profile
pm_button=Back...
ps_button=Manage Profiles...
startButton=Start Mozilla
exitButton=Exit
deleteFiles=Delete Files
dontDeleteFiles=Don't Delete Files
cancel=Cancel

Просмотреть файл

@ -1,5 +1,6 @@
<!ENTITY title "Delete Profile">
<!ENTITY intro "Confirm delete?">
<!ENTITY intro "Deleting a profile will remove the profile from your Communicator login and cannot be undone. If you procede with the deletion, you may also choose to have Communicator delete your data files, including your saved mail, settings and certificates.">
<!ENTITY question "Would you like to delete your files with your profile? (Choosing this option will delete all the files in your profile's folder.)">
<!ENTITY delete.yes.label "Delete Files">
<!ENTITY delete.no.label "Don't Delete Files">
<!ENTITY cancel.label "Cancel">

Просмотреть файл

@ -27,8 +27,8 @@
<!ENTITY windowtitle.label "Select User Profile">
<!ENTITY welcometo.label "Welcome to">
<!ENTITY mozilla.label "MOZILLA">
<!ENTITY welcome.label "Welcome to Mozilla">
<!ENTITY profilemanager.label "Mozilla Profile Manager">
<!ENTITY introgeneral.label "To access your personal profile, which contains your mail, settings and other personalized information, please choose your profile from the list, and click Start Mozilla to begin your session.">
<!ENTITY introroaming.label "If you have a Roaming Access profile which does not exist on this computer, choose Roaming Access. Mozilla will then prompt you to log into your Roaming Access server.">
@ -47,3 +47,11 @@
<!ENTITY availprofiles.label "Available Profiles">
<!ENTITY deleteButton.label "Delete Profile...">
<!ENTITY renameButton.label "Rename Profile...">
<!ENTITY newButton.label "New Profile...">
<!-- manager entities -->
<!ENTITY pmTextA.label "Mozilla stores information about your settings, preferences, bookmarks, stored messages and other personalised information in your personal profile.">
<!ENTITY pmTextB.label "Indicates a profile created with a previous version of Communicator. These profiles must be converted before they can be loaded with Mozilla. This is an automated process.">

Просмотреть файл

@ -6,4 +6,6 @@ header.gif
profileSelection.css
profileicon-selected.gif
profileicon.gif
profileicon-large.gif
migrate.gif
newProfile1_2.css

Просмотреть файл

@ -36,6 +36,8 @@ FILES = \
profileSelection.css \
profileicon-selected.gif \
profileicon.gif \
profileicon-large.gif \
migrate.gif \
newProfile1_2.css \
$(NULL)

Просмотреть файл

@ -33,6 +33,8 @@ FILES=\
profileSelection.css \
profileicon-selected.gif \
profileicon.gif \
profileicon-large.gif \
migrate.gif \
newProfile1_2.css \
$(NULL)

Просмотреть файл

Просмотреть файл

@ -1,2 +1,126 @@
@import url(chrome://global/skin/);
@import url(chrome://global/skin/);
toolbar.header {
padding-left: 5px;
padding-bottom: 4px;
min-height: 34px;
}
toolbar.title {
padding: 1px 5px 1px 5px;
min-height: 0px ! important;
}
treeitem[rowMigrate="true"] > treerow > treecell > .tree-icon {
list-style-image: url("chrome://profile/skin/migrate.gif");
}
titledbutton.unMigratedProfile {
padding: 0px;
margin-bottom: -4px;
margin-right: 4px;
list-style-image: url("chrome://profile/skin/migrate.gif");
}
.dimmed-highcontrast {
color: #99cccc ! important;
}
.dimmed-lowcontrast {
color: graytext ;
}
treeitem[selected="true"] > treerow > treecell {
color: highlighttext;
}
div.headertext {
color: white;
}
titledbutton#profileIcon {
list-style-image: url("chrome://profile/skin/profileicon-large.gif");
margin-top: 1px;
margin-bottom: 1px;
height: 28px;
width: 28px;
}
titledbutton#profileIcon:hover {
background-image: url("chrome://global/skin/button28-bg.gif");
}
titledbutton#profileIcon:active {
background-image: url("chrome://global/skin/button28-bg.gif");
}
div.headertext {
font-size: large;
font-weight: bold;
text-decoration: underline;
}
div.separator {
margin: 0px;
}
/* display area */
box#contentsink {
border-top: 2px groove threedface;
border-bottom: 2px groove threedface;
padding: 7px;
}
/* top border on status area */
box#wizardButtons {
border-bottom: 1px solid threedshadow;
padding-top: 1px;
padding-bottom: 1px;
}
/* profile selection dialog */
div.label {
padding-top: 10px;
}
/* manager buttons */
titledbutton#manage {
min-width: 100px;
}
titledbutton.padded {
padding-left: 10px ! important;
padding-right: 10px ! important;
}
titledbutton.padded:hover {
padding-left: 10px ! important;
padding-right: 10px ! important;
}
titledbutton.padded:active {
padding-left: 11px ! important;
padding-right: 9px ! important;
}
/* platform common dialog buttons */
box#okCancelButtons {
margin: 0px ! important;
}
/* achieve the right spacing between buttons */
box#okCancelButtons > spring#Button2Spring {
display: none;
}
box#okCancelButtons > spring#Button3Spring {
display: none;
}
box#okCancelButtons > spring#OKSpring {
display: none;
}
box#okCancelButtons.Button1 > spring#Button2Spring {
display: inherit;
}
box#okCancelButtons.Button1 > spring#Button3Spring {
display: none;
}
spring#Button3Spring {
width: 5px;
}

Просмотреть файл