From 28d43a91a6acaa44c8d92c38396d3995bb7dc721 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Tue, 10 Jan 2017 21:40:05 +0000 Subject: [PATCH] On Windows only use the runtime config dialog box if the gui console is not enabled. The rfb and vncsrv guis show the textconfig console instead. --- bochs/gui/textconfig.cc | 22 +++++++++++----------- bochs/gui/textconfig.h | 3 ++- bochs/gui/win32dialog.cc | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/bochs/gui/textconfig.cc b/bochs/gui/textconfig.cc index cf0e88eda..02fd06aad 100644 --- a/bochs/gui/textconfig.cc +++ b/bochs/gui/textconfig.cc @@ -59,7 +59,7 @@ extern "C" { #define bx_fgets SIM->bx_gets /* functions for changing particular options */ -void bx_config_interface_init(); +void bx_text_config_interface_init(); int bx_read_rc(char *rc); int bx_write_rc(char *rc); void bx_plugin_ctrl(); @@ -398,14 +398,14 @@ int do_menu(const char *pname) } } -int bx_config_interface(int menu) +int bx_text_config_interface(int menu) { Bit32u choice; char sr_path[CI_PATH_LENGTH]; while (1) { switch (menu) { case BX_CI_INIT: - bx_config_interface_init(); + bx_text_config_interface_init(); return 0; case BX_CI_START_SIMULATION: SIM->begin_simulation(bx_startup_flags.argc, bx_startup_flags.argv); @@ -439,7 +439,7 @@ int bx_config_interface(int menu) SIM->get_param_enum(BXPN_BOCHS_START)->set(BX_RUN_START); break; case 3: - bx_config_interface(BX_CI_START_OPTS); + bx_text_config_interface(BX_CI_START_OPTS); SIM->get_param_enum(BXPN_BOCHS_START)->set(BX_RUN_START); break; case 4: bx_write_rc(NULL); break; @@ -448,11 +448,11 @@ int bx_config_interface(int menu) if (strcmp(sr_path, "none")) { SIM->get_param_bool(BXPN_RESTORE_FLAG)->set(1); SIM->get_param_string(BXPN_RESTORE_PATH)->set(sr_path); - bx_config_interface(BX_CI_START_SIMULATION); + bx_text_config_interface(BX_CI_START_SIMULATION); } } break; - case 6: bx_config_interface(BX_CI_START_SIMULATION); break; + case 6: bx_text_config_interface(BX_CI_START_SIMULATION); break; case 7: SIM->quit_sim(1); return -1; default: BAD_OPTION(menu, choice); } @@ -763,7 +763,7 @@ ask: assert(0); // switch statement should return } -void bx_config_interface_init() +void bx_text_config_interface_init() { SIM->set_notify_callback(config_interface_notify_callback, NULL); } @@ -1041,17 +1041,17 @@ static int ci_callback(void *userdata, ci_command_t command) switch (command) { case CI_START: - bx_config_interface_init(); + bx_text_config_interface_init(); if (SIM->get_param_enum(BXPN_BOCHS_START)->get() == BX_QUICK_START) - bx_config_interface(BX_CI_START_SIMULATION); + bx_text_config_interface(BX_CI_START_SIMULATION); else { if (!SIM->test_for_text_console()) return CI_ERR_NO_TEXT_CONSOLE; - bx_config_interface(BX_CI_START_MENU); + bx_text_config_interface(BX_CI_START_MENU); } break; case CI_RUNTIME_CONFIG: - bx_config_interface(BX_CI_RUNTIME); + bx_text_config_interface(BX_CI_RUNTIME); break; case CI_SHUTDOWN: break; diff --git a/bochs/gui/textconfig.h b/bochs/gui/textconfig.h index 63c2708ae..9b2b1126c 100644 --- a/bochs/gui/textconfig.h +++ b/bochs/gui/textconfig.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2009-2013 The Bochs Project +// Copyright (C) 2009-2017 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -45,5 +45,6 @@ enum { }; int init_text_config_interface(); +int bx_text_config_interface(int menu); #endif diff --git a/bochs/gui/win32dialog.cc b/bochs/gui/win32dialog.cc index 8678e7cde..78d79bfad 100644 --- a/bochs/gui/win32dialog.cc +++ b/bochs/gui/win32dialog.cc @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2003-2016 The Bochs Project +// Copyright (C) 2003-2017 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ #include "param_names.h" #include "win32res.h" #include "win32paramdlg.h" +#include "textconfig.h" const char log_choices[N_ACT+1][16] = {"ignore", "log", "warn user", "ask user", "end simulation", "no change"}; @@ -679,15 +680,19 @@ static int win32_ci_callback(void *userdata, ci_command_t command) } break; case CI_RUNTIME_CONFIG: - if (MainMenuDialog(GetBochsWindow(), 1) < 0) { - bx_user_quit = 1; + if (!bx_gui->has_gui_console()) { + if (MainMenuDialog(GetBochsWindow(), 1) < 0) { + bx_user_quit = 1; #if !BX_DEBUGGER - bx_atexit(); - SIM->quit_sim(1); + bx_atexit(); + SIM->quit_sim(1); #else - bx_dbg_exit(1); + bx_dbg_exit(1); #endif - return -1; + return -1; + } + } else { + bx_text_config_interface(BX_CI_RUNTIME); } break; case CI_SHUTDOWN: