diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2005-02-03 13:10:21 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2005-02-03 13:10:21 +0000 |
commit | f11a9919925dd330b78f09dc545e26099e3e24a3 (patch) | |
tree | 47fe1f824fc3e87ac519955fc1d7392c345ff160 | |
parent | f5f45c9f2dc2ee227752f68695610f67ca69345c (diff) | |
download | netsurf-f11a9919925dd330b78f09dc545e26099e3e24a3.tar.gz netsurf-f11a9919925dd330b78f09dc545e26099e3e24a3.tar.bz2 |
[project @ 2005-02-03 13:10:21 by rjw]
Make themes auto-install work on NCOS (probably)
svn path=/import/netsurf/; revision=1486
-rw-r--r-- | riscos/theme_install.c | 21 |
1 files changed, 15 insertions, 6 deletions
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 "<Choices$Write>" +#else +#define THEME_LEAFNAME "NetSurf.Choices.Themes" +#define THEME_PATHNAME "<User$Path>.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, - "<Choices$Write>.%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) || |