diff --git a/bochs/gui/win32dialog.cc b/bochs/gui/win32dialog.cc index aa29e0f10..6542a6c19 100644 --- a/bochs/gui/win32dialog.cc +++ b/bochs/gui/win32dialog.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32dialog.cc,v 1.14 2004-02-01 01:40:14 vruppert Exp $ +// $Id: win32dialog.cc,v 1.15 2004-02-01 19:22:41 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// #include "config.h" @@ -274,18 +274,65 @@ void RuntimeDlgSetTab(HWND hDlg, int tabnum) ShowWindow(GetDlgItem(hDlg, IDSTATUS2), (tabnum == 0) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDSTATUS3), (tabnum == 0) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDSTATUS4), (tabnum == 0) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDINFO), (tabnum == 1) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDLOGOPT1), (tabnum == 1) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDLOGOPT2), (tabnum == 1) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDLABEL5), (tabnum == 2) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDLABEL6), (tabnum == 2) ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(hDlg, IDLABEL7), (tabnum == 2) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGLBL1), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGLBL2), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGLBL3), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGLBL4), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGLBL5), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGEVT1), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGEVT2), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGEVT3), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGEVT4), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGEVT5), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDLOGINFO), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDADVLOGOPT), (tabnum == 1) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDMISCLBL1), (tabnum == 2) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDMISCLBL2), (tabnum == 2) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDMISCLBL3), (tabnum == 2) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDVGAUPDATE), (tabnum == 2) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDMOUSE), (tabnum == 2) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDKBDPASTE), (tabnum == 2) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDUSERBTN), (tabnum == 2) ? SW_SHOW : SW_HIDE); } +void RuntimeDlgInitLogOpt(HWND hDlg) +{ + char choices[5][16] = {"ignore", "log", "ask user", "end simulation", "no change"}; + int level, idx; + int defchoice[5]; + + for (level=0; level<5; level++) { + int mod = 0; + int first = SIM->get_log_action (mod, level); + BOOL consensus = true; + // now compare all others to first. If all match, then use "first" as + // the initial value. + for (mod=1; mod<SIM->get_n_log_modules (); mod++) { + if (first != SIM->get_log_action (mod, level)) { + consensus = false; + break; + } + } + if (consensus) + defchoice[level] = first; + else + defchoice[level] = 4; + } + for (level=0; level<5; level++) { + idx = 0; + for (int action=0; action<5; action++) { + if (((level > 1) && (action > 0)) || ((level < 2) && ((action < 2) || (action > 3)))) { + SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_ADDSTRING, 0, (LPARAM)choices[action]); + SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETITEMDATA, idx, action); + if (action == defchoice[level]) { + SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETCURSEL, idx, 0); + } + idx++; + } + } + } +} + static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { TC_ITEM tItem; @@ -295,7 +342,7 @@ static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l long noticode; static BOOL changed; BOOL old_changed; - int value; + int idx, level, value; char buffer[32]; static bx_atadevice_options cdromop[4]; static char origpath[4][MAX_PATH]; @@ -333,6 +380,7 @@ static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l devcount++; } } + RuntimeDlgInitLogOpt(hDlg); SetDlgItemInt(hDlg, IDVGAUPDATE, SIM->get_param_num(BXP_VGA_UPDATE_INTERVAL)->get(), FALSE); SetDlgItemInt(hDlg, IDKBDPASTE, SIM->get_param_num(BXP_KBD_PASTE_DELAY)->get(), FALSE); if (SIM->get_param_num(BXP_MOUSE_ENABLED)->get()) { @@ -378,10 +426,16 @@ static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l SendMessage(GetDlgItem(hDlg, IDSTATUS1+device), BM_SETCHECK, BST_CHECKED, 0); } break; - case IDLOGOPT1: - EndDialog(hDlg, 8); + case IDLOGEVT1: + case IDLOGEVT2: + case IDLOGEVT3: + case IDLOGEVT4: + case IDLOGEVT5: + if (HIWORD(wParam) == CBN_SELCHANGE) { + changed = TRUE; + } break; - case IDLOGOPT2: + case IDADVLOGOPT: EndDialog(hDlg, 9); break; case IDSTATUS2: @@ -406,6 +460,16 @@ static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l } cdromop[device].Opath->set(path); } + for (level=0; level<5; level++) { + idx = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETCURSEL, 0, 0); + value = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETITEMDATA, idx, 0); + if (value < 4) { + // set new default + SIM->set_default_log_action (level, value); + // apply that action to all modules (devices) + SIM->set_log_action (-1, level, value); + } + } value = GetDlgItemInt(hDlg, IDVGAUPDATE, NULL, FALSE); SIM->get_param_num(BXP_VGA_UPDATE_INTERVAL)->set(value); value = GetDlgItemInt(hDlg, IDKBDPASTE, NULL, FALSE); diff --git a/bochs/gui/win32res.h b/bochs/gui/win32res.h index 9c64760e1..374068fd7 100644 --- a/bochs/gui/win32res.h +++ b/bochs/gui/win32res.h @@ -19,34 +19,43 @@ #define CDROM1_DLG 2300 #define RUNTIME_DLG 2400 #define IDRTOTAB 2401 -#define IDGROUP1 2402 -#define IDGROUP2 2403 -#define IDGROUP3 2404 -#define IDGROUP4 2405 -#define IDLABEL1 2406 -#define IDLABEL2 2407 -#define IDLABEL3 2408 -#define IDLABEL4 2409 -#define IDLABEL5 2410 -#define IDLABEL6 2411 -#define IDLABEL7 2412 -#define IDCDROM1 2413 -#define IDCDROM2 2414 -#define IDCDROM3 2415 -#define IDCDROM4 2416 -#define IDBROWSE1 2417 -#define IDBROWSE2 2418 -#define IDBROWSE3 2419 -#define IDBROWSE4 2420 -#define IDSTATUS1 2421 -#define IDSTATUS2 2422 -#define IDSTATUS3 2423 -#define IDSTATUS4 2424 -#define IDLOGOPT1 2430 -#define IDLOGOPT2 2435 -#define IDVGAUPDATE 2440 -#define IDMOUSE 2445 -#define IDKBDPASTE 2450 -#define IDUSERBTN 2455 -#define IDAPPLY 2460 -#define IDINFO 2470 +#define IDGROUP1 2411 +#define IDGROUP2 2412 +#define IDGROUP3 2413 +#define IDGROUP4 2414 +#define IDLABEL1 2421 +#define IDLABEL2 2422 +#define IDLABEL3 2423 +#define IDLABEL4 2424 +#define IDCDROM1 2431 +#define IDCDROM2 2432 +#define IDCDROM3 2433 +#define IDCDROM4 2434 +#define IDBROWSE1 2441 +#define IDBROWSE2 2442 +#define IDBROWSE3 2443 +#define IDBROWSE4 2444 +#define IDSTATUS1 2451 +#define IDSTATUS2 2452 +#define IDSTATUS3 2453 +#define IDSTATUS4 2454 +#define IDLOGLBL1 2461 +#define IDLOGLBL2 2462 +#define IDLOGLBL3 2463 +#define IDLOGLBL4 2464 +#define IDLOGLBL5 2465 +#define IDLOGEVT1 2471 +#define IDLOGEVT2 2472 +#define IDLOGEVT3 2473 +#define IDLOGEVT4 2474 +#define IDLOGEVT5 2475 +#define IDLOGINFO 2480 +#define IDADVLOGOPT 2481 +#define IDMISCLBL1 2491 +#define IDMISCLBL2 2492 +#define IDMISCLBL3 2493 +#define IDVGAUPDATE 2510 +#define IDMOUSE 2520 +#define IDKBDPASTE 2530 +#define IDUSERBTN 2540 +#define IDAPPLY 2550 diff --git a/bochs/win32res.rc b/bochs/win32res.rc index 38a34a7d9..1d38370dc 100644 --- a/bochs/win32res.rc +++ b/bochs/win32res.rc @@ -79,16 +79,30 @@ BEGIN EDITTEXT IDCDROM4, 55, 140, 120, 14, ES_AUTOHSCROLL PUSHBUTTON "Browse...", IDBROWSE4, 183, 140, 50, 14 AUTOCHECKBOX "Inserted", IDSTATUS4, 23, 155, 41, 14, BS_LEFTTEXT | WS_TABSTOP - LTEXT "The log options are still present on the console", IDINFO, 30, 37, 150, 14 - PUSHBUTTON "Standard", IDLOGOPT1, 65, 55, 70, 14 - PUSHBUTTON "Advanced", IDLOGOPT2, 65, 75, 70, 14 - LTEXT "VGA update interval", IDLABEL5, 20, 37, 70, 14 - EDITTEXT IDVGAUPDATE, 90, 35, 70, 14, ES_NUMBER - AUTOCHECKBOX "Mouse", IDMOUSE, 18, 55, 81, 14, BS_LEFTTEXT | WS_TABSTOP - LTEXT "Keyboard paste delay", IDLABEL6, 20, 77, 70, 14 - EDITTEXT IDKBDPASTE, 90, 75, 70, 14, ES_NUMBER - LTEXT "Userbutton shortcut", IDLABEL7, 20, 97, 70, 14 - EDITTEXT IDUSERBTN, 90, 95, 70, 14 + LTEXT "Debug events", IDLOGLBL1, 20, 37, 70, 14 + COMBOBOX IDLOGEVT1, 95, 35, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + WS_VSCROLL | WS_TABSTOP + LTEXT "Info events", IDLOGLBL2, 20, 57, 70, 14 + COMBOBOX IDLOGEVT2, 95, 55, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + WS_VSCROLL | WS_TABSTOP + LTEXT "Error events", IDLOGLBL3, 20, 77, 70, 14 + COMBOBOX IDLOGEVT3, 95, 75, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + WS_VSCROLL | WS_TABSTOP + LTEXT "Panic events", IDLOGLBL4, 20, 97, 70, 14 + COMBOBOX IDLOGEVT4, 95, 95, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + WS_VSCROLL | WS_TABSTOP + LTEXT "Pass events", IDLOGLBL5, 20, 117, 70, 14 + COMBOBOX IDLOGEVT5, 95, 115, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + WS_VSCROLL | WS_TABSTOP + LTEXT "The advanced log options are still present on the console", IDLOGINFO, 35, 137, 180, 14 + PUSHBUTTON "Advanced", IDADVLOGOPT, 95, 155, 60, 14 + LTEXT "VGA update interval", IDMISCLBL1, 20, 37, 70, 14 + EDITTEXT IDVGAUPDATE, 95, 35, 70, 14, ES_NUMBER + AUTOCHECKBOX "Mouse", IDMOUSE, 18, 55, 86, 14, BS_LEFTTEXT | WS_TABSTOP + LTEXT "Keyboard paste delay", IDMISCLBL2, 20, 77, 70, 14 + EDITTEXT IDKBDPASTE, 95, 75, 70, 14, ES_NUMBER + LTEXT "Userbutton shortcut", IDMISCLBL3, 20, 97, 70, 14 + EDITTEXT IDUSERBTN, 95, 95, 70, 14 DEFPUSHBUTTON "Continue simulation", IDOK, 15, 190, 70, 14 PUSHBUTTON "Quit simulation", IDCANCEL, 95, 190, 70, 14 PUSHBUTTON "Apply", IDAPPLY, 175, 190, 70, 14