Mercurial > projects > dwt-mac
diff dwt/browser/Download.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | e831403a80a9 |
children | 5583f8eeee6c |
line wrap: on
line diff
--- a/dwt/browser/Download.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/browser/Download.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,5 +1,5 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2003, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,6 +33,12 @@ import dwt.widgets.Listener; import dwt.widgets.Shell; +/** + * This class implements the nsIDownload interface for mozilla + * versions 1.4 - 1.7.x. For mozilla version 1.8.x this interface + * is implemented by class nsIDownload_1_8. Later versions of + * mozilla do not need to call this interface. + */ class Download { XPCOMObject supports; XPCOMObject download; @@ -199,7 +205,7 @@ nsISupports supports = new nsISupports (aTarget); int /*long*/[] result = new int /*long*/[1]; rc = supports.QueryInterface (nsIURI.NS_IURI_IID, result); - if (rc is 0) { /* >= 1.7 */ + if (rc is XPCOM.NS_OK) { /* >= 1.7 */ nsIURI target = new nsIURI (result[0]); result[0] = 0; int /*long*/ aPath = XPCOM.nsEmbedCString_new (); @@ -241,17 +247,17 @@ } }; shell = new Shell (DWT.DIALOG_TRIM); - String msg = Compatibility.getMessage ("SWT_Download_File", new Object[] {filename}); //$NON-NLS-1$ + String msg = Compatibility.getMessage ("DWT_Download_File", new Object[] {filename}); //$NON-NLS-1$ shell.setText (msg); GridLayout gridLayout = new GridLayout (); gridLayout.marginHeight = 15; gridLayout.marginWidth = 15; gridLayout.verticalSpacing = 20; shell.setLayout(gridLayout); - msg = Compatibility.getMessage ("SWT_Download_Location", new Object[] {filename, url}); //$NON-NLS-1$ + msg = Compatibility.getMessage ("DWT_Download_Location", new Object[] {filename, url}); //$NON-NLS-1$ new Label (shell, DWT.SIMPLE).setText (msg); status = new Label (shell, DWT.SIMPLE); - msg = Compatibility.getMessage ("SWT_Download_Started"); //$NON-NLS-1$ + msg = Compatibility.getMessage ("DWT_Download_Started"); //$NON-NLS-1$ status.setText (msg); GridData data = new GridData (); data.grabExcessHorizontalSpace = true; @@ -259,7 +265,7 @@ status.setLayoutData (data); cancel = new Button (shell, DWT.PUSH); - cancel.setText (DWT.getMessage ("SWT_Cancel")); //$NON-NLS-1$ + cancel.setText (DWT.getMessage ("DWT_Cancel")); //$NON-NLS-1$ data = new GridData (); data.horizontalAlignment = GridData.CENTER; cancel.setLayoutData (data); @@ -364,7 +370,7 @@ int totalKBytes = aMaxTotalProgress / 1024; if (shell !is null && !shell.isDisposed ()) { Object[] arguments = {new Integer (currentKBytes), new Integer (totalKBytes)}; - String statusMsg = Compatibility.getMessage ("SWT_Download_Status", arguments); //$NON-NLS-1$ + String statusMsg = Compatibility.getMessage ("DWT_Download_Status", arguments); //$NON-NLS-1$ status.setText (statusMsg); shell.layout (true); shell.getDisplay ().update ();