summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-01-15 16:10:23 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2017-01-15 16:10:23 (GMT)
commit8e7603e6a263eb765df4886a321537f209d88245 (patch)
treecd5ab94aa33a4d2b09b805d1f8fd35433164ca15
parent606cc0c2196f5934a7c48e89ab05da7d5e05081f (diff)
downloadnetsurf-8e7603e6a263eb765df4886a321537f209d88245.tar.gz
netsurf-8e7603e6a263eb765df4886a321537f209d88245.tar.bz2
Update JS menu check state when prefs option is toggled
-rw-r--r--frontends/amiga/gui_menu.c8
-rwxr-xr-xfrontends/amiga/gui_options.c4
-rw-r--r--frontends/amiga/menu.c2
3 files changed, 12 insertions, 2 deletions
diff --git a/frontends/amiga/gui_menu.c b/frontends/amiga/gui_menu.c
index 791182b..3f053a5 100644
--- a/frontends/amiga/gui_menu.c
+++ b/frontends/amiga/gui_menu.c
@@ -598,12 +598,20 @@ static void ami_gui_menu_set_checked_mc(struct Menu *menu, int item, bool check)
check_state = 0;
}
+ if(menu == NULL) {
+ menu = gui_menu;
+ }
+
IDoMethod((Object *)menu, MM_SETSTATE, 0, item, MS_CHECKED, check_state);
}
#endif
static void ami_gui_menu_set_checked_gt(struct Menu *menu, int item, bool check)
{
+ if(menu == NULL) {
+ return;
+ }
+
if(check == true) {
if((ItemAddress(menu, ami_gui_menu_number(item))->Flags & CHECKED) == 0)
ItemAddress(menu, ami_gui_menu_number(item))->Flags ^= CHECKED;
diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c
index b349e43..78dea58 100755
--- a/frontends/amiga/gui_options.c
+++ b/frontends/amiga/gui_options.c
@@ -1727,7 +1727,9 @@ static void ami_gui_opts_use(bool save)
} else {
nsoption_set_bool(enable_javascript, false);
}
-
+
+ ami_gui_menu_set_checked(NULL, M_JS, nsoption_bool(enable_javascript));
+
GetAttr(GA_Selected,gow->objects[GID_OPTS_DONOTTRACK],(ULONG *)&data);
if (data) {
nsoption_set_bool(do_not_track, true);
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 6e33d5e..04c6eb0 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -39,7 +39,7 @@
#include <reaction/reaction_macros.h>
#include "utils/log.h"
-#include "utils/utils.h"
+#include "utils/messages.h"
#include "amiga/gui.h"
#include "amiga/libs.h"