Search
lxdream.org :: lxdream/src/gui/gtkui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/gtkui.c
changeset 508:ccd2c10edfe6
prev486:9af294489aad
next530:28bdc62e642a
author nkeynes
date Sat Nov 10 04:45:29 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Tag translatable strings
file annotate diff log raw
1.1 --- a/src/gui/gtkui.c Fri Nov 02 08:22:33 2007 +0000
1.2 +++ b/src/gui/gtkui.c Sat Nov 10 04:45:29 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gtkui.c,v 1.11 2007-11-02 08:22:32 nkeynes Exp $
1.6 + * $Id: gtkui.c,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
1.7 *
1.8 * Core GTK-based user interface
1.9 *
1.10 @@ -16,9 +16,10 @@
1.11 * GNU General Public License for more details.
1.12 */
1.13
1.14 +#include "lxdream.h"
1.15 #include <sys/time.h>
1.16 #include <time.h>
1.17 -#include "dream.h"
1.18 +#include <glib/gi18n.h>
1.19 #include "dreamcast.h"
1.20 #include "display.h"
1.21 #include "gdrom/gdrom.h"
1.22 @@ -61,32 +62,32 @@
1.23
1.24 // UI Actions
1.25 static const GtkActionEntry ui_actions[] = {
1.26 - { "FileMenu", NULL, "_File" },
1.27 - { "SettingsMenu", NULL, "_Settings" },
1.28 - { "HelpMenu", NULL, "_Help" },
1.29 - { "Reset", GTK_STOCK_REFRESH, "_Reset", "<control>R", "Reset dreamcast", G_CALLBACK(reset_action_callback) },
1.30 - { "Pause", GTK_STOCK_MEDIA_PAUSE, "_Pause", NULL, "Pause dreamcast", G_CALLBACK(pause_action_callback) },
1.31 - { "Run", GTK_STOCK_MEDIA_PLAY, "Resume", NULL, "Resume", G_CALLBACK(resume_action_callback) },
1.32 - { "LoadState", GTK_STOCK_REVERT_TO_SAVED, "_Load state...", "F4", "Load an lxdream save state", G_CALLBACK(load_state_action_callback) },
1.33 - { "SaveState", GTK_STOCK_SAVE_AS, "_Save state...", "F3", "Create an lxdream save state", G_CALLBACK(save_state_action_callback) },
1.34 - { "Exit", GTK_STOCK_QUIT, "E_xit", NULL, "Exit lxdream", G_CALLBACK(exit_action_callback) },
1.35 - { "GdromSettings", NULL, "_GD-Rom..." },
1.36 - { "GdromUnmount", NULL, "_Empty" },
1.37 - { "GdromMount", GTK_STOCK_CDROM, "_Open Image...", "<control>O", "Mount a cdrom disc", G_CALLBACK(mount_action_callback) },
1.38 - { "PathSettings", NULL, "_Paths...", NULL, "Configure files and paths", G_CALLBACK(path_settings_callback) },
1.39 - { "AudioSettings", NULL, "_Audio...", NULL, "Configure audio output", G_CALLBACK(audio_settings_callback) },
1.40 - { "ControllerSettings", NULL, "_Controllers...", NULL, "Configure controllers", G_CALLBACK(maple_settings_callback) },
1.41 - { "NetworkSettings", NULL, "_Network...", NULL, "Configure network settings", G_CALLBACK(network_settings_callback) },
1.42 - { "VideoSettings", NULL, "_Video...", NULL, "Configure video output", G_CALLBACK(video_settings_callback) },
1.43 - { "About", GTK_STOCK_ABOUT, "_About...", NULL, "About lxdream", G_CALLBACK(about_action_callback) },
1.44 - { "DebugMenu", NULL, "_Debug" },
1.45 - { "Debugger", NULL, "_Debugger", NULL, "Open debugger window", G_CALLBACK(debugger_action_callback) },
1.46 - { "DebugMem", NULL, "View _Memory", NULL, "View memory dump", G_CALLBACK(debug_memory_action_callback) },
1.47 - { "DebugMmio", NULL, "View IO _Registers", NULL, "View MMIO Registers", G_CALLBACK(debug_mmio_action_callback) },
1.48 - { "SaveScene", NULL, "_Save Scene", NULL, "Save next rendered scene", G_CALLBACK(save_scene_action_callback) },
1.49 - { "SingleStep", GTK_STOCK_REDO, "_Single Step", NULL, "Single step", G_CALLBACK(debug_step_action_callback) },
1.50 - { "RunTo", GTK_STOCK_GOTO_LAST, "Run _To", NULL, "Run to", G_CALLBACK( debug_runto_action_callback) },
1.51 - { "SetBreakpoint", GTK_STOCK_CLOSE, "_Breakpoint", NULL, "Toggle breakpoint", G_CALLBACK( debug_breakpoint_action_callback) }
1.52 + { "FileMenu", NULL, N_("_File") },
1.53 + { "SettingsMenu", NULL, N_("_Settings") },
1.54 + { "HelpMenu", NULL, N_("_Help") },
1.55 + { "Reset", GTK_STOCK_REFRESH, N_("_Reset"), "<control>R", N_("Reset dreamcast"), G_CALLBACK(reset_action_callback) },
1.56 + { "Pause", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL, N_("Pause dreamcast"), G_CALLBACK(pause_action_callback) },
1.57 + { "Run", GTK_STOCK_MEDIA_PLAY, N_("Resume"), NULL, N_("Resume"), G_CALLBACK(resume_action_callback) },
1.58 + { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load state..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
1.59 + { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save state..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
1.60 + { "Exit", GTK_STOCK_QUIT, N_("E_xit"), NULL, N_("Exit lxdream"), G_CALLBACK(exit_action_callback) },
1.61 + { "GdromSettings", NULL, N_("_GD-Rom...") },
1.62 + { "GdromUnmount", NULL, N_("_Empty") },
1.63 + { "GdromMount", GTK_STOCK_CDROM, N_("_Open Image..."), "<control>O", N_("Mount a cdrom disc"), G_CALLBACK(mount_action_callback) },
1.64 + { "PathSettings", NULL, N_("_Paths..."), NULL, N_("Configure files and paths"), G_CALLBACK(path_settings_callback) },
1.65 + { "AudioSettings", NULL, N_("_Audio..."), NULL, N_("Configure audio output"), G_CALLBACK(audio_settings_callback) },
1.66 + { "ControllerSettings", NULL, N_("_Controllers..."), NULL, N_("Configure controllers"), G_CALLBACK(maple_settings_callback) },
1.67 + { "NetworkSettings", NULL, N_("_Network..."), NULL, N_("Configure network settings"), G_CALLBACK(network_settings_callback) },
1.68 + { "VideoSettings", NULL, N_("_Video..."), NULL,N_( "Configure video output"), G_CALLBACK(video_settings_callback) },
1.69 + { "About", GTK_STOCK_ABOUT, N_("_About..."), NULL, N_("About lxdream"), G_CALLBACK(about_action_callback) },
1.70 + { "DebugMenu", NULL, N_("_Debug") },
1.71 + { "Debugger", NULL, N_("_Debugger"), NULL, N_("Open debugger window"), G_CALLBACK(debugger_action_callback) },
1.72 + { "DebugMem", NULL, N_("View _Memory"), NULL, N_("View memory dump"), G_CALLBACK(debug_memory_action_callback) },
1.73 + { "DebugMmio", NULL, N_("View IO _Registers"), NULL, N_("View MMIO Registers"), G_CALLBACK(debug_mmio_action_callback) },
1.74 + { "SaveScene", NULL, N_("_Save Scene"), NULL, N_("Save next rendered scene"), G_CALLBACK(save_scene_action_callback) },
1.75 + { "SingleStep", GTK_STOCK_REDO, N_("_Single Step"), NULL, N_("Single step"), G_CALLBACK(debug_step_action_callback) },
1.76 + { "RunTo", GTK_STOCK_GOTO_LAST, N_("Run _To"), NULL, N_("Run to"), G_CALLBACK( debug_runto_action_callback) },
1.77 + { "SetBreakpoint", GTK_STOCK_CLOSE, N_("_Breakpoint"), NULL, N_("Toggle breakpoint"), G_CALLBACK( debug_breakpoint_action_callback) }
1.78 };
1.79 static const GtkToggleActionEntry ui_toggle_actions[] = {
1.80 { "FullScreen", NULL, "_Full Screen", "<alt>Return", "Toggle full screen video", G_CALLBACK(fullscreen_toggle_callback), 0 },
1.81 @@ -193,6 +194,7 @@
1.82 gtk_gui_alloc_resources();
1.83
1.84 global_action_group = gtk_action_group_new("MenuActions");
1.85 + gtk_action_group_set_translation_domain( global_action_group, NULL );
1.86 gtk_action_group_add_actions( global_action_group, ui_actions, G_N_ELEMENTS(ui_actions), NULL );
1.87 gtk_action_group_add_toggle_actions( global_action_group, ui_toggle_actions, G_N_ELEMENTS(ui_toggle_actions), NULL );
1.88 gtk_gui_enable_action("AudioSettings", FALSE);
1.89 @@ -264,7 +266,9 @@
1.90 GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/DebugMenu/FileMenu/GdromSettings");
1.91 GtkWidget *gdrommenu = gdrom_menu_new();
1.92 gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
1.93 - debug_win = debug_window_new( APP_NAME " " APP_VERSION " :: Debugger", menubar, toolbar, accel_group );
1.94 + gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("Debugger"));
1.95 + debug_win = debug_window_new( title, menubar, toolbar, accel_group );
1.96 + g_free(title);
1.97 }
1.98 }
1.99
1.100 @@ -273,7 +277,9 @@
1.101 if( mmio_win ) {
1.102 mmio_window_show(mmio_win, TRUE);
1.103 } else {
1.104 - mmio_win = mmio_window_new( APP_NAME " " APP_VERSION " :: MMIO Registers" );
1.105 + gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("MMIO Registers"));
1.106 + mmio_win = mmio_window_new( title );
1.107 + g_free(title);
1.108 }
1.109 }
1.110
.