Closed Bug 223701 Opened 21 years ago Closed 21 years ago

Incorrect Info window displays the wrong data for a empty folder

Categories

(Camino Graveyard :: Bookmarks, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino0.8

People

(Reporter: chrispetersen, Assigned: jaas)

Details

Attachments

(3 files, 1 obsolete file)

Build: 2003102409 Platform: 10.3 Expected Results: The info window should be empty What I got: The info window uses a title of %bookmark_title% and displays two info tabs. Steps to reproduce: 1) Select Manage Bookmarks 2) Control -click in Bookmarks collection pane (far left side) and select New collection. This should create a new folder. 3) With focus on this new folder, control - click on the bookmarks main pane. 4) Select Get Info from the contextual menu . 5) Notice, the info window that opens is incorrect.
Attached image screen shot
Yep, we shouldn't be able to open info windows for the root folders.
Target Milestone: --- → Camino0.8
Looks like the problem is in the method here: line 1544 of BookmarkViewController.mm Problem is the "Get Info" part is retained in the contextual menu whether or not the clicked-on view is relevent or not. Shouldn't be there unless a bookmark or maybe a bookmark folder is actually clicked on.
bookmarkViewController doesn't have 1500 lines ;)
FYI, one of my upcoming projects is to pick up bug 225915 and get it ready to land. That might already fix this bug, so we probably don't need to worry about this too much yet.
My bad - I meant line 1144 in comment #3.
Stuart - glancing through the patch in bug 225915, it does appear to fix the problem. Let me know when you're going to get around to cleaning it up. If you can't do it for a while I'll do it later this week. If you're going to do it soon I'll review ASAP.
Taking this bug because I plan on fixing it this week and I want it in my list.
Assignee: pinkerton → josha
Attached file modified nib file, v1
Attachment #148134 - Flags: superreview?(pinkerton)
+- (NSMenu *)contextMenuForItem:(id)item fromView:(BookmarkOutlineView *)outlineView target:(id)target should probably check for |item| being non-null before going too far and return something reasonable. + if( isFolder || (outlineView && ([outlineView numberOfSelectedRows] > 1)) ) keep consistent spacing, should be: if (isFolder || ...))) happens in several places + menuTitle = NSLocalizedString(@"Open Tabs in New Window", @""); + else + menuTitle = NSLocalizedString(@"Open in New Window", @""); we should probably add these strings to Localized.strings so that localizers know they have to update them w/out scanning the code. + if ([item isKindOfClass:[BookmarkFolder class]]) { are toplevel containers and smart folders also |BookmarkFolder|s? just checking
Attachment #148134 - Attachment is obsolete: true
Attachment #148134 - Flags: superreview?(pinkerton)
This patch addresses Pinkerton's comments and also fixes some issues with the default menus in smart folders where new folder cannot be created. Use the same modified nib file as was posted with version 1 of this patch. "are toplevel containers and smart folders also |BookmarkFolder|s? just checking" Yes they are.
Attachment #148149 - Flags: superreview?(pinkerton)
Attachment #148149 - Flags: review?(sbm5)
+ // don't do anything if item == nil + if (!item) + return nil; while i can't think of anything better here, are we sure that the menu code can handle a nil being returned? +-(NSMenu*)menu +{ + BookmarkManager *bm = [BookmarkManager sharedBookmarkManager]; + BookmarkFolder *activeCollection = [[self delegate] activeCollection]; + // only give a default menu if its the bookmark menu or toolbar what's this for? when does it get called compared to the other code?
The menu code takes a nil return to mean that there is no menu to display. The reason for "// only give a default menu if its the bookmark menu or toolbar" is that the default menu consists of an option to make a new folder. The only collections where this is legal are the bookmark menu and the bookmark toolbar. This code gets called whenever somebody right-clicks in the righthand bm manager view.
the one issue that i see is that in the history collection, there's no separator between open in new tab and delete. everywhere else there is one. is that a flaw in this patch or something that can be fixed in another patch?
To fix that, just add this line: [contextMenu addItem:[NSMenuItem separatorItem]]; around line 447 of HistoryDataSource.mm
Also, Localizable.strings needs: "Get Info" = "Get Info"; "Use as Dock Menu" = "Use as Dock Menu"; appended to the end of the file
landed on trunk and branch
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment on attachment 148149 [details] [diff] [review] contextual menu cleanup #2 Removing review requests
Attachment #148149 - Flags: superreview?(pinkerton)
Attachment #148149 - Flags: review?(sbm5)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: