diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-10-17 22:13:35 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-10-17 22:13:35 +0000 |
commit | fff5f231ed84b05d0c062e87055c600f419ec15b (patch) | |
tree | ab1506ca034f91b88776b79d0635d6a1ef7f213c /gtk | |
parent | 892a348b7331b66f27e41e3ac6b91cd924243d81 (diff) | |
download | netsurf-fff5f231ed84b05d0c062e87055c600f419ec15b.tar.gz netsurf-fff5f231ed84b05d0c062e87055c600f419ec15b.tar.bz2 |
[project @ 2004-10-17 22:13:34 by jmb]
Lose hard-coded stylesheet URLs.
svn path=/import/netsurf/; revision=1323
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtk_gui.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 1977c5f43..07e89e11e 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -16,19 +16,43 @@ #include "netsurf/desktop/browser.h" #include "netsurf/desktop/gui.h" #include "netsurf/desktop/netsurf.h" +#include "netsurf/desktop/options.h" #include "netsurf/render/box.h" #include "netsurf/render/form.h" +#include "netsurf/render/html.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" bool gui_in_multitask = false; +char *default_stylesheet_url; +char *adblock_stylesheet_url; + void gui_init(int argc, char** argv) { + char *home; + char buf[1024]; + + /* All our resources are stored in ~/.netsurf/ */ + home = getenv("HOME"); + if (!home) + die("Couldn't find HOME"); + gtk_init(&argc, &argv); - messages_load("messages"); + + snprintf(buf, sizeof buf, "%s/.netsurf/Choices", home); + options_read(buf); + + snprintf(buf, sizeof buf, "%s/.netsurf/messages", home); + messages_load(buf); + + /* set up stylesheet urls */ + snprintf(buf, sizeof buf, "file:///%s/.netsurf/Default.css", home); + default_stylesheet_url = strdup(buf); + snprintf(buf, sizeof buf, "file:///%s/.netsurf/AdBlock.css", home); + adblock_stylesheet_url = strdup(buf); } @@ -55,6 +79,8 @@ void gui_multitask(void) void gui_quit(void) { + free(default_stylesheet_url); + free(adblock_stylesheet_url); } |