Camino only - Menu cleanup extravaganza. Patch/nib combo is in 275170. Fixes also 151093 159230 271943 319408 and 331839. r=smorgan sr=pink

This commit is contained in:
stridey%gmail.com 2006-10-11 16:42:30 +00:00
Родитель c843710fb6
Коммит a69c3e18e9
12 изменённых файлов: 211 добавлений и 30 удалений

Двоичный файл не отображается.

Просмотреть файл

@ -16,7 +16,102 @@
ACTIONS = {
addBookmark = id;
addBookmarkFolder = id;
addBookmarkForLink = id;
addBookmarkSeparator = id;
addBookmarkWithoutPrompt = id;
addTabGroupWithoutPrompt = id;
addToAddressBook = id;
back = id;
cancelLocationSheet = id;
cancelSearchSheet = id;
closeCurrentTab = id;
closeOtherTabs = id;
closeSendersTab = id;
copyAddressToClipboard = id;
copyImage = id;
copyImageLocation = id;
copyLinkLocation = id;
endLocationSheet = id;
endSearchSheet = id;
forward = id;
frameToNewTab = id;
frameToNewWindow = id;
frameToThisWindow = id;
getInfo = id;
goToLocationFromToolbarURLField = id;
home = id;
makeTextBigger = id;
makeTextDefaultSize = id;
makeTextSmaller = id;
manageBookmarks = id;
manageHistory = id;
moveTabToNewWindow = id;
newTab = id;
nextTab = id;
openFeedPrefPane = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
pageSetup = id;
performSearch = id;
previousTab = id;
printDocument = id;
reload = id;
reloadAllTabs = id;
reloadSendersTab = id;
reloadWithNewCharset = id;
saveFrameAs = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
searchForSelection = id;
sendURL = id;
sendURLFromLink = id;
showBookmarksInfo = id;
showPageInfo = id;
showSiteCertificate = id;
stop = id;
viewOnlyThisImage = id;
viewPageSource = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mBackItem = NSMenuItem;
mContentView = BrowserContentView;
mCopyItem = NSMenuItem;
mForwardItem = NSMenuItem;
mImageLinkMenu = NSMenu;
mImageMailToLinkMenu = NSMenu;
mImageMenu = NSMenu;
mInputMenu = NSMenu;
mLinkMenu = NSMenu;
mLocationSheetURLField = NSTextField;
mLocationSheetWindow = NSWindow;
mLocationToolbarView = ExtendedSplitView;
mMailToLinkMenu = NSMenu;
mPageMenu = NSMenu;
mPersonalToolbar = BookmarkToolbar;
mProgress = NSProgressIndicator;
mProxyIcon = PageProxyIcon;
mSearchBar = SearchTextField;
mSearchSheetTextField = SearchTextField;
mSearchSheetWindow = NSWindow;
mStatus = NSTextField;
mStatusBar = NSView;
mTabBrowser = BrowserTabView;
mTabMenu = NSMenu;
mURLBar = AutoCompleteTextField;
};
SUPERCLASS = NSWindowController;
},
{
ACTIONS = {
addBookmark = id;
addBookmarkFolder = id;
addBookmarkSeparator = id;
addBookmarkWithoutPrompt = id;
addTabGroupWithoutPrompt = id;
fillForm = id;
getInfo = id;
miniaturizeAll = id;
@ -91,6 +186,9 @@
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkMenuItem = NSMenuItem;
mAddBookmarkWithoutPromptMenuItem = NSMenuItem;
mAddTabGroupMenuItem = NSMenuItem;
mAddTabGroupWithoutPromptMenuItem = NSMenuItem;
mApplication = NSApplication;
mBookmarksHelperMenu = NSMenu;
mBookmarksMenu = BookmarkMenu;
@ -117,6 +215,7 @@
SUPERCLASS = NSView;
},
{CLASS = NSObject; LANGUAGE = ObjC; },
{CLASS = ThrobberHandler; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = ToolbarController;
LANGUAGE = ObjC;

Просмотреть файл

@ -3,20 +3,21 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>7 6 408 289 0 0 1024 746 </string>
<string>3 20 408 289 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>54 670 453 44 0 0 1024 746 </string>
<string>23 702 482 44 0 0 1024 746 </string>
<key>494</key>
<string>726 607 116 61 0 0 1600 1002 </string>
<key>670</key>
<string>398 459 199 118 0 0 1600 1002 </string>
<string>328 258 307 175 0 0 1024 746 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>670</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>

Двоичные данные
camino/resources/localized/English.lproj/MainMenu.nib/keyedobjects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -82,6 +82,9 @@ typedef enum EBookmarkOpenBehavior
IBOutlet NSMenuItem* mBookmarksToolbarMenuItem;
IBOutlet NSMenuItem* mAddBookmarkMenuItem;
IBOutlet NSMenuItem* mAddBookmarkWithoutPromptMenuItem;
IBOutlet NSMenuItem* mAddTabGroupMenuItem;
IBOutlet NSMenuItem* mAddTabGroupWithoutPromptMenuItem;
IBOutlet NSMenuItem* mCreateBookmarksFolderMenuItem;
IBOutlet NSMenuItem* mCreateBookmarksSeparatorMenuItem; // unused
IBOutlet NSMenuItem* mShowAllBookmarksMenuItem;
@ -106,6 +109,7 @@ typedef enum EBookmarkOpenBehavior
}
-(IBAction)aboutWindow:(id)sender;
-(IBAction) feedbackLink:(id)aSender;
// File menu actions.
-(IBAction) newWindow:(id)aSender;
@ -163,7 +167,6 @@ typedef enum EBookmarkOpenBehavior
// Help menu actions
-(IBAction) supportLink:(id)aSender;
-(IBAction) infoLink:(id)aSender;
-(IBAction) feedbackLink:(id)aSender;
-(IBAction) releaseNoteLink:(id)aSender;
-(IBAction) tipsTricksLink:(id)aSender;
-(IBAction) searchCustomizeLink:(id)aSender;

Просмотреть файл

@ -1009,14 +1009,24 @@ Otherwise, we return the URL we originally got. Right now this supports .url,
// update our stand-in menu by hand (because it doesn't get autoupdated)
[mBookmarksHelperMenu update];
[mAddBookmarkMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mAddBookmarkMenuItem target]
andAction:[mAddBookmarkMenuItem action]]];
[mCreateBookmarksFolderMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mCreateBookmarksFolderMenuItem target]
andAction:[mCreateBookmarksFolderMenuItem action]]];
[mCreateBookmarksSeparatorMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mCreateBookmarksSeparatorMenuItem target]
andAction:[mCreateBookmarksSeparatorMenuItem action]]];
[mShowAllBookmarksMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mShowAllBookmarksMenuItem target]
andAction:[mShowAllBookmarksMenuItem action]]];
// For the add bookmark menu items, target + action can't be used as a unique identifier, so use title instead
// This is safe, since we assume that we're keeping the "real" bookmarks menu and our stand-in synchronized
[mAddBookmarkMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTitle:[mAddBookmarkMenuItem title]]];
[mAddBookmarkWithoutPromptMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTitle:[mAddBookmarkWithoutPromptMenuItem title]]];
[mAddTabGroupMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTitle:[mAddTabGroupMenuItem title]]];
[mAddTabGroupWithoutPromptMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTitle:[mAddTabGroupWithoutPromptMenuItem title]]];
[mCreateBookmarksFolderMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mCreateBookmarksFolderMenuItem target]
andAction:[mCreateBookmarksFolderMenuItem action]]];
[mCreateBookmarksSeparatorMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mCreateBookmarksSeparatorMenuItem target]
andAction:[mCreateBookmarksSeparatorMenuItem action]]];
[mShowAllBookmarksMenuItem takeStateFromItem:[mBookmarksHelperMenu itemWithTarget:[mShowAllBookmarksMenuItem target]
andAction:[mShowAllBookmarksMenuItem action]]];
// Enable 'Create tab group' menu items based on number of tabs
int numberOfTabs = [[[self getKeyWindowBrowserController] getTabBrowser] numberOfTabViewItems];
[mAddTabGroupMenuItem setEnabled:(numberOfTabs > 1)];
[mAddTabGroupWithoutPromptMenuItem setEnabled:(numberOfTabs > 1)];
// We enable bookmark items themselves from the carbon event handler that fires before the menu is shown.
mBookmarksMenuUpdatePending = NO;

