Add hidden option for enabling non-modal dialogs.

This commit is contained in:
Brandon Wright 2010-10-30 09:21:26 -05:00
parent ab6f76a9a3
commit c6677d8292
4 changed files with 11 additions and 4 deletions

View File

@ -172,6 +172,7 @@ Snes9xConfig::load_defaults (void)
netplay_last_rom [0] = '\0'; netplay_last_rom [0] = '\0';
netplay_last_host [0] = '\0'; netplay_last_host [0] = '\0';
netplay_last_port = 6096; netplay_last_port = 6096;
modal_dialogs = 1;
#ifdef USE_OPENGL #ifdef USE_OPENGL
bilinear_filter = 0; bilinear_filter = 0;
@ -307,6 +308,7 @@ Snes9xConfig::save_config_file (void)
xml_out_int (xml, "fullscreen", fullscreen); xml_out_int (xml, "fullscreen", fullscreen);
xml_out_int (xml, "ui_visible", ui_visible); xml_out_int (xml, "ui_visible", ui_visible);
xml_out_int (xml, "statusbar_visible", statusbar_visible); xml_out_int (xml, "statusbar_visible", statusbar_visible);
xml_out_int (xml, "modal_dialogs", modal_dialogs);
xml_out_float (xml, "ntsc_hue", ntsc_setup.hue); xml_out_float (xml, "ntsc_hue", ntsc_setup.hue);
xml_out_float (xml, "ntsc_saturation", ntsc_setup.saturation); xml_out_float (xml, "ntsc_saturation", ntsc_setup.saturation);
@ -661,6 +663,10 @@ Snes9xConfig::set_option (const char *name, const char *value)
{ {
strncpy (export_directory, value, PATH_MAX); strncpy (export_directory, value, PATH_MAX);
} }
else if (!strcasecmp (name, "modal_dialogs"))
{
modal_dialogs = atoi (value) ? 1 : 0;
}
else if (!strcasecmp (name, "window_width")) else if (!strcasecmp (name, "window_width"))
{ {
window_width = atoi (value); window_width = atoi (value);

View File

@ -123,6 +123,7 @@ class Snes9xConfig
int pause_emulation_on_switch; int pause_emulation_on_switch;
int num_threads; int num_threads;
unsigned char screensaver_needs_reset; unsigned char screensaver_needs_reset;
int modal_dialogs;
int pointer_is_visible; int pointer_is_visible;
struct timeval pointer_timestamp; struct timeval pointer_timestamp;

View File

@ -1846,7 +1846,7 @@ Snes9xWindow::toggle_ui (void)
void void
Snes9xWindow::pause_from_focus_change (void) Snes9xWindow::pause_from_focus_change (void)
{ {
sys_pause++; sys_pause += config->modal_dialogs;
propagate_pause_state (); propagate_pause_state ();
@ -1856,7 +1856,8 @@ Snes9xWindow::pause_from_focus_change (void)
void void
Snes9xWindow::unpause_from_focus_change (void) Snes9xWindow::unpause_from_focus_change (void)
{ {
sys_pause--; if (--sys_pause < 0)
sys_pause = 0;
propagate_pause_state (); propagate_pause_state ();
return; return;

View File

@ -68,8 +68,7 @@ class Snes9xWindow : public GtkBuilderWindow
void expose (GdkEventExpose *event); void expose (GdkEventExpose *event);
Snes9xConfig *config; Snes9xConfig *config;
unsigned char user_pause; int user_pause, sys_pause;
unsigned char sys_pause;
int last_width, last_height; int last_width, last_height;
int mouse_region_x, mouse_region_y; int mouse_region_x, mouse_region_y;
int mouse_region_width, mouse_region_height; int mouse_region_width, mouse_region_height;