Mercurial > projects > dwt2
comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d @ 53:7e78af7adab5
[swt lin]
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 27 Mar 2009 21:29:10 +0100 |
parents | ddbfe84d86df |
children | 70388b0e6dad |
comparison
equal
deleted
inserted
replaced
52:fa9548cd8d89 | 53:7e78af7adab5 |
---|---|
50 refCount++; | 50 refCount++; |
51 return refCount; | 51 return refCount; |
52 } | 52 } |
53 | 53 |
54 extern(System) | 54 extern(System) |
55 nsresult QueryInterface (nsID* riid, void** ppvObject) { | 55 nsresult QueryInterface (cnsID* riid, void** ppvObject) { |
56 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; | 56 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; |
57 | 57 |
58 if (*riid is nsISupports.IID) { | 58 if (*riid is nsISupports.IID) { |
59 *ppvObject = cast(void*)cast(nsIHelperAppLauncherDialog_1_9)this; | 59 *ppvObject = cast(void*)cast(nsIHelperAppLauncherDialog_1_9)this; |
60 AddRef (); | 60 AddRef (); |
93 extern(System) | 93 extern(System) |
94 nsresult PromptForSaveToFile (nsIHelperAppLauncher_1_9 aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFileName, PRUnichar* aSuggestedFileExtension, PRBool aForcePrompt, nsILocalFile* _retval) { | 94 nsresult PromptForSaveToFile (nsIHelperAppLauncher_1_9 aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFileName, PRUnichar* aSuggestedFileExtension, PRBool aForcePrompt, nsILocalFile* _retval) { |
95 //int length = XPCOM.strlen_PRUnichar (aDefaultFileName); | 95 //int length = XPCOM.strlen_PRUnichar (aDefaultFileName); |
96 //char[] dest = new char[length]; | 96 //char[] dest = new char[length]; |
97 //XPCOM.memmove (dest, aDefaultFileName, length * 2); | 97 //XPCOM.memmove (dest, aDefaultFileName, length * 2); |
98 String defaultFile = Utf.toString(fromString16z(aDefaultFileName)); | 98 String defaultFile = String_valueOf(fromString16z(aDefaultFileName)); |
99 | 99 |
100 //length = XPCOM.strlen_PRUnichar (aSuggestedFileExtension); | 100 //length = XPCOM.strlen_PRUnichar (aSuggestedFileExtension); |
101 //dest = new char[length]; | 101 //dest = new char[length]; |
102 //XPCOM.memmove (dest, aSuggestedFileExtension, length * 2); | 102 //XPCOM.memmove (dest, aSuggestedFileExtension, length * 2); |
103 String suggestedFileExtension = Utf.toString(fromString16z(aSuggestedFileExtension)); | 103 String suggestedFileExtension = String_valueOf(fromString16z(aSuggestedFileExtension)); |
104 | 104 |
105 Shell shell = new Shell (); | 105 Shell shell = new Shell (); |
106 FileDialog fileDialog = new FileDialog (shell, SWT.SAVE); | 106 FileDialog fileDialog = new FileDialog (shell, SWT.SAVE); |
107 fileDialog.setFileName (defaultFile); | 107 fileDialog.setFileName (defaultFile); |
108 String[] tmp; | 108 String[] tmp; |
114 //nsIHelperAppLauncher_1_9 launcher = new nsIHelperAppLauncher_1_9 (aLauncher); | 114 //nsIHelperAppLauncher_1_9 launcher = new nsIHelperAppLauncher_1_9 (aLauncher); |
115 int rc = aLauncher.Cancel (XPCOM.NS_BINDING_ABORTED); | 115 int rc = aLauncher.Cancel (XPCOM.NS_BINDING_ABORTED); |
116 if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__); | 116 if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__); |
117 return XPCOM.NS_ERROR_FAILURE; | 117 return XPCOM.NS_ERROR_FAILURE; |
118 } | 118 } |
119 scope auto path = new nsEmbedString (name.toString16()); | 119 scope auto path = new nsEmbedString (name.toWCharArray()); |
120 | 120 |
121 nsILocalFile localFile; | 121 nsILocalFile localFile; |
122 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, &localFile); | 122 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, &localFile); |
123 //path.dispose (); | 123 //path.dispose (); |
124 if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__); | 124 if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__); |