[evince] Add a setting to disable auto-reload



commit a5a0f6e2c6e4cccf4863bf5423050a8d3ba67630
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Feb 12 12:09:39 2012 +0100

    Add a setting to disable auto-reload
    
    https://bugzilla.gnome.org/show_bug.cgi?id=669265

 data/org.gnome.Evince.gschema.xml.in |    5 +++++
 shell/ev-window.c                    |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.Evince.gschema.xml.in b/data/org.gnome.Evince.gschema.xml.in
index 93fe690..c474c2b 100644
--- a/data/org.gnome.Evince.gschema.xml.in
+++ b/data/org.gnome.Evince.gschema.xml.in
@@ -12,6 +12,11 @@
       <_summary>Override document restrictions</_summary>
       <_description>Override document restrictions, like restriction to copy or to print.</_description>
     </key>
+    <key name="auto-reload" type="b">
+      <default>true</default>
+      <_summary>Automatically reload then document</_summary>
+      <_description>The document is automatically reloaded on file change.</_description>
+    </key>
     <child name="default" schema="org.gnome.Evince.Default"/>
   </schema>
 
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 0a658ca..acb531a 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -245,6 +245,7 @@ struct _EvWindowPrivate {
 
 #define GS_SCHEMA_NAME           "org.gnome.Evince"
 #define GS_OVERRIDE_RESTRICTIONS "override-restrictions"
+#define GS_AUTO_RELOAD           "auto-reload"
 
 #define SIDEBAR_DEFAULT_SIZE    132
 #define LINKS_SIDEBAR_ID "links"
@@ -1536,7 +1537,9 @@ static void
 ev_window_document_changed (EvWindow *ev_window,
 			    gpointer  user_data)
 {
-	ev_window_reload_document (ev_window, NULL);
+	if (ev_window->priv->settings &&
+	    g_settings_get_boolean (ev_window->priv->settings, GS_AUTO_RELOAD))
+		ev_window_reload_document (ev_window, NULL);
 }
 
 static void



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