Closed Bug 352078 Opened 18 years ago Closed 18 years ago

RSS selection menu looks weird when there's no default feed app inserted

Categories

(Camino Graveyard :: Preferences, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.5

People

(Reporter: stuart.morgan+bugzilla, Assigned: nick.kreeger)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 2 obsolete files)

3.05 KB, patch
stuart.morgan+bugzilla
: review+
mikepinkerton
: superreview+
Details | Diff | Splinter Review
The popup doesn't do what we wanted when the default app either doesn't exist, or isn't in the main list. It's a simple thing mistake we both missed: + // The user selected an application that is not registered for "feed://". + if (!insertedDefaultApp) { + NSURL* defaultFeedAppURL = [[NSWorkspace sharedWorkspace] urlOfApplicationWithIdentifier:defaultFeedViewerID]; + if (defaultFeedAppURL) { + NSMenuItem* menuItem = [self menuItemForAppURL:defaultFeedAppURL + withBundleID:defaultFeedViewerID + andAction:nil + andTarget:inTarget]; + [[inPopupButton menu] insertItem:menuItem atIndex:0]; + } + // Since we couldn't find a default application, add a blank menu item. + else { + NSMenuItem* dummyItem = [[NSMenuItem alloc] init]; + [dummyItem setTitle:@""]; + [[inPopupButton menu] insertItem:dummyItem atIndex:0]; + [dummyItem release]; + } + } Both of these add to [inPopupButton menu] (before it's set) rather than menu, so they don't show up. The |if (defaultFeedAppURL)| should also check that the app in question isn't Safari if it's 10.3 (arguably it should show if it's 10.4 and that already is their default). + // allow the user to select a feed application + [menu addItem:[NSMenuItem separatorItem]]; This should only be added if at least one app was actually added to the list in the main loop, to prevent double separators.
Target Milestone: --- → Camino1.1
Attached patch Patch 1 (obsolete) — Splinter Review
Here is a proposed patch.
Attachment #237832 - Flags: review?(stuart.morgan)
Comment on attachment 237832 [details] [diff] [review] Patch 1 >+ BOOL shouldInsertSeperatorAtEnd = NO; // determine if we need to add a seperator above the select item. Remove the comment; its name and use self-document. > if (defaultFeedViewerID && [curBundleID isEqualToString:defaultFeedViewerID]) { > [menu insertItem:menuItem atIndex:0]; > insertedDefaultApp = YES; > } > else > [menu addItem:menuItem]; >+ >+ shouldInsertSeperatorAtEnd = YES; The |shouldInsertSeperatorAtEnd = YES;| needs to be inside the else, otherwise if the only installed app is the default app there will be two dividers with nothing between them.
Attachment #237832 - Flags: review?(stuart.morgan) → review-
Attached patch Patch 2 (obsolete) — Splinter Review
Round 2...
Attachment #237832 - Attachment is obsolete: true
Attachment #237889 - Flags: review?(stuart.morgan)
Attached patch Patch 2.1Splinter Review
Oops, missed the comment
Attachment #237889 - Attachment is obsolete: true
Attachment #237890 - Flags: review?(stuart.morgan)
Attachment #237889 - Flags: review?(stuart.morgan)
Comment on attachment 237890 [details] [diff] [review] Patch 2.1 r=me
Attachment #237890 - Flags: superreview?(mikepinkerton)
Attachment #237890 - Flags: review?(stuart.morgan)
Attachment #237890 - Flags: review+
Comment on attachment 237890 [details] [diff] [review] Patch 2.1 sr=pink
Attachment #237890 - Flags: superreview?(mikepinkerton) → superreview+
Checked in trunk and MOZILLA_1_8_BRANCH.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: