Closed Bug 145802 Opened 24 years ago Closed 24 years ago

Implement session history menu (Go)

Categories

(Camino Graveyard :: History, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: winnie, Assigned: hewitt)

References

Details

Attachments

(1 file)

Implement session history menu (Go).
Blocks: 145820
QA Contact: petersen → winnie
Attached patch patchSplinter Review
some comments: remove the webProgressListener and ProgressDlgController fixes. I'm going to land those on the tip tonight. +// the tag of the separator after which to insert history menu items +#define INSERTION_TAG 4000 +// the maximum number of history entry menuitems to display +#define MAX_MENUITEMS 15 #defines are bad c++. Use enums or const int's. + // get controller for current window + BrowserWindowController *controller; + controller = (BrowserWindowController*)[[[NSApplication sharedApplication] mainWindow] windowController]; + if (!controller) return nsnull; two things about this: - remember this is c++, merge the declaration and the init onto 1 line. - you're creating a new NSApplication here. you really want to use the global |NSApp| instead: BrowserWindowController* controller = [[NSApp mainWindow] windowController]; if (!controller) return nsnull; + int i = 0; + for (i = [self numberOfItems]-1; i > insertionIndex ; --i) { don't need to worry about win32, so let's do this all on one line: for ( int i = [self ...] ... ) + NSMenuItem *newItem = [self addItemWithTitle:title action:@selector(historyItemAction:) keyEquivalent:@""]; what if the title is really long? You should proably middle-truncate it at 15-20 chars, or something reasonable, so the menu doesn't get too wide. It also seems to me that your numbering might be off. You delete everything after |INSERTION_TAG|, implying that it's always left in the menus. Did you give the divider item that tag in interface builder? You then add things with tag: + [newItem setTag:INSERTION_TAG+i]; problem is, |i| can be 0, so you end up adding another tag of |INSERTION_TAG|. Will cocoa freak out with two tags when you search for it in emptyHistoryItems:? I'd guess not, but why take that chance? Or am i misreading?
fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Test cases for this feature: http://www.mozilla.org/quality/browser/front-end/testcases/history/ Use only session history test cases and not global history test cases.
Verified in the 2002-06-04-05 trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: