From f11a9919925dd330b78f09dc545e26099e3e24a3 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Thu, 3 Feb 2005 13:10:21 +0000 Subject: [project @ 2005-02-03 13:10:21 by rjw] Make themes auto-install work on NCOS (probably) svn path=/import/netsurf/; revision=1486 --- riscos/theme_install.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'riscos/theme_install.c') diff --git a/riscos/theme_install.c b/riscos/theme_install.c index b1b733b2f..384581b27 100644 --- a/riscos/theme_install.c +++ b/riscos/theme_install.c @@ -32,6 +32,13 @@ static void theme_install_close(void); void theme_install_callback(content_msg msg, struct content *c, void *p1, void *p2, union content_msg_data data); +#ifndef NCOS +#define THEME_LEAFNAME "WWW.NetSurf.Themes" +#define THEME_PATHNAME "" +#else +#define THEME_LEAFNAME "NetSurf.Choices.Themes" +#define THEME_PATHNAME ".Choices" +#endif /** * Handle a CONTENT_THEME that has started loading. @@ -156,17 +163,15 @@ void ro_gui_theme_install_click(wimp_pointer *pointer) { while (!theme_found) { if (theme_number == 1) snprintf(theme_leaf, 256, - "WWW.NetSurf.Themes.%s", - theme_file); + "%s.%s", THEME_LEAFNAME, theme_file); else snprintf(theme_leaf, 256, - "WWW.NetSurf.Themes.%s%i", - theme_file, theme_number); + "%s.%s%i", THEME_LEAFNAME, theme_file, + theme_number); theme_leaf[255] = '\0'; theme_number++; snprintf(theme_save, 256, - ".%s", - theme_leaf); + "%s.%s", THEME_PATHNAME, theme_leaf); theme_save[255] = '\0'; error = xosfile_read_stamped(theme_save, &obj_type, 0, 0, 0, 0, 0); @@ -191,7 +196,11 @@ void ro_gui_theme_install_click(wimp_pointer *pointer) { /* apply theme only on Select clicks */ if (pointer->buttons == wimp_CLICK_SELECT) { ro_gui_theme_get_available(); +#ifndef NCOS snprintf(theme_save, 256, "Choices:%s", theme_leaf); +#else + snprintf(theme_save, 256, "%s.%s", THEME_PATHNAME, theme_leaf); +#endif theme_save[255] = '\0'; theme_install = ro_gui_theme_find(theme_save); if ((!theme_install) || -- cgit v1.2.3