Closed Bug 354954 Opened 18 years ago Closed 18 years ago

[Cocoa] "Save Page As..." doesn't work.

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: sugar.waffle, Assigned: jaas)

References

Details

Attachments

(1 file, 1 obsolete file)

12.97 KB, patch
stuart.morgan+bugzilla
: review+
pavlov
: superreview+
Details | Diff | Splinter Review
In Cocoa widget Firefox, "Save Page As..." doesn't work. 

Mac OS X 10.3.9

O.K
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060926 Minefield/3.0a1

N.G
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060929 Minefield/3.0a1
Summary: [Cocoa Firefox] "Save Page As..." doesn't work. → [Cocoa] "Save Page As..." doesn't work.
When I press Cmd+S, I get a dialog that doesn't let me choose between "HTML only" and "Complete web page".  I'm scared to find out what happens if I click the "Save" button in the dialog.

Mac trunk debug.
(In reply to comment #1)
> When I press Cmd+S, I get a dialog that doesn't let me choose between "HTML
> only" and "Complete web page".  I'm scared to find out what happens if I click
> the "Save" button in the dialog.

Yes, The dialog without "HTML only" and "Complete web page" comes out when 
"Save Page As..." is chosen from the File menu. 
And anything doesn't happen even if "Save" button is pushed. 
This is broken in current SeaMonkey trunk Mac builds also. :(
Blocks: cocoa
I can confirm, I get this also.
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 356519 has been marked as a duplicate of this bug. ***
Both Save Page As... (File menu or context menu) and Save Link As... fail to
save the page, dropping a

Error: uncaught exception: [Exception... "Component returned failure code:
0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIPrefBranch.setComplexValue]" 
nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame ::
chrome://global/content/contentAreaUtils.js :: getTargetFile :: line 545" 
data: no]

in the Error Console.

Saving files from the unknown content type dialog works fine as long as you
have the pref set to not ask where to save, but if you have the filepicker come
up, then you get the randomly-named temp file which doesn't get renamed or
moved to what you chose in the filepicker, and you get the same Error Console
message.
Assignee: nobody → dveditz
Component: File Handling → Form Manager
Product: Firefox → Core
QA Contact: file.handling
Assignee: dveditz → joshmoz
Component: Form Manager → Widget: Cocoa
QA Contact: cocoa
Flags: blocking1.9?
*** Bug 356710 has been marked as a duplicate of this bug. ***
Attached patch fix v0.8 (obsolete) — Splinter Review
This patch fixes things. A comment above the file save code that explains why this is all busted:

-// Note: I don't think Chimera is using this at all.  So - it hasn't been tested.
-//       If you end up calling it, let me know how it turns out.

This patch still needs a localizable "Save as:" string. I'm just posting v0.8 now for safe keeping, I'll try to finish it up tomorrow.
Attached patch fix v1.0Splinter Review
Attachment #242356 - Attachment is obsolete: true
Attachment #242377 - Flags: review?(stuart.morgan)
*** Bug 356710 has been marked as a duplicate of this bug. ***
(In reply to comment #10)
> *** Bug 356710 has been marked as a duplicate of this bug. ***
> 

I agree with you now ... I've applied Josh's 1.0 patch to my fresh source pulled this morning about 9:30 am EDT and I can do Save As ... for both saving a page and for downloading a file.  I've only done a little testing on this build so far, but now I'm looking forward to seeing this approved and checked in.

There is still a cocoa toolkit problem with the Application menu in SeaMonkey trunk ... it's missing 3 - 4 items (all the Hide commands & ...?).  I'm looking for a related bug ... no likelies in sight yet.

     Dale

*** Bug 357415 has been marked as a duplicate of this bug. ***
Comment on attachment 242377 [details] [diff] [review]
fix v1.0

I haven't tested, but the code looks good.  r=me.

A couple thoughts that you can ignore or not as you see fit:

>+#define ACCESSORY_VIEW_PADDING 5
>+#define SAVE_TYPE_CONTROL_TAG 1

Unless this is the moz standard, you might want to use consts instead of #defines, like we do in Camino.  It makes like much easier in the debugger.
 
>+  for (int i = 0; i < numMenuItems; i++) {
>+    const nsString& currentTitle = *mTitles[i];
>+    NSString *titleString = [[[NSString alloc] initWithCharacters:currentTitle.get()
>+                                                           length:currentTitle.Length()] autorelease];
>+    [popupButton addItemWithTitle:titleString];
>+  }

I don't have any idea how big numMenuItems can be, but if it's ever more than a handful you might want to explicitly release titleString instead of autoreleasing it (since it's used in such a confined location, and thus is easy to do safely).

>+  float popupOriginX = [textField frame].size.width + ACCESSORY_VIEW_PADDING * 2;

This would be a bit less fragile as
NSMaxX([textField frame]) + ACCESSORY_VIEW_PADDING
Attachment #242377 - Flags: review?(stuart.morgan) → review+
Attachment #242377 - Flags: superreview?(pavlov)
I will make most if not all of the changes that smorgan suggested on checkin.
Attachment #242377 - Flags: superreview?(pavlov) → superreview+
fixed on trunk
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
*** Bug 354889 has been marked as a duplicate of this bug. ***
Status: RESOLVED → VERIFIED
Flags: blocking1.9?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: