[evolution-rss] add auto-resize images option
- From: Lucian Langa <lucilanga src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-rss] add auto-resize images option
- Date: Sun, 20 Sep 2009 20:43:26 +0000 (UTC)
commit bd0853bad354ce6358e6153e90ccc22d53bc428e
Author: Lucian Langa <lucilanga gnome org>
Date: Sun Sep 20 23:42:53 2009 +0300
add auto-resize images option
src/evolution-rss.schemas.in | 13 +
src/rss-config-factory.c | 58 ++--
src/rss-html-rendering.glade | 751 +++++++++++++++++++++++++++---------------
src/rss.c | 40 ++-
src/rss.h | 1 +
5 files changed, 562 insertions(+), 301 deletions(-)
---
diff --git a/src/evolution-rss.schemas.in b/src/evolution-rss.schemas.in
index 8ddce78..33c2dd2 100644
--- a/src/evolution-rss.schemas.in
+++ b/src/evolution-rss.schemas.in
@@ -129,6 +129,19 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/evolution-rss/image_resize</key>
+ <applyto>/apps/evolution/evolution-rss/image_resize</applyto>
+ <owner>evolution-rss</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Automaticaly Resize Images</short>
+ <long>
+ Evolution RSS will automatically resize images lager than displayed area.
+ </long>
+ </locale>
+ </schema>
<schema>
<key>/schemas/apps/evolution/evolution-rss/status_icon</key>
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 6b62b7d..0c27419 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -83,13 +83,8 @@ typedef struct {
GladeXML *xml;
GConfClient *gconf;
GtkWidget *combobox;
- GtkWidget *check1;
- GtkWidget *check2;
+ GtkWidget *check;
GtkWidget *nettimeout;
- GtkWidget *check3;
- GtkWidget *check4;
- GtkWidget *check5;
- GtkWidget *check6;
GtkWidget *import;
} UIData;
@@ -2181,38 +2176,45 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
gtk_widget_show(combo);
gtk_box_pack_start(GTK_BOX(ui->combobox), combo, FALSE, FALSE, 0);
- ui->check1 = glade_xml_get_widget(ui->xml, "enable_java");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check1),
+ ui->check = glade_xml_get_widget(ui->xml, "enable_java");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JAVA, NULL));
- g_signal_connect(ui->check1,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(start_check_cb),
GCONF_KEY_HTML_JAVA);
- ui->check2 = glade_xml_get_widget(ui->xml, "enable_js");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check2),
+ ui->check = glade_xml_get_widget(ui->xml, "image_resize");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
+ gconf_client_get_bool(rss_gconf, GCONF_KEY_IMAGE_RESIZE, NULL));
+ g_signal_connect(ui->check,
+ "clicked",
+ G_CALLBACK(start_check_cb),
+ GCONF_KEY_IMAGE_RESIZE);
+
+ ui->check = glade_xml_get_widget(ui->xml, "enable_js");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JS, NULL));
- g_signal_connect(ui->check2,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(start_check_cb),
GCONF_KEY_HTML_JS);
- ui->check6 = glade_xml_get_widget(ui->xml, "accept_cookies");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check6),
+ ui->check = glade_xml_get_widget(ui->xml, "accept_cookies");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_ACCEPT_COOKIES, NULL));
-
- ui->import = glade_xml_get_widget(ui->xml, "import_cookies");
- //we have to have ui->import looked up
- g_signal_connect(ui->check6,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(accept_cookies_cb),
ui->import);
+ ui->import = glade_xml_get_widget(ui->xml, "import_cookies");
+ //we have to have ui->import looked up
#if LIBSOUP_VERSION >= 2026000
g_signal_connect(ui->import, "clicked", G_CALLBACK(import_cookies_cb), ui->import);
#else
gtk_widget_set_sensitive(ui->import, FALSE);
- gtk_widget_set_sensitive(ui->check6, FALSE);
+ gtk_widget_set_sensitive(ui->check, FALSE);
#endif
ui->nettimeout = glade_xml_get_widget(ui->xml, "nettimeout");
@@ -2228,24 +2230,24 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
//feed notification
- ui->check3 = glade_xml_get_widget(ui->xml, "status_icon");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check3),
+ ui->check = glade_xml_get_widget(ui->xml, "status_icon");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_STATUS_ICON, NULL));
- g_signal_connect(ui->check3,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(start_check_cb),
GCONF_KEY_STATUS_ICON);
- ui->check4 = glade_xml_get_widget(ui->xml, "blink_icon");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check4),
+ ui->check = glade_xml_get_widget(ui->xml, "blink_icon");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_BLINK_ICON, NULL));
- g_signal_connect(ui->check4,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(start_check_cb),
GCONF_KEY_BLINK_ICON);
- ui->check5 = glade_xml_get_widget(ui->xml, "feed_icon");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check5),
+ ui->check = glade_xml_get_widget(ui->xml, "feed_icon");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->check),
gconf_client_get_bool(rss_gconf, GCONF_KEY_FEED_ICON, NULL));
- g_signal_connect(ui->check5,
+ g_signal_connect(ui->check,
"clicked",
G_CALLBACK(start_check_cb),
GCONF_KEY_FEED_ICON);
diff --git a/src/rss-html-rendering.glade b/src/rss-html-rendering.glade
index a92c821..8d15f24 100644
--- a/src/rss-html-rendering.glade
+++ b/src/rss-html-rendering.glade
@@ -1,272 +1,483 @@
-<?xml version="1.0"?>
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
<glade-interface>
- <!-- interface-requires gtk+ 2.16 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkWindow" id="window1">
- <child>
- <widget class="GtkVBox" id="settingsbox">
- <property name="visible">True</property>
- <child>
- <widget class="GtkFrame" id="html-rendering">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="top_padding">2</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <property name="homogeneous">True</property>
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="spacing">10</property>
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Engine: </b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <child>
- <widget class="GtkCheckButton" id="checkbutton1">
- <property name="label" translatable="yes">Block pop-up windows</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="enable_java">
- <property name="label" translatable="yes">Enable Java</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="enable_js">
- <property name="label" translatable="yes">Enable JavaScript</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <child>
- <widget class="GtkCheckButton" id="accept_cookies">
- <property name="label" translatable="yes">Accept cookies from sites</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="import_cookies">
- <property name="label" translatable="yes">Import Cookies</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="spacing">10</property>
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Network timeout:</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="nettimeout">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">60 60 3600 1 10 10</property>
- <property name="climb_rate">1</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="fill">False</property>
- <property name="padding">2</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>HTML Rendering</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <child>
- <widget class="GtkCheckButton" id="status_icon">
- <property name="label" translatable="yes">Show icon in notification area</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xscale">0.80000001192092896</property>
- <child>
- <widget class="GtkCheckButton" id="blink_icon">
- <property name="label" translatable="yes">Blink icon in notification area</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="feed_icon">
- <property name="label" translatable="yes">Show feed icon</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Article Notification</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
+
+<widget class="GtkWindow" id="window1">
+ <property name="title" translatable="yes"></property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="settingsbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkFrame" id="html-rendering">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">2</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">10</property>
+
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Engine: </b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="checkbutton1">
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Block pop-up windows</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_java">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable Java</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_js">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable JavaScript</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="accept_cookies">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Accept cookies from sites</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="import_cookies">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Import Cookies</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="image_resize">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Automatically resize images</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">10</property>
+
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Network timeout:</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="nettimeout">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">60 60 3600 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">seconds</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">2</property>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>HTML Rendering</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="status_icon">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show icon in notification area</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0.800000011921</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="blink_icon">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Blink icon in notification area</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="feed_icon">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show feed icon</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Article Notification</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
diff --git a/src/rss.c b/src/rss.c
index e7c32d0..58aa352 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -1827,7 +1827,7 @@ gecko_click(GtkMozEmbed *mozembed, gpointer dom_event, gpointer user_data)
#if EVOLUTION_VERSION >= 22900
menu = e_popup_menu_create_with_domain (rss_menu_items,
- 0, (guint32)(strlen(link) ? 8:4),
+ 0, (guint32)(strlen(link) ? 3:4),
link,
GETTEXT_PACKAGE);
if (button == 2)
@@ -2354,7 +2354,41 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t) //camelmimepart
} else
tmp = g_strdup((gchar *)(buffer->data));
- buff=(xmlChar *)tmp;
+ if (gconf_client_get_bool (rss_gconf,
+ GCONF_KEY_IMAGE_RESIZE,
+ NULL)) {
+ GtkWidget *obj = emfh->html;
+ guint width = obj->allocation.width - 56;
+ gchar *wids = g_strdup_printf("%d", width);
+ xmlDoc *src = (xmlDoc *)parse_html_sux(tmp, strlen(tmp));
+ if (src) {
+ xmlNode *doc = (xmlNode *)src;
+ while ((doc = html_find(doc, "img"))) {
+ int real_width = 0;
+ xmlChar *url = xmlGetProp(doc, (xmlChar *)"src");
+ GdkPixbuf *pix = gdk_pixbuf_new_from_file(url,
+ NULL);
+ if (pix)
+ real_width = gdk_pixbuf_get_width(pix);
+ if (real_width > width) {
+ xmlSetProp(doc, (xmlChar *)"width", wids);
+ goto pixdone;
+ }
+ xmlChar *wid = xmlGetProp(doc, (xmlChar *)"width");
+ if (wid) {
+ if (atof(wid) > width)
+ xmlSetProp(doc, (xmlChar *)"width", wids);
+ g_free(wid);
+ }
+pixdone: g_free(url);
+ }
+ xmlDocDumpMemory(src, &buff, (int*)&size);
+ xmlFree(src);
+ }
+ xmlFree(wids);
+ } else
+ buff=(xmlChar *)tmp;
+
g_byte_array_free (buffer, 1);
camel_object_unref(stream);
// char *buff = decode_html_entities(buffer2);
@@ -2362,7 +2396,7 @@ void org_gnome_cooly_format_rss(void *ep, EMFormatHookTarget *t) //camelmimepart
gchar *feed_dir = rss_component_peek_base_directory();
- gchar *feed_file = g_strdup_printf("%s/%s.img", feed_dir, feedid);
+ gchar *feed_file = g_strdup_printf("%s/%s.img", feed_dir, feedid);
camel_stream_printf (fstream,
"<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 2px; color: #%06x;\">",
diff --git a/src/rss.h b/src/rss.h
index 0576dce..e114050 100644
--- a/src/rss.h
+++ b/src/rss.h
@@ -183,6 +183,7 @@ typedef struct _rssfeed {
#define GCONF_KEY_BLINK_ICON "/apps/evolution/evolution-rss/blink_icon"
#define GCONF_KEY_FEED_ICON "/apps/evolution/evolution-rss/feed_icon"
#define GCONF_KEY_ACCEPT_COOKIES "/apps/evolution/evolution-rss/accept_cookies"
+#define GCONF_KEY_IMAGE_RESIZE "/apps/evolution/evolution-rss/image_resize"
enum {
RSS_FEED,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]