summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-05-07 14:16:59 +0200
committerraveit65 <[email protected]>2016-05-26 16:15:22 +0200
commit44f6596da2c037ba370ef5b3f95d4f3473bd5ad0 (patch)
tree8f0dcf6fc16f0bf6d15a73f69a670e26fd91137b
parentedae80f9c5b8082b86e1cbd60cfee9c79d7e23ba (diff)
downloadatril-44f6596da2c037ba370ef5b3f95d4f3473bd5ad0.tar.bz2
atril-44f6596da2c037ba370ef5b3f95d4f3473bd5ad0.tar.xz
Add a setting to disable auto-reload
https://bugzilla.gnome.org/show_bug.cgi?id=669265 taken from: https://git.gnome.org/browse/evince/commit/shell/ev-window.c?h=gnome-3-6&id=a5a0f6
-rw-r--r--data/org.mate.Atril.gschema.xml5
-rw-r--r--shell/ev-window.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/data/org.mate.Atril.gschema.xml b/data/org.mate.Atril.gschema.xml
index cd7de5c1..d73069ae 100644
--- a/data/org.mate.Atril.gschema.xml
+++ b/data/org.mate.Atril.gschema.xml
@@ -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.mate.Atril.Default"/>
</schema>
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 8a4553e4..180ce3a5 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -253,6 +253,7 @@ struct _EvWindowPrivate {
#define GS_SCHEMA_NAME "org.mate.Atril"
#define GS_OVERRIDE_RESTRICTIONS "override-restrictions"
+#define GS_AUTO_RELOAD "auto-reload"
#define SIDEBAR_DEFAULT_SIZE 132
#define LINKS_SIDEBAR_ID "links"
@@ -1629,7 +1630,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