[epiphany/tgt: 2/10] Add gsetting to configure embedded documents display



commit 1594d1dc0b4f9e1aa1eede53fd8c3381520719be
Author: Javier M. Mellid <jmunhoz igalia com>
Date:   Mon Jul 22 20:46:05 2013 +0200

    Add gsetting to configure embedded documents display
    
    Add embedded-documents gsetting in order to configure how the browser
    handles supported embedded documents. With this gsetting value set to
    true, supported embedded documents are embedded after download.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689992

 data/org.gnome.epiphany.gschema.xml |    5 +++++
 embed/ephy-web-view.c               |    3 ++-
 lib/ephy-prefs.h                    |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml
index ebdd109..5326a3a 100644
--- a/data/org.gnome.epiphany.gschema.xml
+++ b/data/org.gnome.epiphany.gschema.xml
@@ -24,6 +24,11 @@
                        <summary>Automatic downloads</summary>
                        <description>When files cannot be opened by the browser they are automatically 
downloaded to the download folder and opened with the appropriate application.</description>
                </key>
+               <key type="b" name="embedded-documents">
+                       <default>false</default>
+                       <summary>Embedded document support</summary>
+                       <description>When possible choose between opening documents in embedded mode or with 
external application</description>
+               </key>
                <key type="b" name="new-windows-in-tabs">
                        <default>true</default>
                        <summary>Force new windows to be opened in tabs</summary>
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index e6ab2e8..abc6f4d 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1776,7 +1776,8 @@ decide_policy_cb (WebKitWebView *web_view,
   if (g_strcmp0 (webkit_web_resource_get_uri (main_resource), request_uri) != 0)
     return FALSE;
 
-  if (ephy_embed_utils_mime_type_is_supported_document(mime_type)) {
+  if (ephy_embed_utils_mime_type_is_supported_document(mime_type) &&
+      g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_EMBED_DOCUMENT)) {
     EphyEmbed *embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (web_view);
     ephy_embed_set_mode (embed, EPHY_EMBED_MODE_DOCUMENT);
   }
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index f94d1da..660eb9d 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -115,6 +115,7 @@ typedef enum
 #define EPHY_PREFS_CACHE_SIZE                     "cache-size"
 #define EPHY_PREFS_NEW_WINDOWS_IN_TABS            "new-windows-in-tabs"
 #define EPHY_PREFS_AUTO_DOWNLOADS                 "automatic-downloads"
+#define EPHY_PREFS_EMBED_DOCUMENT                 "embedded-documents"
 #define EPHY_PREFS_WARN_ON_CLOSE_UNSUBMITTED_DATA "warn-on-close-unsubmitted-data"
 #define EPHY_PREFS_REMEMBER_PASSWORDS             "remember-passwords"
 #define EPHY_PREFS_KEYWORD_SEARCH_URL             "keyword-search-url"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]