diff --git a/frontends/gnustep/AppDelegate.m b/frontends/gnustep/AppDelegate.m index a72fd6b87..bd3999ab9 100644 --- a/frontends/gnustep/AppDelegate.m +++ b/frontends/gnustep/AppDelegate.m @@ -298,14 +298,32 @@ static NSMenuItem *menuItemForItem(id item) { } } +-(void) openFileWindow: (id)sender +{ + Website *website; + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + [openPanel setAllowsMultipleSelection: YES]; + + if ([openPanel runModal] == NSOKButton) { + for (int i = 0; i < [[openPanel URLs] count]; i++) { + Website *website; + NSURL *url = [[openPanel URLs] objectAtIndex: i]; + website = [[Website alloc] initWithName: @"" url: [NSString + stringWithFormat: @"file://%@", [url absoluteString]]]; + [website autorelease]; + [self openWebsite: website]; + } + } +} + - (BOOL) application: (NSApplication *)application openFile: (NSString *)fileName { - NSArray *args; - NSString *path; - NSTask *task; - - [self openDeveloperFileAtPath: fileName]; + Website *website; + website = [[Website alloc] initWithName: @"" url: [NSString + stringWithFormat: @"file://%@", fileName]]; + [website autorelease]; + [self openWebsite: website]; return YES; } @@ -314,31 +332,36 @@ static NSMenuItem *menuItemForItem(id item) { userData: (NSString*)ud error: (NSString**)err { - NSString *url; + NSString *webURL; NSArray *types; NSArray *args; NSString *path; NSTask *task; NSString *pboardString; + Website *website; *err = nil; types = [pb types]; - if (![types containsObject:NSStringPboardType] || !(pboardString = [pb stringForType:NSStringPboardType])) + if (![types containsObject:NSStringPboardType] || + !(pboardString = [pb stringForType:NSStringPboardType])) { *err = NSLocalizedString(@"Error: Pasteboard doesn't contain a string.", @"Pasteboard couldn't give string."); return; } - url = [pb stringForType: NSStringPboardType]; - if (url == nil) + webURL = [pb stringForType: NSStringPboardType]; + if (webURL == nil) { *err = @"No string value supplied on pasteboard"; return; } - [self openDeveloperFileAtPath: url]; + website = [[Website alloc] initWithName: @"" url: webURL]; + [website autorelease]; + [self openWebsite: website]; + return; } diff --git a/frontends/gnustep/BrowserWindowController.m b/frontends/gnustep/BrowserWindowController.m index 7bfb8c57b..e20963e8c 100644 --- a/frontends/gnustep/BrowserWindowController.m +++ b/frontends/gnustep/BrowserWindowController.m @@ -664,7 +664,7 @@ static id newTabTarget; -(void)sharePage: (id)sender { - NSRunAlertPanel(@"Hey!", @"This feature is coming soon.", @"OK", NULL, NULL); + [[[NSApplication sharedApplication] delegate] showHistoryWindow: sender]; } diff --git a/frontends/gnustep/res/Menu.gorm/data.classes b/frontends/gnustep/res/Menu.gorm/data.classes index 6fd3f3b7a..7ea217839 100644 --- a/frontends/gnustep/res/Menu.gorm/data.classes +++ b/frontends/gnustep/res/Menu.gorm/data.classes @@ -7,7 +7,8 @@ "showFindPanel:", "showHistoryWindow:", "showBookmarksWindow:", - "showPreferencesWindow:" + "showPreferencesWindow:", + "openFileWindow:" ); Outlets = ( ); @@ -19,6 +20,7 @@ "didTapNewWindow:", "findNext:", "findPrevious:", + "openFileWindow:", "newFolder:", "newTab:", "reload:", diff --git a/frontends/gnustep/res/Menu.gorm/objects.gorm b/frontends/gnustep/res/Menu.gorm/objects.gorm index 3c44aacef..e589a5db0 100644 Binary files a/frontends/gnustep/res/Menu.gorm/objects.gorm and b/frontends/gnustep/res/Menu.gorm/objects.gorm differ