Skip to content

Commit

Permalink
reset status bar items at reset (#136)
Browse files Browse the repository at this point in the history
When the user presses the "Reset" button on the gui ribbon, we need to
clear the active status of all statusbar items or they remain set after
the reset occurs.
This is mentioned in issue #123
  • Loading branch information
fysnet authored Nov 17, 2023
1 parent 447f18e commit c247b43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bochs/gui/gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ void bx_gui_c::cdrom1_handler(void)
void bx_gui_c::reset_handler(void)
{
BX_INFO(("system RESET callback"));
BX_GUI_THIS statusbar_setall(0);
bx_pc_system.Reset(BX_RESET_HARDWARE);
}

Expand Down Expand Up @@ -986,6 +987,12 @@ void bx_gui_c::statusbar_setitem(int element, bool active, bool w)
}
}

void bx_gui_c::statusbar_setall(bool active)
{
for (int i=0; i<BX_MAX_STATUSITEMS; i++)
statusbar_setitem(i, active);
}

void bx_gui_c::led_timer_handler(void *this_ptr)
{
bx_gui_c *class_ptr = (bx_gui_c *) this_ptr;
Expand Down
1 change: 1 addition & 0 deletions bochs/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class BOCHSAPI bx_gui_c : public logfunctions {
int register_statusitem(const char *text, bool auto_off=0);
void unregister_statusitem(int id);
void statusbar_setitem(int element, bool active, bool w=0);
void statusbar_setall(bool active);
static void init_signal_handlers();
static void toggle_mouse_enable(void);
bool mouse_toggle_check(Bit32u key, bool pressed);
Expand Down

0 comments on commit c247b43

Please sign in to comment.