New confirmation dialog for xpinstall. Fixes bug #17506. r=dougt

git-svn-id: svn://10.0.0.236/trunk@54586 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbragg%netscape.com 1999-11-29 21:11:26 +00:00
parent 390f55af09
commit 9e4e33053f
9 changed files with 194 additions and 3 deletions

View File

@ -1,3 +1,5 @@
xpistatus.xul
xpistatus.js
progress.xul
institems.xul
institems.js

View File

@ -31,6 +31,8 @@ EXPORT_RESOURCE_XPINSTALL = \
$(srcdir)/progress.html \
$(srcdir)/xpistatus.xul \
$(srcdir)/xpistatus.js \
$(srcdir)/institems.xul \
$(srcdir)/institems.js \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
var toolkit;
var browser;
var dialog;
// dialog param block
var param;
function addTreeItem(num, modName, url)
{
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", modName);
var elem = document.createElement('treecell');
var text = document.createTextNode(modName);
elem.appendChild(text);
newrow.appendChild(elem);
var elem = document.createElement('treecell');
var text = document.createTextNode(url);
elem.appendChild(text);
newrow.appendChild(elem);
newitem.appendChild(newrow);
body.appendChild(newitem);
}
function onLoad()
{
param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock );
if( !param )
{
dump( " error getting param block interface\n" );
return;
}
var i = 0;
var row = 0;
var moduleName;
var URL;
while (moduleName != "")
{
moduleName = param.GetString(i++);
URL = param.GetString(i++);
addTreeItem(row++, moduleName, URL);
}
}
function onOk()
{
// set the okay button in the param block
if (param)
param.SetInt(0, 0 );
window.close();
}
function cancel()
{
// set the cancel button in the param block
if (param)
param.SetInt(0, 1 );
window.close();
}

View File

@ -0,0 +1,72 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://xpinstall/locale/institems.dtd">
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad()"
title="&items.label;"
align = "vertical"
flex = "100%"
class="dialog"
width="350"
height="300">
<html:script language="javascript" src="institems.js"/>
<box align="vertical" id="Main-Box">
<box align="horizontal" style="width:100%">
<box align="vertical">
<html:div> <html:h2> &items.label; </html:h2> </html:div>
</box>
<spring flex="80%"/>
<box align="vertical">
<html:img src="chrome://global/skin/alert-icon.gif"/>
</box>
</box>
<html:div style="height:10px; width:100%">
<html:hr/>
</html:div>
<html:div>&componentList.label;</html:div>
<spring style="height: 1em;"/>
<box align="vertical">
<html:div id="table-housing" flex="100%">
<tree id="tree">
<treecol style="width:55%"/>
<treecol style="width:40%"/>
<treehead>
<treerow>
<treecell>&moduleName.label;</treecell>
<treecell>&moduleSource.label;</treecell>
</treerow>
</treehead>
<treechildren id="theTreeBody">
</treechildren>
</tree>
</html:div>
</box>
<box align="vertical">
<spring style="height:7em;"/>
</box>
<box align="horizontal">
<spring flex="100%"/>
<titledbutton class="dialog push" id="start" value="&dialogOk.label;" onclick="onOk();" />
<titledbutton class="dialog push" value="&dialogCancel.label;" onclick="cancel();" />
</box>
</box>
</window>

View File

@ -25,11 +25,19 @@ DEPTH=..\..\..
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) progress.xul $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) progress.xul $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) progress.html $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) xpistatus.xul $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) xpistatus.js $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) institems.xul $(DIST)\bin\chrome\xpinstall\content\default
$(MAKE_INSTALL) institems.js $(DIST)\bin\chrome\xpinstall\content\default
clobber::
rm -f $(DIST)\bin\chrome\xpinstall\content\*.*
rm -f $(DIST)\bin\chrome\xpinstall\content\default\progress.xul
rm -f $(DIST)\bin\chrome\xpinstall\content\default\progress.html
rm -f $(DIST)\bin\chrome\xpinstall\content\default\xpistatus.xul
rm -f $(DIST)\bin\chrome\xpinstall\content\default\xpistatus.js
rm -f $(DIST)\bin\chrome\xpinstall\content\default\institems.xul
rm -f $(DIST)\bin\chrome\xpinstall\content\default\institems.js

View File

@ -1,3 +1,4 @@
xpinstall.properties
progress.dtd
xpistatus.dtd
institems.dtd

View File

@ -30,6 +30,7 @@ EXPORT_RESOURCE_XPINSTALL = \
$(srcdir)/xpinstall.properties \
$(srcdir)/progress.dtd \
$(srcdir)/xpistatus.dtd \
$(srcdir)/institems.dtd \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,8 @@
<!-- extracted from institems.xul -->
<!ENTITY dialogCancel.label "Cancel">
<!ENTITY dialogOk.label "Ok">
<!ENTITY items.label "Items to install">
<!ENTITY componentList.label "The following components will be installed:">
<!ENTITY moduleName.label "Module name">
<!ENTITY moduleSource.label "Location">

View File

@ -29,7 +29,11 @@ install::
$(MAKE_INSTALL) progress.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US
$(MAKE_INSTALL) xpistatus.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US
$(MAKE_INSTALL) xpinstall.properties $(DIST)\bin\chrome\xpinstall\locale\en-US
$(MAKE_INSTALL) institems.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US
clobber::
rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\*.*
rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\progress.dtd
rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\xpistatus.dtd
rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\xpinstall.properties
rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\institems.dtd