Adding a 'Search Page' item to the Go menu (bug 160056). Made it and the Home item always enabled.

This commit is contained in:
sfraser%netscape.com 2002-07-30 05:09:44 +00:00
parent 5c46c062fc
commit 96749bf2d1
34 changed files with 144 additions and 38 deletions

View File

@ -181,8 +181,9 @@ class nsIDOMNode;
- (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList;
- (void)saveURL: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
url: (NSString*)aURLSpec suggestedFilename: (NSString*)aFilename;
- (void)printDocument;
- (IBAction)printDocument:(id)aSender;
- (void)printPreview;
- (IBAction)performSearch:(id)aSender;
- (void)startThrobber;
- (void)stopThrobber;

View File

@ -553,7 +553,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Search the Internet"];
[toolbarItem setImage:[NSImage imageNamed:@"saveShowFile.tif"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(performSearch)];
[toolbarItem setAction:@selector(performSearch:)];
} else if ( [itemIdent isEqual:ThrobberToolbarItemIdentifier] ) {
[toolbarItem setLabel:@""];
[toolbarItem setPaletteLabel:@"Progress"];
@ -587,7 +587,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Print this page"];
[toolbarItem setImage:[NSImage imageNamed:@"print"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(printDocument)];
[toolbarItem setAction:@selector(printDocument:)];
} else {
toolbarItem = nil;
}
@ -744,7 +744,7 @@ static NSArray* sToolbarDefaults = nil;
[self openNewTabWithURL: viewSource referrer:nil loadInBackground: loadInBackground];
}
- (void)printDocument
- (IBAction)printDocument:(id)aSender
{
[[mBrowserView getBrowserView] printDocument];
}
@ -756,7 +756,7 @@ static NSArray* sToolbarDefaults = nil;
//[[mBrowserView getBrowserView] printPreview];
}
- (void)performSearch
- (IBAction)performSearch:(id)aSender
{
NSString *searchEngine = NSLocalizedStringFromTable(@"SearchPageDefault", @"WebsiteDefaults", nil);

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

Binary file not shown.

View File

@ -98,6 +98,7 @@ class BookmarksService;
-(IBAction) goBack:(id)aSender;
-(IBAction) goForward:(id)aSender;
-(IBAction) goHome:(id)aSender;
-(IBAction) doSearch:(id)aSender;
-(IBAction) previousTab:(id)aSender;
-(IBAction) nextTab:(id)aSender;

View File

@ -258,7 +258,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController printDocument];
[browserController printDocument:aSender];
}
-(IBAction) printPreview:(id)aSender
@ -363,6 +363,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
}
}
-(IBAction) doSearch:(id)aSender
{
NSWindow* browserWindow = [self getFrontmostBrowserWindow];
if (browserWindow) {
if (![browserWindow isMainWindow])
[browserWindow makeKeyAndOrderFront:self];
[[browserWindow windowController] performSearch: aSender];
}
else {
[self newWindow:self];
browserWindow = [self getFrontmostBrowserWindow];
[[browserWindow windowController] performSearch: aSender];
}
}
- (void)adjustBookmarksMenuItemsEnabling:(BOOL)inBrowserWindowFrontmost;
{
[mAddBookmarkMenuItem setEnabled:inBrowserWindowFrontmost];
@ -599,7 +615,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController viewSource: self];
[browserController viewSource: aSender];
}
-(BOOL)isMainWindowABrowserWindow
@ -658,13 +674,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
if (action == @selector(newTab:) ||
/* ... many more items go here ... */
/* action == @selector(goHome:) || */ // always enabled
/* action == @selector(doSearch:) || */ // always enabled
action == @selector(printPage:) ||
action == @selector(findInPage:) ||
action == @selector(doReload:) ||
action == @selector(biggerTextSize:) ||
action == @selector(smallerTextSize:) ||
action == @selector(viewSource:) ||
action == @selector(goHome:) ||
action == @selector(savePage:)) {
if (browserController)
return YES;

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

Binary file not shown.

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

View File

@ -98,6 +98,7 @@ class BookmarksService;
-(IBAction) goBack:(id)aSender;
-(IBAction) goForward:(id)aSender;
-(IBAction) goHome:(id)aSender;
-(IBAction) doSearch:(id)aSender;
-(IBAction) previousTab:(id)aSender;
-(IBAction) nextTab:(id)aSender;

View File

@ -258,7 +258,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController printDocument];
[browserController printDocument:aSender];
}
-(IBAction) printPreview:(id)aSender
@ -363,6 +363,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
}
}
-(IBAction) doSearch:(id)aSender
{
NSWindow* browserWindow = [self getFrontmostBrowserWindow];
if (browserWindow) {
if (![browserWindow isMainWindow])
[browserWindow makeKeyAndOrderFront:self];
[[browserWindow windowController] performSearch: aSender];
}
else {
[self newWindow:self];
browserWindow = [self getFrontmostBrowserWindow];
[[browserWindow windowController] performSearch: aSender];
}
}
- (void)adjustBookmarksMenuItemsEnabling:(BOOL)inBrowserWindowFrontmost;
{
[mAddBookmarkMenuItem setEnabled:inBrowserWindowFrontmost];
@ -599,7 +615,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController viewSource: self];
[browserController viewSource: aSender];
}
-(BOOL)isMainWindowABrowserWindow
@ -658,13 +674,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
if (action == @selector(newTab:) ||
/* ... many more items go here ... */
/* action == @selector(goHome:) || */ // always enabled
/* action == @selector(doSearch:) || */ // always enabled
action == @selector(printPage:) ||
action == @selector(findInPage:) ||
action == @selector(doReload:) ||
action == @selector(biggerTextSize:) ||
action == @selector(smallerTextSize:) ||
action == @selector(viewSource:) ||
action == @selector(goHome:) ||
action == @selector(savePage:)) {
if (browserController)
return YES;

View File

@ -181,8 +181,9 @@ class nsIDOMNode;
- (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList;
- (void)saveURL: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
url: (NSString*)aURLSpec suggestedFilename: (NSString*)aFilename;
- (void)printDocument;
- (IBAction)printDocument:(id)aSender;
- (void)printPreview;
- (IBAction)performSearch:(id)aSender;
- (void)startThrobber;
- (void)stopThrobber;

View File

@ -553,7 +553,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Search the Internet"];
[toolbarItem setImage:[NSImage imageNamed:@"saveShowFile.tif"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(performSearch)];
[toolbarItem setAction:@selector(performSearch:)];
} else if ( [itemIdent isEqual:ThrobberToolbarItemIdentifier] ) {
[toolbarItem setLabel:@""];
[toolbarItem setPaletteLabel:@"Progress"];
@ -587,7 +587,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Print this page"];
[toolbarItem setImage:[NSImage imageNamed:@"print"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(printDocument)];
[toolbarItem setAction:@selector(printDocument:)];
} else {
toolbarItem = nil;
}
@ -744,7 +744,7 @@ static NSArray* sToolbarDefaults = nil;
[self openNewTabWithURL: viewSource referrer:nil loadInBackground: loadInBackground];
}
- (void)printDocument
- (IBAction)printDocument:(id)aSender
{
[[mBrowserView getBrowserView] printDocument];
}
@ -756,7 +756,7 @@ static NSArray* sToolbarDefaults = nil;
//[[mBrowserView getBrowserView] printPreview];
}
- (void)performSearch
- (IBAction)performSearch:(id)aSender
{
NSString *searchEngine = NSLocalizedStringFromTable(@"SearchPageDefault", @"WebsiteDefaults", nil);

View File

@ -181,8 +181,9 @@ class nsIDOMNode;
- (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList;
- (void)saveURL: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
url: (NSString*)aURLSpec suggestedFilename: (NSString*)aFilename;
- (void)printDocument;
- (IBAction)printDocument:(id)aSender;
- (void)printPreview;
- (IBAction)performSearch:(id)aSender;
- (void)startThrobber;
- (void)stopThrobber;

View File

@ -553,7 +553,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Search the Internet"];
[toolbarItem setImage:[NSImage imageNamed:@"saveShowFile.tif"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(performSearch)];
[toolbarItem setAction:@selector(performSearch:)];
} else if ( [itemIdent isEqual:ThrobberToolbarItemIdentifier] ) {
[toolbarItem setLabel:@""];
[toolbarItem setPaletteLabel:@"Progress"];
@ -587,7 +587,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Print this page"];
[toolbarItem setImage:[NSImage imageNamed:@"print"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(printDocument)];
[toolbarItem setAction:@selector(printDocument:)];
} else {
toolbarItem = nil;
}
@ -744,7 +744,7 @@ static NSArray* sToolbarDefaults = nil;
[self openNewTabWithURL: viewSource referrer:nil loadInBackground: loadInBackground];
}
- (void)printDocument
- (IBAction)printDocument:(id)aSender
{
[[mBrowserView getBrowserView] printDocument];
}
@ -756,7 +756,7 @@ static NSArray* sToolbarDefaults = nil;
//[[mBrowserView getBrowserView] printPreview];
}
- (void)performSearch
- (IBAction)performSearch:(id)aSender
{
NSString *searchEngine = NSLocalizedStringFromTable(@"SearchPageDefault", @"WebsiteDefaults", nil);

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

Binary file not shown.

View File

@ -98,6 +98,7 @@ class BookmarksService;
-(IBAction) goBack:(id)aSender;
-(IBAction) goForward:(id)aSender;
-(IBAction) goHome:(id)aSender;
-(IBAction) doSearch:(id)aSender;
-(IBAction) previousTab:(id)aSender;
-(IBAction) nextTab:(id)aSender;

View File

@ -258,7 +258,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController printDocument];
[browserController printDocument:aSender];
}
-(IBAction) printPreview:(id)aSender
@ -363,6 +363,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
}
}
-(IBAction) doSearch:(id)aSender
{
NSWindow* browserWindow = [self getFrontmostBrowserWindow];
if (browserWindow) {
if (![browserWindow isMainWindow])
[browserWindow makeKeyAndOrderFront:self];
[[browserWindow windowController] performSearch: aSender];
}
else {
[self newWindow:self];
browserWindow = [self getFrontmostBrowserWindow];
[[browserWindow windowController] performSearch: aSender];
}
}
- (void)adjustBookmarksMenuItemsEnabling:(BOOL)inBrowserWindowFrontmost;
{
[mAddBookmarkMenuItem setEnabled:inBrowserWindowFrontmost];
@ -599,7 +615,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController viewSource: self];
[browserController viewSource: aSender];
}
-(BOOL)isMainWindowABrowserWindow
@ -658,13 +674,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
if (action == @selector(newTab:) ||
/* ... many more items go here ... */
/* action == @selector(goHome:) || */ // always enabled
/* action == @selector(doSearch:) || */ // always enabled
action == @selector(printPage:) ||
action == @selector(findInPage:) ||
action == @selector(doReload:) ||
action == @selector(biggerTextSize:) ||
action == @selector(smallerTextSize:) ||
action == @selector(viewSource:) ||
action == @selector(goHome:) ||
action == @selector(savePage:)) {
if (browserController)
return YES;

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

Binary file not shown.

View File

@ -16,6 +16,7 @@
closeTab = id;
displayPreferencesWindow = id;
doReload = id;
doSearch = id;
doStop = id;
feedbackLink = id;
findAgain = id;

View File

@ -9,7 +9,7 @@
<key>266</key>
<string>23 342 277 90 0 0 1152 746 </string>
<key>29</key>
<string>8 701 446 44 0 0 1152 746 </string>
<string>8 702 446 44 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -29,6 +29,10 @@
</dict>
<key>IBLastGroupID</key>
<string>2</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5S66</string>
</dict>

View File

@ -98,6 +98,7 @@ class BookmarksService;
-(IBAction) goBack:(id)aSender;
-(IBAction) goForward:(id)aSender;
-(IBAction) goHome:(id)aSender;
-(IBAction) doSearch:(id)aSender;
-(IBAction) previousTab:(id)aSender;
-(IBAction) nextTab:(id)aSender;

View File

@ -258,7 +258,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController printDocument];
[browserController printDocument:aSender];
}
-(IBAction) printPreview:(id)aSender
@ -363,6 +363,22 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
}
}
-(IBAction) doSearch:(id)aSender
{
NSWindow* browserWindow = [self getFrontmostBrowserWindow];
if (browserWindow) {
if (![browserWindow isMainWindow])
[browserWindow makeKeyAndOrderFront:self];
[[browserWindow windowController] performSearch: aSender];
}
else {
[self newWindow:self];
browserWindow = [self getFrontmostBrowserWindow];
[[browserWindow windowController] performSearch: aSender];
}
}
- (void)adjustBookmarksMenuItemsEnabling:(BOOL)inBrowserWindowFrontmost;
{
[mAddBookmarkMenuItem setEnabled:inBrowserWindowFrontmost];
@ -599,7 +615,7 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
BrowserWindowController* browserController = [self getMainWindowBrowserController];
if (browserController)
[browserController viewSource: self];
[browserController viewSource: aSender];
}
-(BOOL)isMainWindowABrowserWindow
@ -658,13 +674,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
if (action == @selector(newTab:) ||
/* ... many more items go here ... */
/* action == @selector(goHome:) || */ // always enabled
/* action == @selector(doSearch:) || */ // always enabled
action == @selector(printPage:) ||
action == @selector(findInPage:) ||
action == @selector(doReload:) ||
action == @selector(biggerTextSize:) ||
action == @selector(smallerTextSize:) ||
action == @selector(viewSource:) ||
action == @selector(goHome:) ||
action == @selector(savePage:)) {
if (browserController)
return YES;

View File

@ -181,8 +181,9 @@ class nsIDOMNode;
- (void)saveDocument: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList;
- (void)saveURL: (NSView*)aFilterView filterList: (NSPopUpButton*)aFilterList
url: (NSString*)aURLSpec suggestedFilename: (NSString*)aFilename;
- (void)printDocument;
- (IBAction)printDocument:(id)aSender;
- (void)printPreview;
- (IBAction)performSearch:(id)aSender;
- (void)startThrobber;
- (void)stopThrobber;

View File

@ -553,7 +553,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Search the Internet"];
[toolbarItem setImage:[NSImage imageNamed:@"saveShowFile.tif"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(performSearch)];
[toolbarItem setAction:@selector(performSearch:)];
} else if ( [itemIdent isEqual:ThrobberToolbarItemIdentifier] ) {
[toolbarItem setLabel:@""];
[toolbarItem setPaletteLabel:@"Progress"];
@ -587,7 +587,7 @@ static NSArray* sToolbarDefaults = nil;
[toolbarItem setToolTip:@"Print this page"];
[toolbarItem setImage:[NSImage imageNamed:@"print"]];
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(printDocument)];
[toolbarItem setAction:@selector(printDocument:)];
} else {
toolbarItem = nil;
}
@ -744,7 +744,7 @@ static NSArray* sToolbarDefaults = nil;
[self openNewTabWithURL: viewSource referrer:nil loadInBackground: loadInBackground];
}
- (void)printDocument
- (IBAction)printDocument:(id)aSender
{
[[mBrowserView getBrowserView] printDocument];
}
@ -756,7 +756,7 @@ static NSArray* sToolbarDefaults = nil;
//[[mBrowserView getBrowserView] printPreview];
}
- (void)performSearch
- (IBAction)performSearch:(id)aSender
{
NSString *searchEngine = NSLocalizedStringFromTable(@"SearchPageDefault", @"WebsiteDefaults", nil);