From eb366fa0d8cebc235e77f0279b9bc955af3ee1bc Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 5 Sep 2015 15:53:21 +0100 Subject: [PATCH] Correct checkbox logic --- amiga/gui_options.c | 6 +++--- amiga/selectmenu.c | 17 +++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/amiga/gui_options.c b/amiga/gui_options.c index c2aaeb1f2..cfa78e8ca 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1372,7 +1372,7 @@ void ami_gui_opts_open(void) GA_ID, GID_OPTS_SELECTMENU, GA_RelVerify, TRUE, GA_Text, gadlab[GID_OPTS_SELECTMENU], - GA_Selected, nsoption_bool(core_select_menu), + GA_Selected, !nsoption_bool(core_select_menu), GA_Disabled, !ami_selectmenu_is_safe(), CheckBoxEnd, #endif @@ -1858,9 +1858,9 @@ static void ami_gui_opts_use(bool save) GetAttr(GA_Selected,gow->objects[GID_OPTS_SELECTMENU],(ULONG *)&data); if (data) { - nsoption_set_bool(core_select_menu, true); - } else { nsoption_set_bool(core_select_menu, false); + } else { + nsoption_set_bool(core_select_menu, true); } GetAttr(GA_Selected,gow->objects[GID_OPTS_STARTUP_NO_WIN],(ULONG *)&data); diff --git a/amiga/selectmenu.c b/amiga/selectmenu.c index 0af0e1739..cc6672225 100644 --- a/amiga/selectmenu.c +++ b/amiga/selectmenu.c @@ -67,7 +67,7 @@ void gui_create_form_select_menu(struct gui_window *g, { struct Library *PopupMenuBase = NULL; struct PopupMenuIFace *IPopupMenu = NULL; - struct Hook ctxmenuhook; + struct Hook selectmenuhook; Object *selectmenuobj; struct form_option *opt = form_select_get_option(control, 0); ULONG i = 0; @@ -80,17 +80,17 @@ void gui_create_form_select_menu(struct gui_window *g, if(IPopupMenu == NULL) return; - ctxmenuhook.h_Entry = ami_popup_hook; - ctxmenuhook.h_SubEntry = NULL; - ctxmenuhook.h_Data = g; + selectmenuhook.h_Entry = ami_popup_hook; + selectmenuhook.h_SubEntry = NULL; + selectmenuhook.h_Data = g; g->shared->control = control; /**\todo PMIA_Title memory leaks as we don't free the strings. */ - selectmenuobj = PMMENU(ami_utf8_easy(form_control_get_name(control))), - PMA_MenuHandler, &ctxmenuhook, End; + selectmenuobj = PMMENU(form_control_get_name(control)), + PMA_MenuHandler, &selectmenuhook, End; while(opt) { IDoMethod(selectmenuobj, PM_INSERT, @@ -123,5 +123,10 @@ void gui_create_form_select_menu(struct gui_window *g, void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { } + +BOOL ami_selectmenu_is_safe() +{ + return FALSE; +} #endif