From f1b6a4a557b6a046766c354e9aa78e059f338f34 Mon Sep 17 00:00:00 2001 From: "dveditz%netscape.com" Date: Sat, 23 Mar 2002 12:14:51 +0000 Subject: [PATCH] Embeddable XPI landing, including bugs 76424, 83702, 88757, 97691, 98458, 105083, 105085, 113149,124467,124470 r=syd (and others) sr=alecf, a=drivers git-svn-id: svn://10.0.0.236/trunk@117303 18797224-902f-48f8-a5cc-f745e15eee43 --- .../communicator/xpinstall/xpinstall.css | 80 +- .../communicator/xpinstall/xpinstall.css | 30 +- mozilla/xpinstall/macbuild/xpinstall.xml | 30 - mozilla/xpinstall/macbuild/xpinstallIDL.xml | 20 +- mozilla/xpinstall/public/Makefile.in | 4 +- mozilla/xpinstall/public/makefile.win | 15 +- mozilla/xpinstall/public/nsISoftwareUpdate.h | 2 - .../xpinstall/public/nsIXPIDialogService.idl | 101 ++ mozilla/xpinstall/public/nsIXPINotifier.idl | 21 +- .../xpinstall/public/nsIXPIProgressDialog.idl | 82 ++ .../xpinstall/public/nsIXPIProgressDlg.idl | 42 - .../public/nsPIXPIManagerCallbacks.idl | 38 - mozilla/xpinstall/public/nsPIXPIProxy.idl | 5 +- mozilla/xpinstall/res/content/institems.js | 77 +- mozilla/xpinstall/res/content/institems.xul | 52 +- mozilla/xpinstall/res/content/progress.html | 16 - mozilla/xpinstall/res/content/progress.js | 53 -- mozilla/xpinstall/res/content/progress.xul | 56 -- mozilla/xpinstall/res/content/xpistatus.js | 172 +++- mozilla/xpinstall/res/content/xpistatus.xul | 89 +- .../xpinstall/res/locale/en-US/institems.dtd | 6 +- .../xpinstall/res/locale/en-US/progress.dtd | 3 - .../res/locale/en-US/xpinstall.properties | 50 +- .../xpinstall/res/locale/en-US/xpistatus.dtd | 7 +- mozilla/xpinstall/src/Makefile.in | 2 +- mozilla/xpinstall/src/makefile.win | 2 +- mozilla/xpinstall/src/nsInstall.cpp | 162 ++-- mozilla/xpinstall/src/nsInstall.h | 14 +- .../xpinstall/src/nsInstallProgressDialog.cpp | 18 +- mozilla/xpinstall/src/nsInstallResources.cpp | 5 - mozilla/xpinstall/src/nsInstallTrigger.h | 1 + mozilla/xpinstall/src/nsJSInstall.cpp | 180 ++-- .../src/nsLoggingProgressNotifier.cpp | 117 ++- mozilla/xpinstall/src/nsSoftwareUpdate.cpp | 4 +- mozilla/xpinstall/src/nsSoftwareUpdate.h | 14 +- mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp | 133 ++- .../xpinstall/src/nsTopProgressNotifier.cpp | 80 +- mozilla/xpinstall/src/nsXPIProxy.cpp | 61 +- mozilla/xpinstall/src/nsXPIProxy.h | 8 +- mozilla/xpinstall/src/nsXPITriggerInfo.cpp | 9 +- mozilla/xpinstall/src/nsXPInstallManager.cpp | 864 +++++++++--------- mozilla/xpinstall/src/nsXPInstallManager.h | 70 +- mozilla/xpinstall/stub/nsStubNotifier.cpp | 19 +- mozilla/xpinstall/stub/xpistub.cpp | 1 - .../xpinstall/test/testXPIDialogService.js | 171 ++++ 45 files changed, 1547 insertions(+), 1439 deletions(-) create mode 100644 mozilla/xpinstall/public/nsIXPIDialogService.idl create mode 100644 mozilla/xpinstall/public/nsIXPIProgressDialog.idl delete mode 100644 mozilla/xpinstall/public/nsIXPIProgressDlg.idl delete mode 100644 mozilla/xpinstall/public/nsPIXPIManagerCallbacks.idl delete mode 100644 mozilla/xpinstall/res/content/progress.html delete mode 100644 mozilla/xpinstall/res/content/progress.js delete mode 100644 mozilla/xpinstall/res/content/progress.xul delete mode 100644 mozilla/xpinstall/res/locale/en-US/progress.dtd create mode 100644 mozilla/xpinstall/test/testXPIDialogService.js diff --git a/mozilla/themes/classic/communicator/xpinstall/xpinstall.css b/mozilla/themes/classic/communicator/xpinstall/xpinstall.css index 4af91bb4fe0..236dcf1999d 100644 --- a/mozilla/themes/classic/communicator/xpinstall/xpinstall.css +++ b/mozilla/themes/classic/communicator/xpinstall/xpinstall.css @@ -14,7 +14,7 @@ * * The Original Code is Mozilla Communicator client code. * - * The Initial Developer of the Original Code is + * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998-1999 * the Initial Developer. All Rights Reserved. @@ -22,9 +22,10 @@ * Contributor(s): * Don Bragg (dbragg@netscape.com) 12/08/1999 * Blake Ross (BlakeR1234@aol.com) 6/12/2000 + * Daniel Veditz 2002 * * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or + * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only @@ -37,73 +38,30 @@ * * ***** END LICENSE BLOCK ***** */ -@import url("chrome://global/skin"); +@import url("chrome://communicator/skin"); @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -div.label { - margin : 3px; +#confirmBox { + margin: 1ex; } -div#tree-housing { - height : 3em; +#urlColumn { + margin-left: 1ex; } -box#mainBox{ - margin : 5px; - width : 40em; +.confirmSeparator { + height: 1em; } -box#okcancelBox{ - margin-left : 22em; - margin-top : 3px; - margin-bottom : 3px; -} - - -box#treeBox{ - height : 18ex; - margin : 0em; -} - -box#statusMessages{ - width : 36em; -} - - -/* -div#table-housing { - height : 100%; -} -*/ - -#modulesTree { - height : 16ex; - width : 32em; -} - -spacer#verticalSmallSpacer { - height : 1ex; -} - -spacer#verticalLargeSpacer { - height : 6ex; -} - -spacer#verticalMediumSpacer { - height : 3ex; -} - -spacer#horizontalSmallSpacer { - width : 2em; -} - -spacer#horizontalLargeSpacer { - width : 10em; -} - -.headline { - font-size : x-large; - margin : 4px; +.confirmName { font-weight : bold; } + +.packageName { + font-weight : bold; +} + +#alert-image { + margin: 1em; +} diff --git a/mozilla/themes/modern/communicator/xpinstall/xpinstall.css b/mozilla/themes/modern/communicator/xpinstall/xpinstall.css index 91c6b06f26b..928ef979954 100644 --- a/mozilla/themes/modern/communicator/xpinstall/xpinstall.css +++ b/mozilla/themes/modern/communicator/xpinstall/xpinstall.css @@ -22,6 +22,7 @@ * Don Bragg (dbragg@netscape.com) 12/08/1999 * Blake Ross (BlakeR1234@aol.com) 6/12/2000 * Joe Hewitt + * Daniel Veditz * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -41,35 +42,32 @@ == Styles used by the XPInstall dialogs. ======================================================================= */ -@import url("chrome://global/skin"); +@import url("chrome://communicator/skin"); @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* ::::: Install Confirm and Progress dialogs ::::: */ -#mainBox { - margin: 5px; -} - -.headline { - margin: 4px; - font-size: x-large; +.packageName { font-weight: bold; } -.warning-text { - max-width: 40em; +#confirmBox { + margin: 1ex; } -#modulesTree { - height: 16ex; +.confirmSeparator { + height: 1em; } -[id="dialog.progress"] { - width: 200px; +.confirmName { + font-weight: bold; } -.vertical-small-spacer { - height: 1ex; +#urlColumn { + margin-left: 1ex; } +#alert-image { + margin: 1em; +} diff --git a/mozilla/xpinstall/macbuild/xpinstall.xml b/mozilla/xpinstall/macbuild/xpinstall.xml index e2025ba9aeb..fa1609a47fa 100644 --- a/mozilla/xpinstall/macbuild/xpinstall.xml +++ b/mozilla/xpinstall/macbuild/xpinstall.xml @@ -1099,13 +1099,6 @@ Library Debug - - Name - nsInstallProgressDialog.cpp - MacOS - Text - Debug - Name nsXPInstallManager.cpp @@ -1318,11 +1311,6 @@ zlibDebug.shlb MacOS - - Name - nsInstallProgressDialog.cpp - MacOS - Name nsXPInstallManager.cpp @@ -2416,13 +2404,6 @@ Text Debug - - Name - nsInstallProgressDialog.cpp - MacOS - Text - Debug - Name nsXPInstallManager.cpp @@ -2635,11 +2616,6 @@ nsInstallFileOpItem.cpp MacOS - - Name - nsInstallProgressDialog.cpp - MacOS - Name nsXPInstallManager.cpp @@ -2810,12 +2786,6 @@ nsLoggingProgressNotifier.cpp MacOS - - xpinstallDebug.shlb - Name - nsInstallProgressDialog.cpp - MacOS - xpinstallDebug.shlb Name diff --git a/mozilla/xpinstall/macbuild/xpinstallIDL.xml b/mozilla/xpinstall/macbuild/xpinstallIDL.xml index 8a1d9e962d4..22316d51710 100644 --- a/mozilla/xpinstall/macbuild/xpinstallIDL.xml +++ b/mozilla/xpinstall/macbuild/xpinstallIDL.xml @@ -719,7 +719,7 @@ Name - nsIXPIProgressDlg.idl + nsIXPIProgressDialog.idl MacOS Text @@ -733,7 +733,7 @@ Name - nsPIXPIManagerCallbacks.idl + nsIXPIDialogService.idl MacOS Text @@ -754,7 +754,7 @@ Name - nsIXPIProgressDlg.idl + nsIXPIProgressDialog.idl MacOS @@ -764,7 +764,7 @@ Name - nsPIXPIManagerCallbacks.idl + nsIXPIDialogService.idl MacOS @@ -1440,7 +1440,7 @@ Name - nsIXPIProgressDlg.idl + nsIXPIProgressDialog.idl MacOS Text @@ -1454,7 +1454,7 @@ Name - nsPIXPIManagerCallbacks.idl + nsIXPIDialogService.idl MacOS Text @@ -1475,7 +1475,7 @@ Name - nsIXPIProgressDlg.idl + nsIXPIProgressDialog.idl MacOS @@ -1485,7 +1485,7 @@ Name - nsPIXPIManagerCallbacks.idl + nsIXPIDialogService.idl MacOS @@ -1512,7 +1512,7 @@ headers Name - nsIXPIProgressDlg.idl + nsIXPIProgressDialog.idl MacOS @@ -1524,7 +1524,7 @@ headers Name - nsPIXPIManagerCallbacks.idl + nsIXPIDialogService.idl MacOS diff --git a/mozilla/xpinstall/public/Makefile.in b/mozilla/xpinstall/public/Makefile.in index aa65491d145..317b8522e54 100644 --- a/mozilla/xpinstall/public/Makefile.in +++ b/mozilla/xpinstall/public/Makefile.in @@ -32,11 +32,11 @@ include $(DEPTH)/config/autoconf.mk MODULE = xpinstall XPIDLSRCS = \ + nsIXPIDialogService.idl \ + nsIXPIProgressDialog.idl \ nsIXPINotifier.idl \ - nsIXPIProgressDlg.idl \ nsPIXPIProxy.idl \ nsPIXPIStubHook.idl \ - nsPIXPIManagerCallbacks.idl \ $(NULL) EXPORTS = \ diff --git a/mozilla/xpinstall/public/makefile.win b/mozilla/xpinstall/public/makefile.win index 25886af4d10..87915515000 100644 --- a/mozilla/xpinstall/public/makefile.win +++ b/mozilla/xpinstall/public/makefile.win @@ -10,15 +10,15 @@ # 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 Original Code is Mozilla Communicator client code, +# released March 31, 1998. # -# The Initial Developer of the Original Code is Netscape Communications +# 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. # -# Contributor(s): +# Contributor(s): # Daniel Veditz # Douglas Turner @@ -32,13 +32,12 @@ EXPORTS= nsIDOMInstallTriggerGlobal.h \ $(NULL) XPIDLSRCS = \ + .\nsIXPIDialogService.idl \ + .\nsIXPIProgressDialog.idl \ .\nsIXPINotifier.idl \ - .\nsIXPIProgressDlg.idl \ .\nsPIXPIStubHook.idl \ - .\nsPIXPIManagerCallbacks.idl \ .\nsPIXPIProxy.idl \ -# .\nsIUpdateNotification.idl \ - $(NULL) + $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpinstall/public/nsISoftwareUpdate.h b/mozilla/xpinstall/public/nsISoftwareUpdate.h index 11748e0f0e5..7921d3acda2 100644 --- a/mozilla/xpinstall/public/nsISoftwareUpdate.h +++ b/mozilla/xpinstall/public/nsISoftwareUpdate.h @@ -35,7 +35,6 @@ #include "nsCOMPtr.h" #include "nsIModule.h" #include "nsIGenericFactory.h" -#include "nsIDOMWindowInternal.h" #include "nsIRegistry.h" #include "nsIRegistryUtils.h" @@ -68,7 +67,6 @@ class nsISoftwareUpdate : public nsISupports NS_IMETHOD InstallJar(nsIFile* localFile, const PRUnichar* URL, const PRUnichar* arguments, - nsIDOMWindowInternal* aParentWindow, PRUint32 flags, nsIXPIListener* aListener = 0) = 0; diff --git a/mozilla/xpinstall/public/nsIXPIDialogService.idl b/mozilla/xpinstall/public/nsIXPIDialogService.idl new file mode 100644 index 00000000000..ae7380451a7 --- /dev/null +++ b/mozilla/xpinstall/public/nsIXPIDialogService.idl @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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/MPL/ + * + * 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 the Mozilla XPInstall. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Daniel Veditz + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsISupports.idl" + +interface nsIDOMWindow; +interface nsIXPIProgressDialog; +interface nsIObserver; + +/** + * A service provided by embedding applications to override + * the default XUL implmementation of XPInstall dialogs. + * + * Embedding applications which wish to override the default + * XUL dialogs need to create a component which implements + * this interface and registers with the Contract ID + * "@mozilla.org/embedui/xpinstall-dialog-service;1" + * + * @status UNDER_REVIEW + */ +[scriptable, uuid(8cdd8baa-1dd2-11b2-909a-f0178da5c5ff)] +interface nsIXPIDialogService : nsISupports +{ + /** + * @brief Ask the user if it's OK to install + * + * When called the XPIDialogService implementation should pose an + * install confirmation dialog and return the user's response + * + * @param parent a window that can be used to parent the modal dialog + * + * @param packageList For each install package there will be two strings, + * a display name and a source URL. + * + * @param count The number of strings in the packageList. This + * will always be even (twice the number of packages) + * + * @return true to install, false to cancel + */ + boolean confirmInstall(in nsIDOMWindow parent, + [array, size_is(count)] in wstring packageList, + in unsigned long count); + + /** + * @brief Create and open a download-and-install progress dialog + * + * When called the XPIDialogService implementation creates and opens + * a dialog to display the status of the install. When the dialog + * is ready to be used then the observer must be called: the subject + * is an nsIXPIProgressDialog that nsXPInstallManager can use to control + * the dialog, the topic is "xpinstall-progress" and the data is "open". + * + * If the user wishes to cancel the download, the dialog can call the + * observe method with the same subject and topic and the data "cancel". + * + * @note Unless this routine throws an exception the observer must + * be called or nsXPInstallManager will wait forever and never clean + * itself up. + * + * @param packageList two strings per package as in confirmInstall() + * @param count the number of strings in the list + * @param observer nsIObserver to receive messages from the dialog + */ + void openProgressDialog([array, size_is(count)] in wstring packageList, + in unsigned long count, + in nsIObserver observer); +}; diff --git a/mozilla/xpinstall/public/nsIXPINotifier.idl b/mozilla/xpinstall/public/nsIXPINotifier.idl index 1bc797f3d2a..fe32ebd28ae 100644 --- a/mozilla/xpinstall/public/nsIXPINotifier.idl +++ b/mozilla/xpinstall/public/nsIXPINotifier.idl @@ -10,15 +10,15 @@ * 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 Original Code is Mozilla Communicator client code, + * released March 31, 1998. * - * The Initial Developer of the Original Code is Netscape Communications + * The Initial Developer of the Original Code is Netscape Communications * Corporation. Portions created by Netscape are * Copyright (C) 2000 Netscape Communications Corporation. All * Rights Reserved. * - * Contributor(s): + * Contributor(s): * Douglas Turner * Daniel Veditz */ @@ -28,11 +28,10 @@ [uuid(eea90d40-b059-11d2-915e-c12b696c9333)] interface nsIXPIListener : nsISupports { - void BeforeJavascriptEvaluation(in wstring URL); - void AfterJavascriptEvaluation(in wstring URL); - void InstallStarted(in wstring URL, in wstring UIPackageName); - void ItemScheduled(in wstring message ); - void FinalizeProgress(in wstring message, in long itemNum, in long totNum ); - void FinalStatus(in wstring URL, in long status); - void LogComment(in wstring comment); + void onInstallStart(in wstring URL); + void onInstallDone(in wstring URL, in long status); + void onPackageNameSet(in wstring URL, in wstring UIPackageName); + void onItemScheduled(in wstring message ); + void onFinalizeProgress(in wstring message, in long itemNum, in long totNum ); + void onLogComment(in wstring comment); }; diff --git a/mozilla/xpinstall/public/nsIXPIProgressDialog.idl b/mozilla/xpinstall/public/nsIXPIProgressDialog.idl new file mode 100644 index 00000000000..9152f65a9dd --- /dev/null +++ b/mozilla/xpinstall/public/nsIXPIProgressDialog.idl @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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/MPL/ + * + * 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 the Mozilla XPInstall. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Daniel Veditz + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsISupports.idl" + +/** + * Interface to display XPInstall download and install status. + * + * @status UNDER_REVIEW + */ +[scriptable, uuid(8cdf1192-8709-4428-ab97-c5b6ceecd7e9)] +interface nsIXPIProgressDialog : nsISupports +{ + /** + * state values for onStateChange + */ + const short DOWNLOAD_START = 0; + const short DOWNLOAD_DONE = 1; + const short INSTALL_START = 2; + const short INSTALL_DONE = 3; + const short DIALOG_CLOSE = 4; + + /** + * basic info to control the install progress dialog. The dialog can + * go away any time after it has received the DIALOG_CLOSE state message + * but needs to accept messages until that time even if it is not visible. + * + * Normally for each install package the dialog will receive the download + * and install messages in START/DONE pairs, but in the case of a download + * error the dialog will be sent only the DOWNLOAD_START followed by an + * INSTALL_DONE message with the value nsInstall::DOWNLOAD_ERROR + * + * @param index the package this message is about of those passed into + * openProgressDialog. ignored when state==DIALOG_CLOSE + * @param state the kind of message + * @param value final result when state==INSTALL_DONE, otherwise ignored + */ + void onStateChange( in unsigned long index, in short state, in long value ); + + /** + * download progress + * + * @param index the package to which this refers + * @param value number of bytes downloaded + * @param maxValue the total size + */ + void onProgress( in unsigned long index, in unsigned long value, in unsigned long maxValue ); +}; diff --git a/mozilla/xpinstall/public/nsIXPIProgressDlg.idl b/mozilla/xpinstall/public/nsIXPIProgressDlg.idl deleted file mode 100644 index 07db981adaf..00000000000 --- a/mozilla/xpinstall/public/nsIXPIProgressDlg.idl +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (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. - * - * Contributor(s): - * Douglas Turner - * Daniel Veditz - */ - -#include "nsISupports.idl" -#include "nsIDialogParamBlock.idl" - -[scriptable, uuid(597140A0-1C1D-11d3-8E10-914233F46847)] -interface nsIXPIProgressDlg : nsISupports -{ - void Open(in nsIDialogParamBlock ioParamBlock); - void Close(); - - void SetTitle( in wstring aTitle ); - void SetHeading( in wstring aHeading ); - void SetActionText( in wstring aText ); - void SetProgress( in long aValue, in long aMax , in char mode); - void StartInstallPhase(); - - boolean GetCancelStatus(); -}; diff --git a/mozilla/xpinstall/public/nsPIXPIManagerCallbacks.idl b/mozilla/xpinstall/public/nsPIXPIManagerCallbacks.idl deleted file mode 100644 index e7404557fc5..00000000000 --- a/mozilla/xpinstall/public/nsPIXPIManagerCallbacks.idl +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (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/MPL/ - * - * 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 - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1999 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Don Bragg - * Samir Gehani - */ - -#include "nsISupports.idl" - -/** - * nsPIXPIManagerCallbacks - * - * Private interface to allow the XPInstall XUL progress dialog to talk - * to the native progress dialog implementation. - */ -[scriptable, uuid(d63ed30a-a858-11d3-a446-0060b0eb5963)] -interface nsPIXPIManagerCallbacks: nsISupports -{ - void dialogOpened(in nsISupports aWindow); - void cancelInstall(); -}; diff --git a/mozilla/xpinstall/public/nsPIXPIProxy.idl b/mozilla/xpinstall/public/nsPIXPIProxy.idl index b68d11d23f9..78769f238d1 100644 --- a/mozilla/xpinstall/public/nsPIXPIProxy.idl +++ b/mozilla/xpinstall/public/nsPIXPIProxy.idl @@ -33,6 +33,9 @@ [scriptable,uuid(6F9D2890-167D-11d5-8DAF-000064657374)] interface nsPIXPIProxy : nsISupports { - void refreshPlugins(in nsISupports aWindow); + void refreshPlugins(in boolean reloadPages); void notifyRestartNeeded(); + + void alert(in wstring title, in wstring text); + boolean confirm(in wstring title, in wstring text); }; diff --git a/mozilla/xpinstall/res/content/institems.js b/mozilla/xpinstall/res/content/institems.js index 09319201570..4f765a0ff9d 100644 --- a/mozilla/xpinstall/res/content/institems.js +++ b/mozilla/xpinstall/res/content/institems.js @@ -4,68 +4,65 @@ * 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; +var gParams; -function addTreeItem(num, modName, url) +function addTreeItem(num, aName, aUrl) { - dump("Adding element " + num + " : " + name + "\n"); - var body = document.getElementById("theTreeBody"); + // first column is the package name + var item = document.createElement("description"); + item.setAttribute("value", aName); + item.setAttribute("tooltiptext", aUrl); + item.setAttribute("class", "confirmName"); - var newitem = document.createElement('treeitem'); - var newrow = document.createElement('treerow'); - - newrow.setAttribute("rowNum", num); - newrow.setAttribute("rowName", modName); + // second column is the host serving the file + var urltext = aUrl.replace(/^([^:]*:\/*[^\/]+).*/, "$1"); + var url = document.createElement('description'); + url.setAttribute("value", aUrl); + url.setAttribute("tooltiptext", aUrl); + url.setAttribute("class", "confirmURL"); + url.setAttribute("crop", "end"); - var elem = document.createElement('treecell'); - elem.setAttribute("label", modName); - newrow.appendChild(elem); + // create row and add it to the grid + var row = document.createElement("row"); + row.appendChild(item); + row.appendChild(url); - elem = document.createElement('treecell'); - elem.setAttribute("label", url); - newrow.appendChild(elem); - - newitem.appendChild(newrow); - body.appendChild(newitem); + document.getElementById("xpirows").appendChild(row); } -function onLoad() +function onLoad() { var row = 0; var moduleName, URL, numberOfDialogTreeElements; doSetOKCancel(onOk, onCancel); - param = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); + gParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); - param.SetInt(0, 1 ); /* Set the default return to Cancel */ + gParam.SetInt(0, 1 ); /* Set the default return to Cancel */ - numberOfDialogTreeElements = param.GetInt(1); + numberOfDialogTreeElements = gParam.GetInt(1); for (var i=0; i < numberOfDialogTreeElements; i++) { - moduleName = param.GetString(i); - URL = param.GetString(++i); + moduleName = gParam.GetString(i); + URL = gParam.GetString(++i); addTreeItem(row++, moduleName, URL); } @@ -74,21 +71,21 @@ function onLoad() document.getElementById("ok").label = okButton; } -function onOk() +function onOk() { // set the okay button in the param block - if (param) - param.SetInt(0, 0 ); + if (gParam) + gParam.SetInt(0, 0 ); window.close(); } -function onCancel() +function onCancel() { - // set the cancel button in the param block - if (param) - param.SetInt(0, 1 ); - - window.close(); + // set the cancel button in the param block + if (gParam) + gParam.SetInt(0, 1 ); + + window.close(); } diff --git a/mozilla/xpinstall/res/content/institems.xul b/mozilla/xpinstall/res/content/institems.xul index 248286b3087..0558d36b573 100644 --- a/mozilla/xpinstall/res/content/institems.xul +++ b/mozilla/xpinstall/res/content/institems.xul @@ -1,4 +1,4 @@ - + - @@ -32,9 +31,10 @@ Contributor(s): + style="width: 50em" + >