aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-10 18:57:14 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-10 18:57:14 +0800
commit1a9a315b7f892116319bc5b05323f7d98bbccc36 (patch)
treea26512eed9fc7dfb9d5ca76c299d664d26b7a7d2
parentf86f63bb3a32a1b5ce3a6afcaf3c8c825f4533e9 (diff)
downloadgsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar.gz
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar.bz2
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar.lz
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar.xz
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.tar.zst
gsoc2013-epiphany-1a9a315b7f892116319bc5b05323f7d98bbccc36.zip
Implement security page. Remove some useless hidden prefs in the process.
2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org> * data/epiphany.schemas.in: * data/glade/prefs-dialog.glade: * embed/ephy-embed-prefs.h: * embed/mozilla/mozilla-notifiers.cpp: * src/language-editor.h: * src/prefs-dialog.c: Implement security page. Remove some useless hidden prefs in the process.
-rw-r--r--ChangeLog12
-rw-r--r--data/epiphany.schemas.in46
-rw-r--r--data/glade/prefs-dialog.glade273
-rw-r--r--embed/ephy-embed-prefs.h14
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp38
-rw-r--r--src/language-editor.h3
-rw-r--r--src/prefs-dialog.c12
7 files changed, 348 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index e738a319e..e232920d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
* data/epiphany.schemas.in:
* data/glade/prefs-dialog.glade:
+ * embed/ephy-embed-prefs.h:
+ * embed/mozilla/mozilla-notifiers.cpp:
+ * src/language-editor.h:
+ * src/prefs-dialog.c:
+
+ Implement security page. Remove some useless
+ hidden prefs in the process.
+
+2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * data/epiphany.schemas.in:
+ * data/glade/prefs-dialog.glade:
* lib/ephy-prefs.h:
* src/Makefile.am:
* src/ephy-shell.c: (ephy_shell_new_window_cb):
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index 09717145c..883f244de 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -575,6 +575,52 @@
<locale name="C">
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/epiphay/security/cookie_accept</key>
+ <applyto>/apps/epiphany/security/cookie_accept</applyto>
+ <owner>epiphany</owner>
+ <type>int</type>
+ <default>0</default>
+ <locale name="C">
+ <short>Cookie accept</short>
+ <long>Where to accept cookies from. Possible values are 0 (anywhere),
+ 1 (from current server only), 2 (nowhere)</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/epiphany/security/allow_popups</key>
+ <applyto>/apps/epiphany/security/allow_popups</applyto>
+ <owner>epiphany</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Allow popups</short>
+ <long>Allow sites to open new windows using JavaScript (if JavaScript
+ is enabled).</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/epiphany/security/java_enabled</key>
+ <applyto>/apps/epiphany/security/java_enabled</applyto>
+ <owner>epiphany</owner>
+ <type>bool</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Enable Java</short>
+ <long>Enable Java.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/epiphany/security/javascript_enabled</key>
+ <applyto>/apps/epiphany/security/javascript_enabled</applyto>
+ <owner>epiphany</owner>
+ <type>bool</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Enable JavaScript</short>
+ <long>Enable JavaScript.</long>
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
diff --git a/data/glade/prefs-dialog.glade b/data/glade/prefs-dialog.glade
index 598d95707..f97a22444 100644
--- a/data/glade/prefs-dialog.glade
+++ b/data/glade/prefs-dialog.glade
@@ -1700,20 +1700,281 @@
<child>
<widget class="GtkVBox" id="vbox184">
+ <property name="border_width">12</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <property name="spacing">18</property>
<child>
- <placeholder/>
- </child>
+ <widget class="GtkVBox" id="vbox185">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
- <child>
- <placeholder/>
+ <child>
+ <widget class="GtkLabel" id="label1292">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Web Content&lt;/b&gt;</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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox170">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1293">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox186">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="popups_allow_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Allow popup windows</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</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>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_java_checkbutton">
+ <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="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>
+
+ <child>
+ <widget class="GtkCheckButton" id="enable_javascript_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable Java_Script</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</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>
+ </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">False</property>
+ <property name="fill">True</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkVBox" id="vbox187">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1294">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Cookies&lt;/b&gt;</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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox171">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1295">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox188">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkRadioButton" id="cookies_radiobutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Always accept</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</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>
+
+ <child>
+ <widget class="GtkRadioButton" id="radiobutton58">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Accept _from current site only</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">cookies_radiobutton</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="radiobutton59">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Never accept</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">cookies_radiobutton</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">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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
</child>
</widget>
<packing>
diff --git a/embed/ephy-embed-prefs.h b/embed/ephy-embed-prefs.h
index 8caa14b07..4582a15a5 100644
--- a/embed/ephy-embed-prefs.h
+++ b/embed/ephy-embed-prefs.h
@@ -17,16 +17,10 @@
#define CONF_RENDERING_VISITED_LINKS "/apps/epiphany/rendering/visited_link_color"
#define CONF_RENDERING_UNVISITED_LINKS "/apps/epiphany/rendering/unvisited_link_color"
#define CONF_RENDERING_UNDERLINE_LINKS "/apps/epiphany/rendering/underline_links"
-#define CONF_FILTERING_ALLOW_POPUPS "/apps/epiphany/filtering/allow_popups"
-#define CONF_FILTERING_IMAGE_LOADING_TYPE "/apps/epiphany/filtering/image_loading_type"
-#define CONF_FILTERING_ANIMATE_TYPE "/apps/epiphany/filtering/animate_type"
-#define CONF_FILTERING_STATUSBAR_REWRITE "/apps/epiphany/filtering/statusbar_rewrite"
-#define CONF_FILTERING_JAVA_ENABLED "/apps/epiphany/filtering/java_enabled"
-#define CONF_FILTERING_JAVASCRIPT_ENABLED "/apps/epiphany/filtering/javascript_enabled"
-#define CONF_PERSISTENT_COOKIES_BEHAVIOR "/apps/epiphany/filtering/cookie_behavior"
-#define CONF_PERSISTENT_COOKIE_WARN "/apps/epiphany/filterin/cookie_warn"
-#define CONF_PERSISTENT_COOKIE_LIFETIME "/apps/epiphany/filtering/cookie_lifetime"
-#define CONF_PERSISTENT_PASSWORDS_SAVE "/apps/epiphany/filtering/passwords_save"
+#define CONF_SECURITY_ALLOW_POPUPS "/apps/epiphany/security/allow_popups"
+#define CONF_SECURITY_JAVA_ENABLED "/apps/epiphany/security/java_enabled"
+#define CONF_SECURITY_JAVASCRIPT_ENABLED "/apps/epiphany/security/javascript_enabled"
+#define CONF_SECURITY_COOKIES_ACCEPT "/apps/epiphany/security/cookie_accept"
#define CONF_LANGUAGE_AUTODETECT_CHARSET "/apps/epiphany/rendering/autodetect_charset"
#define CONF_LANGUAGE_DEFAULT_CHARSET "/apps/epiphany/rendering/default_charset"
#define CONF_RENDERING_DEFAULT_FONT "/apps/epiphany/rendering/default_font"
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index 8c7364516..52b4d2560 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -48,11 +48,6 @@ mozilla_own_fonts_notifier(GConfClient *client,
EphyEmbedSingle *single);
static void
-mozilla_animate_notifier(GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- EphyEmbedSingle *single);
-static void
generic_mozilla_string_notifier(GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
@@ -139,9 +134,8 @@ static const struct
}
conversion_table [] =
{
- { CONF_FILTERING_JAVA_ENABLED, BOOL_PREF, "security.enable_java"},
- { CONF_FILTERING_JAVASCRIPT_ENABLED, BOOL_PREF, "javascript.enabled"},
- { CONF_FILTERING_IMAGE_LOADING_TYPE, INT_PREF, "network.image.imageBehavior"},
+ { CONF_SECURITY_JAVA_ENABLED, BOOL_PREF, "security.enable_java"},
+ { CONF_SECURITY_JAVASCRIPT_ENABLED, BOOL_PREF, "javascript.enabled"},
{ CONF_RENDERING_BG_COLOR, STRING_PREF, "browser.display.background_color"},
{ CONF_RENDERING_TEXT_COLOR, STRING_PREF, "browser.display.foreground_color"},
{ CONF_RENDERING_UNVISITED_LINKS, STRING_PREF, "browser.anchor_color"},
@@ -160,10 +154,7 @@ conversion_table [] =
{ CONF_NETWORK_MEMORY_CACHE, INT_PREF, "browser.cache.memory.capacity"},
{ CONF_NETWORK_DISK_CACHE, INT_PREF, "browser.cache.disk.capacity"},
{ CONF_NETWORK_CACHE_COMPARE, INT_PREF, "browser.cache.check_doc_frequency"},
- { CONF_PERSISTENT_COOKIE_WARN, BOOL_PREF, "network.cookie.warnAboutCookies"},
- { CONF_PERSISTENT_COOKIES_BEHAVIOR, INT_PREF, "network.cookie.cookieBehavior"},
- { CONF_PERSISTENT_COOKIE_LIFETIME, BOOL_PREF, "network.cookie.lifetime.enabled"},
- { CONF_PERSISTENT_PASSWORDS_SAVE, BOOL_PREF, "signon.rememberSignons"},
+ { CONF_SECURITY_COOKIES_ACCEPT, BOOL_PREF, "network.cookie.warnAboutCookies"},
{ CONF_RENDERING_USE_SYSTEM_COLORS, BOOL_PREF, "browser.display.use_system_colors"},
{ NULL, 0, NULL }
};
@@ -177,13 +168,11 @@ custom_notifiers [] =
{
{ CONF_NETWORK_USER_AGENT,
(GConfClientNotifyFunc) mozilla_user_agent_notifier },
- { CONF_FILTERING_ANIMATE_TYPE,
- (GConfClientNotifyFunc) mozilla_animate_notifier },
{ CONF_RENDERING_USE_OWN_COLORS,
(GConfClientNotifyFunc) mozilla_own_colors_notifier },
{ CONF_RENDERING_USE_OWN_FONTS,
(GConfClientNotifyFunc) mozilla_own_fonts_notifier },
- { CONF_FILTERING_ALLOW_POPUPS,
+ { CONF_SECURITY_ALLOW_POPUPS,
(GConfClientNotifyFunc) mozilla_allow_popups_notifier },
{ CONF_LANGUAGE_DEFAULT_CHARSET,
(GConfClientNotifyFunc) mozilla_default_charset_notifier },
@@ -510,29 +499,12 @@ mozilla_own_fonts_notifier(GConfClient *client,
}
static void
-mozilla_animate_notifier(GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- EphyEmbedSingle *single)
-{
- static const gchar *type[] =
- {
- "normal",
- "once",
- "none"
- };
-
- mozilla_prefs_set_string ("image.animation_mode",
- type[gconf_value_get_int(entry->value)]);
-}
-
-static void
mozilla_allow_popups_notifier(GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
EphyEmbedSingle *single)
{
- gboolean new_val = eel_gconf_get_boolean(CONF_FILTERING_ALLOW_POPUPS);
+ gboolean new_val = eel_gconf_get_boolean(CONF_SECURITY_ALLOW_POPUPS);
mozilla_prefs_set_boolean ("dom.disable_open_during_load",
!new_val);
}
diff --git a/src/language-editor.h b/src/language-editor.h
index 153fa136a..c4da83028 100644
--- a/src/language-editor.h
+++ b/src/language-editor.h
@@ -19,7 +19,8 @@
#ifndef LANGUAGE_EDITOR_H
#define LANGUAGE_EDITOR_H
-#include "general-prefs.h"
+#include "ephy-dialog.h"
+#include "language-editor.h"
#include <gtk/gtkwidget.h>
#include <glib-object.h>
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 6a9fa6e10..0c02b7fbf 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -215,6 +215,12 @@ enum
USE_COLORS_PROP,
USE_FONTS_PROP,
+ /* Security */
+ ALLOW_POPUPS_PROP,
+ ALLOW_JAVA_PROP,
+ ALLOW_JS_PROP,
+ ACCEPT_COOKIES_PROP,
+
/* Advanced */
CACHE_COMPARE_PROP,
DISK_CACHE_PROP,
@@ -251,6 +257,12 @@ EphyDialogProperty properties [] =
{ USE_COLORS_PROP, "use_colors_checkbutton", CONF_RENDERING_USE_OWN_COLORS, PT_AUTOAPPLY, NULL },
{ USE_FONTS_PROP, "use_fonts_checkbutton", CONF_RENDERING_USE_OWN_FONTS, PT_AUTOAPPLY, NULL },
+ /* Security */
+ { ALLOW_POPUPS_PROP, "popups_allow_checkbutton", CONF_SECURITY_ALLOW_POPUPS, PT_AUTOAPPLY, NULL },
+ { ALLOW_JAVA_PROP, "enable_java_checkbutton", CONF_SECURITY_JAVA_ENABLED, PT_AUTOAPPLY, NULL },
+ { ALLOW_JS_PROP, "enable_javascript_checkbutton", CONF_SECURITY_JAVASCRIPT_ENABLED, PT_AUTOAPPLY, NULL },
+ { ACCEPT_COOKIES_PROP, "cookies_radiobutton", CONF_SECURITY_COOKIES_ACCEPT, PT_AUTOAPPLY, NULL },
+
/* Advanced */
{ CACHE_COMPARE_PROP, "cache_compare_radiobutton", CONF_NETWORK_CACHE_COMPARE, PT_AUTOAPPLY, NULL },
{ DISK_CACHE_PROP, "disk_cache_spin", CONF_NETWORK_DISK_CACHE, PT_AUTOAPPLY, NULL },