Closed
Bug 37175
Opened 25 years ago
Closed 24 years ago
bookmark code should use nsIFilePicker and nsILocaleFile from nsIFileSpec/nsIFileSpecWithUI
Categories
(SeaMonkey :: Bookmarks & History, defect, P3)
SeaMonkey
Bookmarks & History
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: ftang, Assigned: bryner)
References
()
Details
(Whiteboard: [nsbeta2+][6/15])
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Please use the nsIFilePicker and the wstring (unicode) attributes in the
nsILocalFile instead of nsIFileSpecWithUI and nsIFileSpec
783 if (filePicker) filePicker =
filePicker.QueryInterface(Components.interfaces.nsIFileSpecWithUI);
784 if (!filePicker) return(false);
785
786 var promptStr =
bundle.GetStringFromName("SelectImport");
787
788 filePicker.chooseInputFile(promptStr, 2, "", "");
// 2 = html filter
789 var filespec =
filePicker.QueryInterface(Components.interfaces.nsIFileSpec);
790 if (!filespec) return(false);
791 var filename = filespec.URLString;
792 if ((!filename) || (filename == ""))
return(false);
793
794 debug("Import: '" + filename + "'\n");
795 urlVal = filename;
Comment 1•25 years ago
|
||
Frank, I tried to use nsIFilePicker and it had various bugs (which Pavlov
is aware of).
What's your real issue with using nsIFileSpecWithUI ?
Assignee | ||
Comment 3•24 years ago
|
||
I have a fix for this in my tree, but it will depend on being able to set the
default filename correctly (bookmarks.html, for export).
rjc, we fixed some issues recently with the filepicker not preserving the
filename on chdir. Had you encountered other problems that would make this a
bad idea to check in?
Comment 4•24 years ago
|
||
Yeah, nsIFilePicker was (is still?) broken on Mac... it was (isn't?) returning
file:/// URLs properly.
Pav, is this still the case?
Assignee: rjc → pavlov
Status: REOPENED → NEW
Comment 6•24 years ago
|
||
I tried Open File on the Mac and it worked for me... so bryner, why don't you
attach your patch to this bug? (I'd be happy to review it.)
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•24 years ago
|
||
Comment 8•24 years ago
|
||
Bryner, looks good & works for me on my Mac. r=rjc
Assignee: rjc → bryner
Status: ASSIGNED → NEW
Comment 9•24 years ago
|
||
just fyi for the dev types, 'Open File' gets checked _every_ single_day_ on every build, on every platform, ever as part of the daily
smoketests. You'd know if and when it broke.
http://www.mozilla.org/quality/smoketests/
Assignee | ||
Comment 10•24 years ago
|
||
Nominating for nsbeta2, because this helps out i18n and is a fairly safe fix.
Status: NEW → ASSIGNED
Keywords: nsbeta2
Assignee | ||
Comment 12•24 years ago
|
||
rjc: one small change I'd like to make, after law brought this up in another
bug... we should probably change:
if (filePicker.show() == nsIFilePicker.returnOK) .....
to
if (filePicker.show() != nsIFilePicker.returnCancel) .....
otherwise, it would fail to save in the returnReplace case. If you think that
would be ok, I'll check this in.
Comment 13•24 years ago
|
||
Yeah, that makes sense.
Assignee | ||
Comment 14•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•