Search
lxdream.org :: lxdream/src/gtkui/gtkui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/gtkui.c
changeset 1040:9e3e41eab2db
prev1036:af7b0c5905dd
next1098:4f2750753a6c
author nkeynes
date Thu Jun 25 21:21:18 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Add quick state bits to the menus
file annotate diff log raw
1.1 --- a/src/gtkui/gtkui.c Wed Jun 24 06:06:40 2009 +0000
1.2 +++ b/src/gtkui/gtkui.c Thu Jun 25 21:21:18 2009 +0000
1.3 @@ -74,8 +74,11 @@
1.4 { "Reset", GTK_STOCK_REFRESH, N_("_Reset"), "<control>R", N_("Reset dreamcast"), G_CALLBACK(reset_action_callback) },
1.5 { "Pause", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL, N_("Pause dreamcast"), G_CALLBACK(pause_action_callback) },
1.6 { "Run", GTK_STOCK_MEDIA_PLAY, N_("Resume"), NULL, N_("Resume"), G_CALLBACK(resume_action_callback) },
1.7 - { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load State..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
1.8 - { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save State..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
1.9 + { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("L_oad State..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
1.10 + { "SaveState", GTK_STOCK_SAVE_AS, N_("S_ave State..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
1.11 + { "QuickLoad", NULL, N_("_Load Quick State"), "F6", N_("Load the current quick save state"), G_CALLBACK(quick_load_action_callback) },
1.12 + { "QuickSave", NULL, N_("_Save Quick State..."), "F5", N_("Save to the current quick save state"), G_CALLBACK(quick_save_action_callback) },
1.13 + { "QuickStateMenu", NULL, N_("Select _Quick State"), NULL, N_("Set quick save state") },
1.14 { "Exit", GTK_STOCK_QUIT, N_("E_xit"), NULL, N_("Exit lxdream"), G_CALLBACK(exit_action_callback) },
1.15 { "GdromSettings", NULL, N_("_GD-Rom") },
1.16 { "GdromUnmount", NULL, N_("_Empty") },
1.17 @@ -99,6 +102,7 @@
1.18 static const GtkToggleActionEntry ui_toggle_actions[] = {
1.19 { "FullScreen", NULL, "_Full Screen", "<alt>Return", "Toggle full screen video", G_CALLBACK(fullscreen_toggle_callback), 0 },
1.20 };
1.21 +static GtkRadioActionEntry ui_radio_actions[MAX_QUICK_STATE+1];
1.22
1.23 // Menus and toolbars
1.24 static const char *ui_description =
1.25 @@ -116,6 +120,21 @@
1.26 " <menuitem action='LoadState'/>"
1.27 " <menuitem action='SaveState'/>"
1.28 " <separator/>"
1.29 + " <menuitem action='QuickLoad'/>"
1.30 + " <menuitem action='QuickSave'/>"
1.31 + " <menu action='QuickStateMenu'>"
1.32 + " <menuitem action='QuickState0'/>"
1.33 + " <menuitem action='QuickState1'/>"
1.34 + " <menuitem action='QuickState2'/>"
1.35 + " <menuitem action='QuickState3'/>"
1.36 + " <menuitem action='QuickState4'/>"
1.37 + " <menuitem action='QuickState5'/>"
1.38 + " <menuitem action='QuickState6'/>"
1.39 + " <menuitem action='QuickState7'/>"
1.40 + " <menuitem action='QuickState8'/>"
1.41 + " <menuitem action='QuickState9'/>"
1.42 + " </menu>"
1.43 + " <separator/>"
1.44 " <menuitem action='Exit'/>"
1.45 " </menu>"
1.46 " <menu action='SettingsMenu'>"
1.47 @@ -150,6 +169,21 @@
1.48 " <menuitem action='LoadState'/>"
1.49 " <menuitem action='SaveState'/>"
1.50 " <separator/>"
1.51 + " <menuitem action='QuickLoad'/>"
1.52 + " <menuitem action='QuickSave'/>"
1.53 + " <menu action='QuickStateMenu'>"
1.54 + " <menuitem action='QuickState0'/>"
1.55 + " <menuitem action='QuickState1'/>"
1.56 + " <menuitem action='QuickState2'/>"
1.57 + " <menuitem action='QuickState3'/>"
1.58 + " <menuitem action='QuickState4'/>"
1.59 + " <menuitem action='QuickState5'/>"
1.60 + " <menuitem action='QuickState6'/>"
1.61 + " <menuitem action='QuickState7'/>"
1.62 + " <menuitem action='QuickState8'/>"
1.63 + " <menuitem action='QuickState9'/>"
1.64 + " </menu>"
1.65 + " <separator/>"
1.66 " <menuitem action='Exit'/>"
1.67 " </menu>"
1.68 " <menu action='DebugMenu'>"
1.69 @@ -207,6 +241,7 @@
1.70 gboolean gui_init( gboolean withDebug, gboolean withFullscreen )
1.71 {
1.72 if( gtk_gui_init_ok ) {
1.73 + int i;
1.74 GError *error = NULL;
1.75 dreamcast_register_module( &gtk_gui_module );
1.76 gtk_gui_alloc_resources();
1.77 @@ -215,6 +250,17 @@
1.78 gtk_action_group_set_translation_domain( global_action_group, NULL );
1.79 gtk_action_group_add_actions( global_action_group, ui_actions, G_N_ELEMENTS(ui_actions), NULL );
1.80 gtk_action_group_add_toggle_actions( global_action_group, ui_toggle_actions, G_N_ELEMENTS(ui_toggle_actions), NULL );
1.81 +
1.82 + for( i=0; i<=MAX_QUICK_STATE; i++ ) {
1.83 + ui_radio_actions[i].name = g_strdup_printf("QuickState%d", i);
1.84 + ui_radio_actions[i].stock_id = NULL;
1.85 + ui_radio_actions[i].label = g_strdup_printf(_("State _%d"), i );
1.86 + ui_radio_actions[i].accelerator = NULL;
1.87 + ui_radio_actions[i].tooltip = g_strdup_printf(_("Use quick save state %d"),i);
1.88 + ui_radio_actions[i].value = i;
1.89 + }
1.90 + gtk_action_group_add_radio_actions( global_action_group, ui_radio_actions, G_N_ELEMENTS(ui_radio_actions),
1.91 + dreamcast_get_quick_state(), G_CALLBACK(quick_state_action_callback), NULL );
1.92 gtk_gui_enable_action("AudioSettings", FALSE);
1.93 gtk_gui_enable_action("NetworkSettings", FALSE);
1.94 gtk_gui_enable_action("VideoSettings", FALSE);
.