From f935e5dd8b2786c6227c71d5e4c86075cfa09348 Mon Sep 17 00:00:00 2001 From: gecko_reverse Date: Sat, 11 Aug 2007 19:51:07 +0000 Subject: [PATCH] help menu works now --- desmume/src/cocoa/main.m | 16 +++++++++++++--- desmume/src/cocoa/preferences.m | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/desmume/src/cocoa/main.m b/desmume/src/cocoa/main.m index eda29b50f..992731734 100644 --- a/desmume/src/cocoa/main.m +++ b/desmume/src/cocoa/main.m @@ -64,6 +64,11 @@ NSMenu *menu; - (void)about; - (void)preferences; +//help menu +- (void)launchWebsite; +- (void)launchForums; +- (void)bugReport; + @end @interface NSApplication(delegate) @@ -501,9 +506,14 @@ a way to get the time of a save that's not a string / human formatted... help = [[NSMenu alloc] initWithTitle:localizedString(@"Help", nil)]; [menu setSubmenu:help forItem:help_item]; - [help addItemWithTitle:@"Website" action:nil keyEquivalent: @""]; - [help addItemWithTitle:@"Forums" action:nil keyEquivalent: @""]; - [help addItemWithTitle:@"Submit A Bug Report" action:nil keyEquivalent: @""]; + temp = [help addItemWithTitle:@"Website" action:@selector(launchWebsite) keyEquivalent: @""]; + [temp setTarget:NSApp]; + + temp = [help addItemWithTitle:@"Forums" action:@selector(launchForums) keyEquivalent: @""]; + [temp setTarget:NSApp]; + + temp = [help addItemWithTitle:@"Submit A Bug Report" action:@selector(bugReport) keyEquivalent: @""]; + [temp setTarget:NSApp]; [NSApp setMainMenu: menu]; diff --git a/desmume/src/cocoa/preferences.m b/desmume/src/cocoa/preferences.m index d45d29cc6..f1051f158 100644 --- a/desmume/src/cocoa/preferences.m +++ b/desmume/src/cocoa/preferences.m @@ -37,6 +37,21 @@ NSPopUpButton *language_selection; @implementation NSApplication(custom_extensions) +- (void)launchWebsite +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://desmume.sourceforge.net"]]; +} + +- (void)launchForums +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://forums.desmume.org/index.php"]]; +} + +- (void)bugReport +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://sourceforge.net/tracker/?func=add&group_id=164579&atid=832291"]]; +} + - (void)about { bool was_paused = paused;