Просмотреть файл

@ -66,6 +66,7 @@ extern NSString* const kAddBookmarkItemPrimaryTabKey; // NSNumber with book, t
- (IBAction)parentFolderChanged:(id)sender;
- (IBAction)toggleTabGroup:(id)sender;
- (void)makeTabGroup:(BOOL)isTabGroup;
- (void)setDefaultParentFolder:(BookmarkFolder*)inFolder andIndex:(int)inIndex;
- (void)setBookmarkViewController:(BookmarkViewController*)inBMViewController;

Просмотреть файл

@ -56,6 +56,8 @@ NSString* const kAddBookmarkItemPrimaryTabKey = @"primary";
+ (NSString*)bookmarkTitleForItem:(NSDictionary*)inItem;
+ (NSDictionary*)primaryBookmarkItem:(NSArray*)inItems;
- (void)updateTitle:(BOOL)isTabGroup;
- (void)buildBookmarksFolderPopup;
- (void)createBookmarks;
- (void)clearState;
@ -114,15 +116,25 @@ NSString* const kAddBookmarkItemPrimaryTabKey = @"primary";
}
- (IBAction)toggleTabGroup:(id)sender
{
BOOL isTabGroup = ([mTabGroupCheckbox state] == NSOnState);
[self updateTitle:isTabGroup];
}
- (void)makeTabGroup:(BOOL)isTabGroup
{
[mTabGroupCheckbox setState:(isTabGroup ? NSOnState : NSOffState)];
[self updateTitle:isTabGroup];
}
- (void)updateTitle:(BOOL)isTabGroup
{
NSString* defaultGroupTitle = [NSString stringWithFormat:NSLocalizedString(@"defaultTabGroupTitle", @"[%d tabs] %@"), [mBookmarkItems count], mDefaultTitle];
// if title is unedited and we're bookmarking a tab group, prepend a prefix to indicate this
// If the title is unedited, update to the default name
if ([[mTitleField stringValue] isEqualToString:mDefaultTitle] ||
[[mTitleField stringValue] isEqualToString:defaultGroupTitle])
{
[mTitleField setStringValue:([mTabGroupCheckbox state] == NSOnState) ? defaultGroupTitle : mDefaultTitle];
}
[mTitleField setStringValue:(isTabGroup ? defaultGroupTitle : mDefaultTitle)];
}
- (void)setDefaultTitle:(NSString*)aString
@ -226,17 +238,9 @@ NSString* const kAddBookmarkItemPrimaryTabKey = @"primary";
if (!initialFolder)
initialFolder = [bookmarkManager lastUsedBookmarkFolder];
if (initialFolder)
{
int initialItemIndex = [[mParentFolderPopup menu] indexOfItemWithRepresentedObject:initialFolder];
if (initialItemIndex != -1)
[mParentFolderPopup selectItemAtIndex:initialItemIndex];
}
else if ([mParentFolderPopup numberOfItems] > 0)
{
int initialItemIndex = [[mParentFolderPopup menu] indexOfItemWithRepresentedObject:[bookmarkManager toolbarFolder]];
int initialItemIndex = [[mParentFolderPopup menu] indexOfItemWithRepresentedObject:initialFolder];
if (initialItemIndex != -1)
[mParentFolderPopup selectItemAtIndex:initialItemIndex];
}
[mParentFolderPopup synchronizeTitleAndSelectedItem];
}

