changeset 404:c530a4bbf070

- WORKAROUND to display HTML for sylpheed.
author jcid
date Fri, 10 Oct 2008 22:39:34 +0200
parents da766fa9efed
children a21e86b6e314
files src/dillo.cc src/ui.hh src/uicmd.cc src/uicmd.hh
diffstat 4 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/dillo.cc	Fri Oct 10 17:59:12 2008 +0200
+++ b/src/dillo.cc	Fri Oct 10 22:39:34 2008 +0200
@@ -124,6 +124,16 @@
       DilloUrl *url = Dillo_make_start_url(argv[1]);
       a_UIcmd_open_urlstr(bw, URL_STR(url));
       a_Url_free(url);
+   } else if (argc == 6) {
+      // WORKAROUND: sylpheed execs "dillo -l -f -x XID URL"
+      if (strcmp(argv[1], "-l") == 0 && strcmp(argv[2], "-f") == 0 &&
+          strcmp(argv[3], "-x") == 0) {
+         a_UIcmd_set_images_enabled(bw, FALSE);
+         DilloUrl *url = Dillo_make_start_url(argv[5]);
+         a_Url_set_flags(url, URL_FLAGS(url) & URL_SpamSafe);
+         a_UIcmd_open_urlstr(bw, URL_STR(url));
+         a_Url_free(url);
+      }
    } else {
       /* Send startup screen */
       a_Nav_push(bw, prefs.start_page);
--- a/src/ui.hh	Fri Oct 10 17:59:12 2008 +0200
+++ b/src/ui.hh	Fri Oct 10 22:39:34 2008 +0200
@@ -96,7 +96,8 @@
    void set_panelmode(UIPanelmode mode);
    UIPanelmode get_panelmode();
    void set_findbar_visibility(bool visible);
-   bool get_images_enabled() { return ImageLoad->state();}
+   bool images_enabled() { return ImageLoad->state();}
+   void images_enabled(int flag) { ImageLoad->state(flag);}
    Widget *fullscreen_button() { return FullScreen; }
    void fullscreen_toggle() { FullScreen->do_callback(); }
 
--- a/src/uicmd.cc	Fri Oct 10 17:59:12 2008 +0200
+++ b/src/uicmd.cc	Fri Oct 10 22:39:34 2008 +0200
@@ -881,7 +881,15 @@
  */
 bool_t a_UIcmd_get_images_enabled(BrowserWindow *bw)
 {
-   return BW2UI(bw)->get_images_enabled();
+   return BW2UI(bw)->images_enabled();
+}
+
+/*
+ * Enable/Disable automatic image loading.
+ */
+void a_UIcmd_set_images_enabled(BrowserWindow *bw, int flag)
+{
+   BW2UI(bw)->images_enabled(flag);
 }
 
 /*
--- a/src/uicmd.hh	Fri Oct 10 17:59:12 2008 +0200
+++ b/src/uicmd.hh	Fri Oct 10 22:39:34 2008 +0200
@@ -70,6 +70,7 @@
 void a_UIcmd_set_page_title(BrowserWindow *bw, const char *label);
 void a_UIcmd_set_msg(BrowserWindow *bw, const char *format, ...);
 bool_t a_UIcmd_get_images_enabled(BrowserWindow *bw);
+void a_UIcmd_set_images_enabled(BrowserWindow *bw, int flag);
 void a_UIcmd_set_buttons_sens(BrowserWindow *bw);
 void a_UIcmd_fullscreen_toggle(BrowserWindow *bw);