Search
lxdream.org :: lxdream :: r773:146c3210768b
lxdream 0.9.1
released Jun 29
Download Now
changeset773:146c3210768b
parent772:c0b5928dd600
child774:4ba7fe9365c9
authornkeynes
dateMon Jul 28 04:47:28 2008 +0000 (15 years ago)
Fix some consistency issues between the cocoa + gtk menus
src/cocoaui/cocoaui.c
src/gtkui/gtkui.c
1.1 --- a/src/cocoaui/cocoaui.c Mon Jul 28 04:45:24 2008 +0000
1.2 +++ b/src/cocoaui/cocoaui.c Mon Jul 28 04:47:28 2008 +0000
1.3 @@ -55,6 +55,15 @@
1.4 - (void) setAppleMenu:(NSMenu *)aMenu;
1.5 @end
1.6
1.7 +/**
1.8 + * Produces the menu title by looking the text up in gettext, removing any
1.9 + * underscores, and returning the result as an NSString.
1.10 + */
1.11 +static NSString *NSMENU_( const char *text )
1.12 +{
1.13 + return [[NSString stringWithUTF8String: gettext(text)] stringByReplacingOccurrencesOfString: @"_" withString: @""];
1.14 +}
1.15 +
1.16 static void cocoa_gui_create_menu(void)
1.17 {
1.18 NSMenu *appleMenu, *services;
1.19 @@ -70,12 +79,12 @@
1.20 [appleMenu addItemWithTitle:title action:@selector(about_action:) keyEquivalent:@""];
1.21
1.22 [appleMenu addItem:[NSMenuItem separatorItem]];
1.23 - [appleMenu addItemWithTitle: NS_("Preferences...") action:@selector(preferences_action:) keyEquivalent:@","];
1.24 + [appleMenu addItemWithTitle: NSMENU_("_Preferences...") action:@selector(preferences_action:) keyEquivalent:@","];
1.25
1.26 // Services Menu
1.27 [appleMenu addItem:[NSMenuItem separatorItem]];
1.28 services = [[[NSMenu alloc] init] autorelease];
1.29 - [appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""];
1.30 + [appleMenu addItemWithTitle: NS_("Services") action:nil keyEquivalent:@""];
1.31 [appleMenu setSubmenu: services forItem: [appleMenu itemWithTitle: @"Services"]];
1.32
1.33 // Hide AppName
1.34 @@ -104,20 +113,20 @@
1.35
1.36 NSMenu *gdromMenu = cocoa_gdrom_menu_new();
1.37
1.38 - NSMenu *fileMenu = [[NSMenu alloc] initWithTitle: NS_("File")];
1.39 - [fileMenu addItemWithTitle: NS_("Load Binary") action: @selector(load_binary_action:) keyEquivalent: @"b"];
1.40 - [[fileMenu addItemWithTitle: NS_("GD-Rom") action: nil keyEquivalent: @""]
1.41 + NSMenu *fileMenu = [[NSMenu alloc] initWithTitle: NSMENU_("_File")];
1.42 + [fileMenu addItemWithTitle: NSMENU_("Load _Binary...") action: @selector(load_binary_action:) keyEquivalent: @"b"];
1.43 + [[fileMenu addItemWithTitle: NSMENU_("_GD-Rom") action: nil keyEquivalent: @""]
1.44 setSubmenu: gdromMenu];
1.45 [fileMenu addItem: [NSMenuItem separatorItem]];
1.46 - [[fileMenu addItemWithTitle: NS_("Reset") action: @selector(reset_action:) keyEquivalent: @"r"]
1.47 + [[fileMenu addItemWithTitle: NSMENU_("_Reset") action: @selector(reset_action:) keyEquivalent: @"r"]
1.48 setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
1.49 - [fileMenu addItemWithTitle: NS_("Pause") action: @selector(pause_action:) keyEquivalent: @"p"];
1.50 + [fileMenu addItemWithTitle: NSMENU_("_Pause") action: @selector(pause_action:) keyEquivalent: @"p"];
1.51 [fileMenu addItemWithTitle: NS_("Resume") action: @selector(run_action:) keyEquivalent: @"r"];
1.52 [fileMenu addItem: [NSMenuItem separatorItem]];
1.53 - [fileMenu addItemWithTitle: NS_("Load State") action: @selector(load_action:) keyEquivalent: @"o"];
1.54 - [fileMenu addItemWithTitle: NS_("Save State") action: @selector(save_action:) keyEquivalent: @"s"];
1.55 + [fileMenu addItemWithTitle: NSMENU_("_Load State...") action: @selector(load_action:) keyEquivalent: @"o"];
1.56 + [fileMenu addItemWithTitle: NSMENU_("_Save State...") action: @selector(save_action:) keyEquivalent: @"s"];
1.57
1.58 - menuItem = [[NSMenuItem alloc] initWithTitle:NS_("File") action: nil keyEquivalent: @""];
1.59 + menuItem = [[NSMenuItem alloc] initWithTitle:NSMENU_("_File") action: nil keyEquivalent: @""];
1.60 [menuItem setSubmenu: fileMenu];
1.61 [menu addItem: menuItem];
1.62
1.63 @@ -287,7 +296,7 @@
1.64 va_list args;
1.65 va_start(args, msg);
1.66 error_string = [[NSString alloc] initWithFormat: [NSString stringWithCString: msg] arguments: args];
1.67 - NSRunAlertPanel(@"Error in lxdream", error_string, nil, nil, nil);
1.68 + NSRunAlertPanel(NS_("Error in Lxdream"), error_string, nil, nil, nil);
1.69 va_end(args);
1.70 return TRUE;
1.71 } else {
2.1 --- a/src/gtkui/gtkui.c Mon Jul 28 04:45:24 2008 +0000
2.2 +++ b/src/gtkui/gtkui.c Mon Jul 28 04:47:28 2008 +0000
2.3 @@ -74,10 +74,10 @@
2.4 { "Reset", GTK_STOCK_REFRESH, N_("_Reset"), "<control>R", N_("Reset dreamcast"), G_CALLBACK(reset_action_callback) },
2.5 { "Pause", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL, N_("Pause dreamcast"), G_CALLBACK(pause_action_callback) },
2.6 { "Run", GTK_STOCK_MEDIA_PLAY, N_("Resume"), NULL, N_("Resume"), G_CALLBACK(resume_action_callback) },
2.7 - { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load state..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
2.8 - { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save state..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
2.9 + { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load State..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
2.10 + { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save State..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
2.11 { "Exit", GTK_STOCK_QUIT, N_("E_xit"), NULL, N_("Exit lxdream"), G_CALLBACK(exit_action_callback) },
2.12 - { "GdromSettings", NULL, N_("_GD-Rom...") },
2.13 + { "GdromSettings", NULL, N_("_GD-Rom") },
2.14 { "GdromUnmount", NULL, N_("_Empty") },
2.15 { "GdromMount", GTK_STOCK_CDROM, N_("_Open Image..."), "<control>O", N_("Mount a cdrom disc"), G_CALLBACK(mount_action_callback) },
2.16 { "PathSettings", NULL, N_("_Paths..."), NULL, N_("Configure files and paths"), G_CALLBACK(path_settings_callback) },
.