Closed
Bug 37180
Opened 25 years ago
Closed 24 years ago
[i18n] MsgComposeCommands.js should use nsIFilePicker instead of nsIFileSpecWithUI
Categories
(MailNews Core :: Composition, defect, P3)
MailNews Core
Composition
Tracking
(Not tracked)
VERIFIED
FIXED
M17
People
(Reporter: ftang, Assigned: vparthas)
References
()
Details
(Keywords: verifyme, Whiteboard: [nsbeta2+][w/b minus on 6/22])
You should move your code from nsIFileSpecWithUI to nsIFilePicker. Also, please
use the wstring version of the function in the nsILocalFile in javascript but
not the string version of function.
Please do not hard code string "Enter file to attach" neither. This will cause
localizablility issue.
863 function AttachFile()
864 {
865 dump("AttachFile()\n");
866 currentAttachment = "";
867
868 // Get a local file, converted into URL format
869 try {
870 var filePicker =
Components.classes["component://netscape/filespecwithui"].createInstance();
871 filePicker =
filePicker.QueryInterface(Components.interfaces.nsIFileSpecWithUI);
872 currentAttachment = filePicker.chooseFile("Enter file to
attach");
873 }
874 catch (ex) {
875 dump("failed to get the local file to attach\n");
876 }
877
878 AddAttachment(currentAttachment);
879 }
880
Comment 1•25 years ago
|
||
i18n bug. re-assign to ducarroz, who owns compose.
Assignee: sspitzer → ducarroz
Summary: MsgComposeCommands.js should use nsIFilePicker instead of nsIFileSpecWithUI → [i18n] MsgComposeCommands.js should use nsIFilePicker instead of nsIFileSpecWithUI
Sorry, I don't do nsIFilePicker stuff. I refuse to take it. Why me?
Assignee: jefft → selmer
Comment 4•25 years ago
|
||
Because I will be on vacation at the end of this week and therefore I wont be
able to take care of it until June 10th. I did reassign it to you as, correct me
if I am wrong, you did the original implementation of attach file in MsgCompose.
Comment 5•25 years ago
|
||
reassigning to ducarroz and cc'ing jefft. I know it's not selmer who owns this!
Jean-Francois, if this is your bug then we can wait until you are back from
vacation. Jefft, if this is your bug because you own the implementation of the
attach dialog, then please take it.
Assignee: selmer → ducarroz
Putting on [nsbeta2+] radar for beta2 fix.
Whiteboard: [nsbeta2+][w/b minus on 6/22]
Assignee | ||
Comment 10•24 years ago
|
||
Trying a second time to commit as marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 12•24 years ago
|
||
Ok, I will attempt to verify this. The AttachFile function is now in
http://lxr.mozilla.org/seamonkey/source/mailnews/compose/resources/content/MsgCo
mposeCommands.js#1267.
We are now using nsIFilePicker. I also searched through this file for all
instances of nsIFileSpecWithUI and it's not found.
1267 function AttachFile()
1268 {
1269 dump("AttachFile()\n");
1270 currentAttachment = "";
1271 //Get file using nsIFilePicker and convert to URL
1272 try {
1273 var fp =
Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicke
r);
1274 fp.init(window,
Bundle.GetStringFromName("chooseFileToAttach"), nsIFilePicker.modeOpen);
1275 fp.appendFilters(nsIFilePicker.filterAll);
1276 if (fp.show() == nsIFilePicker.returnOK) {
1277 currentAttachment = fp.fileURL.spec;
1278 dump("nsIFilePicker - "+currentAttachment+"\n");
1279 }
1280 }
1281 catch (ex) {
1282 dump("failed to get the local file to attach\n");
1283 }
Status: RESOLVED → VERIFIED
Comment 13•24 years ago
|
||
Note: I didn't verify the functionality of the attach file dialog; I only
verified that the code has been changed. Verification of the attach dialog is
covered in our UI/functional testing.
Comment 14•24 years ago
|
||
good job Lisa. Can we now reassign some bug to you as your looks like very famillar with Javascript and our code
base?
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•