diff --git a/frontends/gnustep/BrowserWindowController.m b/frontends/gnustep/BrowserWindowController.m index 4d4c381c0..0eaaa48d6 100644 --- a/frontends/gnustep/BrowserWindowController.m +++ b/frontends/gnustep/BrowserWindowController.m @@ -94,7 +94,8 @@ static id newTabTarget; selector: @selector(onPreferencesUpdated:) name: PreferencesUpdatedNotificationName object: nil]; - urlSuggestionView = [[UrlSuggestionView alloc] initForUrlBar: urlBar]; + urlSuggestionView = [[UrlSuggestionView alloc] initForUrlBar: urlBar + inBrowserWindowController: self]; NSLog(@"Browser window loaded"); } diff --git a/frontends/gnustep/Makefile b/frontends/gnustep/Makefile index 20fd41653..73a37241e 100644 --- a/frontends/gnustep/Makefile +++ b/frontends/gnustep/Makefile @@ -57,6 +57,7 @@ S_FRONTEND := \ PreferencesWindowController.m \ VerticalTabsView.m \ UrlSuggestionView.m \ + NotifyingTextField.m \ Website.m \ BookmarkFolder.m \ SearchProvider.m \ diff --git a/frontends/gnustep/NotifyingTextField.h b/frontends/gnustep/NotifyingTextField.h new file mode 100644 index 000000000..c82365be3 --- /dev/null +++ b/frontends/gnustep/NotifyingTextField.h @@ -0,0 +1,12 @@ +#import + +// TODO: Are these defined anywhere in GNUStep? +#define KEY_UP 98 +#define KEY_DOWN 104 +#define SpecialKeyPressedNotification @"SpecialKeyPressed" + +@interface NotifyingTextField: NSTextField { + +} + +@end diff --git a/frontends/gnustep/NotifyingTextField.m b/frontends/gnustep/NotifyingTextField.m new file mode 100644 index 000000000..fd72441ba --- /dev/null +++ b/frontends/gnustep/NotifyingTextField.m @@ -0,0 +1,21 @@ +#import +#import "NotifyingTextField.h" + + + +@implementation NotifyingTextField + +-(void)keyUp: (NSEvent*)theEvent { + [super keyUp: theEvent]; + NSLog(@"code: %d", [theEvent keyCode]); + switch ([theEvent keyCode]) { + case KEY_UP: + + case KEY_DOWN: + + defualt: + break; + } +} + +@end diff --git a/frontends/gnustep/UrlSuggestionView.h b/frontends/gnustep/UrlSuggestionView.h index 2846ac259..d7828f609 100644 --- a/frontends/gnustep/UrlSuggestionView.h +++ b/frontends/gnustep/UrlSuggestionView.h @@ -1,5 +1,6 @@ #import +@class BrowserWindowController; @class UrlSuggestionView; @protocol UrlSuggestionViewDelegate @@ -7,7 +8,10 @@ @end @interface UrlSuggestionView: NSScrollView { + // Not Retained id urlBar; + id browserWindowController; + BOOL isActive; NSTableView *tableView; NSArray *recentWebsites; @@ -15,7 +19,7 @@ NSString *previousQuery; } --(id)initForUrlBar: (NSTextField*)aUrlBar; +-(id)initForUrlBar: (NSTextField*)aUrlBar inBrowserWindowController: (BrowserWindowController*)aBrowserWindowController; -(void)dismiss; @end diff --git a/frontends/gnustep/UrlSuggestionView.m b/frontends/gnustep/UrlSuggestionView.m index 3c72e0dbe..03b9dedc8 100644 --- a/frontends/gnustep/UrlSuggestionView.m +++ b/frontends/gnustep/UrlSuggestionView.m @@ -1,5 +1,6 @@ #import #import "UrlSuggestionView.h" +#import "BrowserWindowController.h" #import "Preferences.h" #define ENTRY_HEIGHT 25 @@ -14,9 +15,10 @@ @implementation UrlSuggestionView --(id)initForUrlBar: (NSTextField*)aUrlBar { +-(id)initForUrlBar: (NSTextField*)aUrlBar inBrowserWindowController: (BrowserWindowController*)aBrowserWindowController { if ((self = [super init])) { urlBar = aUrlBar; + browserWindowController = aBrowserWindowController; NSRect frame = [aUrlBar frame]; frame.size.height = 0; [self setFrame: frame]; @@ -160,6 +162,7 @@ Website *selectedWebsite = [filteredWebsites objectAtIndex: row]; [urlBar setStringValue: [selectedWebsite url]]; [self updateQuery: @""]; + [browserWindowController openWebsite: selectedWebsite]; NSLog(@"Selection changed"); } diff --git a/frontends/gnustep/res/Browser.gorm/data.classes b/frontends/gnustep/res/Browser.gorm/data.classes index 3f717a23f..54504a408 100644 --- a/frontends/gnustep/res/Browser.gorm/data.classes +++ b/frontends/gnustep/res/Browser.gorm/data.classes @@ -33,6 +33,13 @@ ); Super = NSObject; }; + NotifyingTextField = { + Actions = ( + ); + Outlets = ( + ); + Super = NSTextField; + }; PlotView = { Actions = ( ); diff --git a/frontends/gnustep/res/Browser.gorm/objects.gorm b/frontends/gnustep/res/Browser.gorm/objects.gorm index 7107b2532..da3aa435f 100644 Binary files a/frontends/gnustep/res/Browser.gorm/objects.gorm and b/frontends/gnustep/res/Browser.gorm/objects.gorm differ