Просмотреть файл

@ -594,6 +594,9 @@ static BookmarkManager* gBookmarkManager = nil;
- (BookmarkFolder*)lastUsedBookmarkFolder
{
if (!mLastUsedFolder)
return [self toolbarFolder];
return mLastUsedFolder;
}
@ -781,7 +784,7 @@ static BookmarkManager* gBookmarkManager = nil;
[contextMenu addItem:shiftMenuItem];
if (!outlineView || ([items count] == 1)) {
menuTitle = NSLocalizedString(@"Get Info", @"");
menuTitle = NSLocalizedString(@"Bookmark Info", @"");
menuItem = [[[NSMenuItem alloc] initWithTitle:menuTitle action:@selector(showBookmarkInfo:) keyEquivalent:@""] autorelease];
[menuItem setTarget:target];
[contextMenu addItem:menuItem];

Просмотреть файл

@ -105,6 +105,7 @@ static const int kEscapeKeyCode = 53;
// Pass command-return off to the controller so that locations/searches may be opened in a new tab.
// Pass command-plus off to the controller to enlarge the text size.
// Pass command-1..9 to the controller to load that bookmark bar item
// Pass command-D off to the controller to add a bookmark
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
{
BrowserWindowController* windowController = (BrowserWindowController*)[self delegate];
@ -130,6 +131,13 @@ static const int kEscapeKeyCode = 53;
handled = YES;
}
}
else if (keyChar == 'd') {
BOOL cmdKeyIsDown = (([theEvent modifierFlags] & NSCommandKeyMask) != 0);
if (cmdKeyIsDown) {
[windowController addBookmark:nil];
handled = YES;
}
}
if (handled)
return YES;

