evolution-rss r278 - in trunk: . pixmaps po src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r278 - in trunk: . pixmaps po src
- Date: Sun, 25 May 2008 16:51:31 +0000 (UTC)
Author: lucilanga
Date: Sun May 25 16:51:30 2008
New Revision: 278
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=278&view=rev
Log:
gecko preferences
Added:
trunk/src/gecko-utils.cpp
trunk/src/gecko-utils.h
Modified:
trunk/ChangeLog
trunk/Makefile.in
trunk/TODO
trunk/config.h.in
trunk/configure.ac
trunk/pixmaps/Makefile.in
trunk/po/POTFILES.in
trunk/src/Makefile.am
trunk/src/Makefile.in
trunk/src/evolution-rss.schemas.in
trunk/src/rss-config-factory.c
trunk/src/rss-html-rendering.glade
trunk/src/rss.c
trunk/src/rss.h
Modified: trunk/Makefile.in
==============================================================================
--- trunk/Makefile.in (original)
+++ trunk/Makefile.in Sun May 25 16:51:30 2008
@@ -136,8 +136,8 @@
GPP = @GPP@
GREP = @GREP@
GTK_VERSION = @GTK_VERSION@
+HAVE_GECKO_1_9 = @HAVE_GECKO_1_9@
HAVE_GTKMOZEMEBED = @HAVE_GTKMOZEMEBED@
-HAVE_LIBXUL = @HAVE_LIBXUL@
HAVE_RENDERKIT = @HAVE_RENDERKIT@
HAVE_WEBKIT = @HAVE_WEBKIT@
HAVE_XULRUNNER = @HAVE_XULRUNNER@
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Sun May 25 16:51:30 2008
@@ -7,9 +7,7 @@
* create some sort of progress popup when render with an external engine (webkit/gecko)
* check webkit area sizing when using zoom in/out
* failback to old handler when formatting error
- * optimize where needed using reversed rf->hrname
* when deleting a folder offer to delete feed also
- * check mozembed widget / thread when quitting
* test cancelation signal check rf->cancel fetch feed might reset it always 0 and crashing when finish_feed
* jump to folder when adding through d-bus
* move evolution detection to m4 to ease up integration in other plugins
@@ -27,13 +25,11 @@
* implement web controls for diferent redering <Webkits> or <Gecko>
* force soup to follow redirects (304) test on fedora weekly news
* check loading of images in certain feeds
- * convert rest of non-intrusive error messages
* search in the content of page for feed
* obey ttl entity
* make feed message forwardable/replayable
* check rename feed when evo 2.24 x86_64
- * disable browser alerts messages
* make cancel all button work
* add debug points for showing steps of current operation (group operations)
* when adding a feed as opml file offer to import (file detection)
- * convert reading feeds progress bar to articles number that will actually be read
+ * possibly make network timeout customizable
Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in (original)
+++ trunk/config.h.in Sun May 25 16:51:30 2008
@@ -30,7 +30,7 @@
/* Define if we have gecko 1.8.1 */
#undef HAVE_GECKO_1_8_1
-/* Define if we have gecko 1.9 */
+/* at least gecko 1.9 */
#undef HAVE_GECKO_1_9
/* Define if gecko is a debug build */
@@ -51,9 +51,6 @@
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
-/* libxul flavour of xulrunner */
-#undef HAVE_LIBXUL
-
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sun May 25 16:51:30 2008
@@ -204,8 +204,8 @@
AC_SUBST(HAVE_XULRUNNER)
fi
if test "x$GECKO" == "xlibxul" -o "x$GECKO" == "xlibxul-embedding"; then
- AC_DEFINE_UNQUOTED(HAVE_LIBXUL, 1, [libxul flavour of xulrunner])
- AC_SUBST(HAVE_LIBXUL)
+ AC_DEFINE_UNQUOTED(HAVE_GECKO_1_9, 1, [at least gecko 1.9])
+ AC_SUBST(HAVE_GECKO_1_9)
fi
#fi
AC_ARG_WITH([primary-render],
Modified: trunk/pixmaps/Makefile.in
==============================================================================
--- trunk/pixmaps/Makefile.in (original)
+++ trunk/pixmaps/Makefile.in Sun May 25 16:51:30 2008
@@ -117,8 +117,8 @@
GPP = @GPP@
GREP = @GREP@
GTK_VERSION = @GTK_VERSION@
+HAVE_GECKO_1_9 = @HAVE_GECKO_1_9@
HAVE_GTKMOZEMEBED = @HAVE_GTKMOZEMEBED@
-HAVE_LIBXUL = @HAVE_LIBXUL@
HAVE_RENDERKIT = @HAVE_RENDERKIT@
HAVE_WEBKIT = @HAVE_WEBKIT@
HAVE_XULRUNNER = @HAVE_XULRUNNER@
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Sun May 25 16:51:30 2008
@@ -5,6 +5,7 @@
src/network-soup.c
src/rss.c
src/rss-config-factory.c
+src/rss-html-rendering.glade
src/rss-ui.glade
src/org-gnome-evolution-rss.eplug.xml
src/org-gnome-evolution-rss.error.xml
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Sun May 25 16:51:30 2008
@@ -63,7 +63,7 @@
org-gnome-evolution-rss.xml
plugin_LTLIBRARIES = liborg-gnome-evolution-rss.la
-liborg_gnome_evolution_rss_la_SOURCES = rss.c
+liborg_gnome_evolution_rss_la_SOURCES = rss.c gecko-utils.cpp
liborg_gnome_evolution_rss_la_LDFLAGS = -module -avoid-version $(WEBKIT_LIBS) $(GECKO_LIBS) $(GECKO_RPATH)
evolution_import_rss_SOURCES = evolution-import-rss.c
@@ -142,6 +142,8 @@
dbus.c \
rss-config-factory.c \
rss-config-factory.h \
+ gecko-utils.cpp \
+ gecko-utils.h \
evolution-import-rss.c \
evolution-rss.schemas.in \
org-gnome-evolution-rss.eplug.xml \
Modified: trunk/src/Makefile.in
==============================================================================
--- trunk/src/Makefile.in (original)
+++ trunk/src/Makefile.in Sun May 25 16:51:30 2008
@@ -58,12 +58,12 @@
pluginLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(plugin_LTLIBRARIES)
liborg_gnome_evolution_rss_la_LIBADD =
-am_liborg_gnome_evolution_rss_la_OBJECTS = rss.lo
+am_liborg_gnome_evolution_rss_la_OBJECTS = rss.lo gecko-utils.lo
liborg_gnome_evolution_rss_la_OBJECTS = \
$(am_liborg_gnome_evolution_rss_la_OBJECTS)
-liborg_gnome_evolution_rss_la_LINK = $(LIBTOOL) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) \
+liborg_gnome_evolution_rss_la_LINK = $(LIBTOOL) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) \
$(liborg_gnome_evolution_rss_la_LDFLAGS) $(LDFLAGS) -o $@
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
@@ -85,6 +85,15 @@
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
SOURCES = $(liborg_gnome_evolution_rss_la_SOURCES) \
$(evolution_import_rss_SOURCES)
DIST_SOURCES = $(liborg_gnome_evolution_rss_la_SOURCES) \
@@ -162,8 +171,8 @@
GPP = @GPP@
GREP = @GREP@
GTK_VERSION = @GTK_VERSION@
+HAVE_GECKO_1_9 = @HAVE_GECKO_1_9@
HAVE_GTKMOZEMEBED = @HAVE_GTKMOZEMEBED@
-HAVE_LIBXUL = @HAVE_LIBXUL@
HAVE_RENDERKIT = @HAVE_RENDERKIT@
HAVE_WEBKIT = @HAVE_WEBKIT@
HAVE_XULRUNNER = @HAVE_XULRUNNER@
@@ -340,7 +349,7 @@
org-gnome-evolution-rss.xml
plugin_LTLIBRARIES = liborg-gnome-evolution-rss.la
-liborg_gnome_evolution_rss_la_SOURCES = rss.c
+liborg_gnome_evolution_rss_la_SOURCES = rss.c gecko-utils.cpp
liborg_gnome_evolution_rss_la_LDFLAGS = -module -avoid-version $(WEBKIT_LIBS) $(GECKO_LIBS) $(GECKO_RPATH)
evolution_import_rss_SOURCES = evolution-import-rss.c
evolution_import_rss_LDFLAGS = $(DBUS_LIBS)
@@ -371,6 +380,8 @@
dbus.c \
rss-config-factory.c \
rss-config-factory.h \
+ gecko-utils.cpp \
+ gecko-utils.h \
evolution-import-rss.c \
evolution-rss.schemas.in \
org-gnome-evolution-rss.eplug.xml \
@@ -383,7 +394,7 @@
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .cpp .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -481,6 +492,7 @@
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote /$(DEPDIR)/evolution-import-rss Po am__quote@
+ AMDEP_TRUE@@am__include@ @am__quote /$(DEPDIR)/gecko-utils Plo am__quote@
@AMDEP_TRUE@@am__include@ @am__quote /$(DEPDIR)/rss Plo am__quote@
.c.o:
@@ -504,6 +516,27 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+.cpp.o:
+ am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
mostlyclean-libtool:
-rm -f *.lo
Modified: trunk/src/evolution-rss.schemas.in
==============================================================================
--- trunk/src/evolution-rss.schemas.in (original)
+++ trunk/src/evolution-rss.schemas.in Sun May 25 16:51:30 2008
@@ -74,6 +74,34 @@
</schema>
<schema>
+ <key>/schemas/apps/evolution/evolution-rss/html_js</key>
+ <applyto>/apps/evolution/evolution-rss/html_js</applyto>
+ <owner>evolution-rss</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>JavaScript Enabled</short>
+ <long>
+ JavaScript Enabled
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/evolution/evolution-rss/html_java</key>
+ <applyto>/apps/evolution/evolution-rss/html_java</applyto>
+ <owner>evolution-rss</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Java Enabled</short>
+ <long>
+ Java Enabled
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/evolution/evolution-rss/pass_proxy</key>
<applyto>/apps/evolution/evolution-rss/pass_proxy</applyto>
<owner>evolution-rss</owner>
Added: trunk/src/gecko-utils.cpp
==============================================================================
--- (empty file)
+++ trunk/src/gecko-utils.cpp Sun May 25 16:51:30 2008
@@ -0,0 +1,96 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2004 Marco Pesenti Gritti
+ * Copyright (C) 2008 Lucian Langa
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <stdlib.h>
+
+#include <nsStringAPI.h>
+
+#include <gtkmozembed.h>
+#include <gtkmozembed_internal.h>
+#include <nsCOMPtr.h>
+#include <nsIPrefService.h>
+#include <nsIServiceManager.h>
+#include <nsServiceManagerUtils.h>
+
+static nsIPrefBranch* gPrefBranch;
+
+extern "C" gboolean
+gecko_prefs_set_bool (const gchar *key, gboolean value)
+{
+ NS_ENSURE_TRUE (gPrefBranch, FALSE);
+
+ return NS_SUCCEEDED(gPrefBranch->SetBoolPref (key, value));
+}
+
+extern "C" gboolean
+gecko_prefs_set_string (const gchar *key, const gchar *value)
+{
+ NS_ENSURE_TRUE (gPrefBranch, FALSE);
+
+ return NS_SUCCEEDED(gPrefBranch->SetCharPref (key, value));
+}
+
+static gboolean
+gecko_prefs_set_int (const gchar *key, gint value)
+{
+ NS_ENSURE_TRUE (gPrefBranch, FALSE);
+
+ return NS_SUCCEEDED(gPrefBranch->SetIntPref (key, value));
+}
+
+extern "C" gboolean
+gecko_init (void)
+{
+#ifdef HAVE_GECKO_1_9
+ NS_LogInit ();
+#endif
+
+#ifdef HAVE_GECKO_1_9
+ gtk_moz_embed_set_path (GECKO_HOME);
+#else
+ gtk_moz_embed_set_comp_path (GECKO_HOME);
+#endif
+
+ gtk_moz_embed_push_startup ();
+
+ nsresult rv;
+ nsCOMPtr<nsIPrefService> prefService (do_GetService (NS_PREFSERVICE_CONTRACTID, &rv));
+ NS_ENSURE_SUCCESS (rv, FALSE);
+
+ rv = CallQueryInterface (prefService, &gPrefBranch);
+ NS_ENSURE_SUCCESS (rv, FALSE);
+
+ return TRUE;
+}
+
+extern "C" void
+gecko_shutdown (void)
+{
+ NS_IF_RELEASE (gPrefBranch);
+ gPrefBranch = nsnull;
+
+ gtk_moz_embed_pop_startup ();
+
+#ifdef HAVE_GECKO_1_9
+ NS_LogTerm ();
+#endif
+}
Added: trunk/src/gecko-utils.h
==============================================================================
--- (empty file)
+++ trunk/src/gecko-utils.h Sun May 25 16:51:30 2008
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2004 Marco Pesenti Gritti
+ * Copyright (C) 2008 Lucian Langa
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GECKO_UTILS_H__
+#define __GECKO_UTILS_H__
+
+G_BEGIN_DECLS
+
+gboolean gecko_prefs_set_bool (const gchar *key, gboolean value);
+gboolean gecko_prefs_set_string (const gchar *key, const gchar *value);
+gboolean gecko_init (void);
+void gecko_shutdown (void);
+
+G_END_DECLS
+
+#endif /* __GECKO_UTILS_H__ */
+
Modified: trunk/src/rss-config-factory.c
==============================================================================
--- trunk/src/rss-config-factory.c (original)
+++ trunk/src/rss-config-factory.c Sun May 25 16:51:30 2008
@@ -33,6 +33,9 @@
GladeXML *xml;
GConfClient *gconf;
GtkWidget *combobox;
+ GtkWidget *check1;
+ GtkWidget *check2;
+ GtkWidget *check3;
} UIData;
static void feeds_dialog_edit(GtkDialog *d, gpointer data);
@@ -1604,6 +1607,22 @@
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),
+ gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JAVA, NULL));
+ g_signal_connect(ui->check1,
+ "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),
+ gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JS, NULL));
+ g_signal_connect(ui->check2,
+ "clicked",
+ G_CALLBACK(start_check_cb),
+ GCONF_KEY_HTML_JS);
+
ui->gconf = gconf_client_get_default ();
hbox = gtk_vbox_new (FALSE, 0);
Modified: trunk/src/rss-html-rendering.glade
==============================================================================
--- trunk/src/rss-html-rendering.glade (original)
+++ trunk/src/rss-html-rendering.glade Sun May 25 16:51:30 2008
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.4 on Wed May 7 22:03:40 2008 -->
+<!--Generated with glade3 3.4.4 on Sun May 25 18:50:22 2008 -->
<glade-interface>
<widget class="GtkWindow" id="window1">
<child>
@@ -42,8 +42,40 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_webkits">
+ <widget class="GtkVBox" id="vbox2">
<property name="visible">True</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="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </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="response_id">0</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="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable JavaScript</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">1</property>
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Sun May 25 16:51:30 2008
@@ -85,12 +85,13 @@
#ifdef HAVE_RENDERKIT
#ifdef HAVE_GTKMOZEMBED
-#ifdef HAVE_LIBXUL
+#ifdef HAVE_GECKO_1_9
#include <gtkmozembed.h>
#else
#include <gtkembedmoz/gtkmozembed.h>
#endif
#endif
+#include "gecko-utils.h"
#ifdef HAVE_OLD_WEBKIT
#include "webkitgtkglobal.h"
@@ -130,6 +131,7 @@
guint farticle;
GtkWidget *flabel;
//#define RSS_DEBUG 1
+guint nettime_id = 0;
#define DEFAULT_FEEDS_FOLDER "News&Blogs"
#define DEFAULT_NO_CHANNEL "Untitled channel"
@@ -137,6 +139,8 @@
/* ms between status updates to the gui */
#define STATUS_TIMEOUT (250)
+#define NETWORK_TIMEOUT (180000)
+
static volatile int org_gnome_rss_controls_counter_id = 0;
struct _org_gnome_rss_controls_pobject {
@@ -607,6 +611,25 @@
g_object_weak_unref(value, unblock_free, key);
}
+gboolean
+timeout_soup(void)
+{
+ g_print("Network timeout occured. Cancel active operations.\n");
+ abort_all_soup();
+ return FALSE;
+}
+
+void
+network_timeout(void)
+{
+ if (nettime_id)
+ g_source_remove(nettime_id);
+
+ nettime_id = g_timeout_add (NETWORK_TIMEOUT,
+ (GtkFunction) timeout_soup,
+ 0);
+}
+
void
abort_all_soup(void)
{
@@ -1523,7 +1546,7 @@
gtk_widget_set_size_request((GtkWidget *)data, width, height);
// apparently resizing gtkmozembed widget won't redraw if using xulrunner
// there is no point in reload for the rest
-#if defined(HAVE_XULRUNNER) || defined(HAVE_LIBXUL)
+#if defined(HAVE_XULRUNNER) || defined(HAVE_GECKO_1_9)
if (2 == gconf_client_get_int(rss_gconf, GCONF_KEY_HTML_RENDER, NULL))
gtk_moz_embed_reload(rf->mozembed, GTK_MOZ_EMBED_FLAG_RELOADNORMAL);
#endif
@@ -1539,12 +1562,7 @@
g_setenv("MOZILLA_FIVE_HOME", GECKO_HOME, 1);
g_unsetenv("MOZILLA_FIVE_HOME");
-// this means xulrunner at least 1.9
-#ifdef HAVE_LIBXUL
- gtk_moz_embed_set_path(GECKO_HOME);
-#else
- gtk_moz_embed_set_comp_path(GECKO_HOME);
-#endif
+ gecko_init();
gchar *profile_dir = g_build_filename (g_get_home_dir (),
".evolution",
@@ -1553,13 +1571,24 @@
gtk_moz_embed_set_profile_path (profile_dir, "mozembed-rss");
g_free (profile_dir);
- if (!g_thread_supported ()) {
- g_thread_init (NULL);
- }
- gtk_moz_embed_push_startup ();
}
#endif
+void
+render_set_preferences(void)
+{
+ gecko_prefs_set_bool("javascript.enabled",
+ gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JS, NULL));
+ gecko_prefs_set_bool("security.enable_java",
+ gconf_client_get_bool(rss_gconf, GCONF_KEY_HTML_JAVA, NULL));
+ gecko_prefs_set_bool("plugin.scan.plid.all", FALSE);
+ gecko_prefs_set_bool("plugin.default_plugin_disabled", TRUE);
+ gchar *agstr = g_strdup_printf("Evolution/%s; Evolution-RSS/%s",
+ EVOLUTION_VERSION_STRING, VERSION);
+ gecko_prefs_set_string("general.useragent.extra.firefox", agstr);
+ g_free(agstr);
+}
+
#ifdef HAVE_RENDERKIT
static gboolean
org_gnome_rss_controls2 (EMFormatHTML *efh, void *eb, EMFormatHTMLPObject *pobject)
@@ -1599,13 +1628,8 @@
gdk_threads_init();
}
-/* if (!rf->test && rf->test < 2)
- {
- gtk_moz_embed_push_startup ();
- rf->test++;
- }*/
-
rf->mozembed = gtk_moz_embed_new();
+ render_set_preferences();
/* FIXME add all those profile shits */
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(moz), GTK_WIDGET(rf->mozembed));
@@ -1638,7 +1662,7 @@
else
{
gtk_moz_embed_stop_load(GTK_MOZ_EMBED(rf->mozembed));
- gtk_moz_embed_load_url (GTK_MOZ_EMBED(rf->mozembed), "about:blank");
+ gtk_moz_embed_load_url (GTK_MOZ_EMBED(rf->mozembed), "about:config");
}
}
#endif
@@ -2255,6 +2279,8 @@
{
d(g_print("taskbar_op_finish()\n"));
taskbar_op_finish("main");
+ farticle=0;
+ ftotal=0;
#ifndef EVOLUTION_2_12
if(rf->progress_dialog)
{
@@ -2265,8 +2291,6 @@
#else
if(rf->label && rf->info)
{
- farticle=0;
- ftotal=0;
gtk_label_set_markup (GTK_LABEL (rf->label), _("Canceled"));
if (rf->info->cancel_button)
gtk_widget_set_sensitive(rf->info->cancel_button, FALSE);
@@ -2496,6 +2520,7 @@
check_folders();
rf->err = NULL;
taskbar_op_message();
+ network_timeout();
g_hash_table_foreach(rf->hrname, fetch_feed, statuscb);
rf->pending = FALSE;
}
@@ -2852,6 +2877,7 @@
rf->err = NULL;
taskbar_op_message();
+ network_timeout();
g_hash_table_foreach(rf->hrname, fetch_feed, statuscb);
// reset cancelation signal
if (rf->cancel)
@@ -3038,6 +3064,7 @@
rf->err = NULL;
taskbar_op_message();
+ network_timeout();
g_hash_table_foreach(rf->hrname, fetch_feed, statuscb);
// reset cancelation signal
if (rf->cancel)
@@ -3055,23 +3082,10 @@
{
d(g_print("RSS: cleaning all remaining sessions .."));
abort_all_soup();
+ d(g_print(".done\n"));
if (rf->mozembed)
gtk_widget_destroy(rf->mozembed);
-#ifdef HAVE_GTKMOZEMBED
-// gtk_moz_embed_pop_startup ();
-#endif
-// gtk_moz_embed_destroy(rf->mozembed);
-// GtkMozEmbed *a = rf->mozembed;
-// a->data->Destroy();
-// a->priv->browser->Destroy();
- g_print(".done\n");
- guint render = GPOINTER_TO_INT(
- gconf_client_get_int(rss_gconf,
- GCONF_KEY_HTML_RENDER,
- NULL));
- //really find a better way to deal with this//
- if (2 == render)
- system("killall -SIGTERM evolution");
+ gecko_shutdown();
}
guint
Modified: trunk/src/rss.h
==============================================================================
--- trunk/src/rss.h (original)
+++ trunk/src/rss.h Sun May 25 16:51:30 2008
@@ -139,6 +139,8 @@
#define GCONF_KEY_PASS_PROXY "/apps/evolution/evolution-rss/pass_proxy"
#define GCONF_KEY_REMOVE_FOLDER "/apps/evolution/evolution-rss/remove_folder"
#define GCONF_KEY_HTML_RENDER "/apps/evolution/evolution-rss/html_render"
+#define GCONF_KEY_HTML_JS "/apps/evolution/evolution-rss/html_js"
+#define GCONF_KEY_HTML_JAVA "/apps/evolution/evolution-rss/html_java"
enum {
RSS_FEED,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]