From 05d75afd898d44493717852e5f3c3eae406e5510 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 31 Dec 2003 17:09:03 +0000 Subject: [project @ 2003-12-31 17:09:03 by jmb] Rename login template to "login". Use OS_GBPB9 to get filename of plugin logos. svn path=/import/netsurf/; revision=474 --- riscos/401login.c | 6 ++---- riscos/about.c | 51 +++++++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 30 deletions(-) (limited to 'riscos') diff --git a/riscos/401login.c b/riscos/401login.c index 195e4c740..2aa644390 100644 --- a/riscos/401login.c +++ b/riscos/401login.c @@ -36,14 +36,12 @@ static struct browser_window *bwin; void ro_gui_401login_init(void) { - char name[20]; + char name[20] = "login"; int context, window_size, data_size; char *data; os_error *e; - strncpy(name, "dialog_401li", 20); - - /* find required buffer sizes */ + /* find required buffer sizes */ e = xwimp_load_template(wimp_GET_SIZE, 0, 0, wimp_NO_FONTS, name, 0, &window_size, &data_size, &context); if (e) { diff --git a/riscos/about.c b/riscos/about.c index e7ca7be30..0318f5299 100644 --- a/riscos/about.c +++ b/riscos/about.c @@ -28,6 +28,7 @@ #include "oslib/osfile.h" #include "oslib/osfind.h" #include "oslib/osfscontrol.h" +#include "oslib/osgbpb.h" static const char *pabouthdr = "%s
\"Netsurf
 

NetSurf %s

Copyright © 2002, 2003 NetSurf Developers.
 

"; /**< About page header */ static const char *pabtplghd = "The following plugins are installed on your system:
 
"; /**< Plugin table header */ @@ -80,8 +81,8 @@ void about_create(void) { struct about_page *abt; struct plugd *temp; FILE *fp; - char *buf, *val, var[20], *ptype, *pdetails, *fname, *furl, *p, *leafname; - int i, nofiles, j, w, h, size, pneeded; + char *buf, *val, var[20], *ptype, *pdetails, *fname, *furl; + int i, nofiles, j, w, h, size; fileswitch_object_type fot; os_error *e; @@ -177,40 +178,38 @@ void about_create(void) { /* get actual file name */ sprintf(var, "%2.2d*", j); LOG(("var: %s", var)); - sprintf(buf, "%s.", val); - LOG(("buf: %s", buf)); - e = xosfscontrol_canonicalise_path(var, 0, 0, buf, 0, &pneeded); - if (e) { - LOG(("%s", e->errmess)); - return; - } - fname = xcalloc((unsigned int)(10-pneeded), sizeof(char)); - e = xosfscontrol_canonicalise_path(var, fname, 0, buf, - (10-pneeded), 0); + + void *name = (void*)xcalloc((unsigned int)20, sizeof(char)); + + e = xosgbpb_dir_entries(val, (osgbpb_string_list*)name, + 1, 0, 255, var, NULL, NULL); if (e) { LOG(("%s", e->errmess)); - return; + xfree(name); + xfree(pdetails); + continue; } - LOG(("fname: %s", fname)); - furl = xcalloc(strlen(fname) + 20, sizeof(char)); + LOG(("fname: %s", (char*)name)); + sprintf(buf, "%s.%s", val, (char*)name); + furl = xcalloc(strlen(buf) + 20, sizeof(char)); /* grab leafname and get width and height */ - p = strrchr(fname, '.'); - leafname = xstrdup(p); - h = atoi(leafname+7); - leafname[7] = 0; - w = atoi(leafname+3); + h = atoi((char*)name+6); + ((char*)name)[6] = 0; + w = atoi((char*)name+2); + + xfree(name); /* convert to URL */ - __unixify(fname, 0, furl, strlen(fname)+20, 0); - sprintf(fname, "file://%s", furl); + __unixify(buf, 0, furl, strlen(buf)+20, 0); + sprintf(buf, "file://%s", furl); xfree(furl); - LOG(("furl: %s", fname)); - furl = xcalloc(strlen(paboutpl3) + strlen(ptype) + strlen(fname) + strlen(pdetails) + 10, sizeof(char)); - sprintf(furl, paboutpl3, ptype, fname, ptype, w, h, pdetails); + LOG(("furl: %s", buf)); + furl = xcalloc(strlen(paboutpl3) + strlen(ptype) + strlen(buf) + + strlen(pdetails) + 10, sizeof(char)); + sprintf(furl, paboutpl3, ptype, buf, ptype, w, h, pdetails); abt->plugd = new_plugin(abt->plugd, furl); - xfree(fname); xfree(pdetails); continue; } -- cgit v1.2.3