Просмотреть файл

@ -317,6 +317,8 @@ typedef enum
- (IBAction)showSiteCertificate:(id)sender;
- (IBAction)addBookmark:(id)aSender;
- (IBAction)addBookmarkWithoutPrompt:(id)aSender;
- (IBAction)addTabGroupWithoutPrompt:(id)aSender;
- (IBAction)addBookmarkForLink:(id)aSender;
- (IBAction)addBookmarkFolder:(id)aSender;
- (IBAction)addBookmarkSeparator:(id)aSender;

Просмотреть файл

@ -1564,6 +1564,13 @@ enum BWCOpenDest {
if (action == @selector(fillForm:))
return ![[[self getBrowserWrapper] getCurrentURI] hasPrefix:@"about:"];
if(action == @selector(getInfo:)) {
if([self bookmarkManagerIsVisible])
[aMenuItem setTitle:NSLocalizedString(@"Bookmark Info", nil)];
else
[aMenuItem setTitle:NSLocalizedString(@"Page Info", nil)];
}
return YES;
}
@ -2266,7 +2273,9 @@ enum BWCOpenDest {
- (IBAction)viewPageSource:(id)aSender
{
BOOL loadInBackground = (([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) != 0);
// If it's a capital V, shift is down
BOOL loadInBackground = ([[aSender keyEquivalent] isEqualToString:@"V"]);
NSString* urlStr = [[mBrowserView getBrowserView] getCurrentURI];
[self loadSourceOfURL:urlStr inBackground:loadInBackground];
}
@ -2586,8 +2595,49 @@ enum BWCOpenDest {
[itemsArray addObject:itemInfo];
}
[[AddBookmarkDialogController sharedAddBookmarkDialogController] showDialogWithLocationsAndTitles:itemsArray isFolder:NO onWindow:[self window]];
AddBookmarkDialogController* dlgController = [AddBookmarkDialogController sharedAddBookmarkDialogController];
[dlgController showDialogWithLocationsAndTitles:itemsArray isFolder:NO onWindow:[self window]];
if (([aSender keyEquivalentModifierMask] & NSAlternateKeyMask) != 0)
[dlgController makeTabGroup:YES];
}
- (IBAction)addBookmarkWithoutPrompt:(id)aSender
{
BookmarkManager* bookmarkManager = [BookmarkManager sharedBookmarkManager];
BookmarkFolder* parentFolder = [bookmarkManager lastUsedBookmarkFolder];
NSString* itemTitle = nil;
NSString* itemURL = nil;
[[self getBrowserWrapper] getTitle:&itemTitle andHref:&itemURL];
[parentFolder addBookmark:itemTitle url:itemURL inPosition:[parentFolder count] isSeparator:NO];
[bookmarkManager setLastUsedBookmarkFolder:parentFolder];
}
- (IBAction)addTabGroupWithoutPrompt:(id)aSender
{
BookmarkManager* bookmarkManager = [BookmarkManager sharedBookmarkManager];
BookmarkFolder* parentFolder = [bookmarkManager lastUsedBookmarkFolder];
unsigned int folderPosition = [parentFolder count];
unsigned int numItems = [mTabBrowser numberOfTabViewItems];
NSString* itemTitle = nil;
NSString* itemURL = nil;
[[self getBrowserWrapper] getTitle:&itemTitle andHref:&itemURL];
NSString* titleString = [NSString stringWithFormat:NSLocalizedString(@"defaultTabGroupTitle", nil), numItems, itemTitle];
BookmarkFolder* newGroup = [parentFolder addBookmarkFolder:titleString inPosition:folderPosition isGroup:YES];
for (unsigned int i = 0; i < numItems; i++) {
BrowserWrapper* browserWrapper = (BrowserWrapper*)[[mTabBrowser tabViewItemAtIndex:i] view];
[browserWrapper getTitle:&itemTitle andHref:&itemURL];
[newGroup addBookmark:itemTitle url:itemURL inPosition:i isSeparator:NO];
}
[bookmarkManager setLastUsedBookmarkFolder:parentFolder];
}
- (IBAction)addBookmarkForLink:(id)aSender