1 From: Jeremy Bicha <jbicha@ubuntu.com>
2 Date: Sat, 23 Dec 2017 02:22:44 -0500
3 Subject: Drop gconf dependency
5 Revert 3647e8bd20533f317c8fa0deac29e89fec0512f2
6 "Remember show_toolbar and last_open folder in gconf"
8 Similarly, undo gconf support for Bookmarks feature
11 src/Makefile.am | 2 --
12 src/PdfMod/Core/Client.cs | 2 --
13 src/PdfMod/Core/Configuration.cs | 65 ----------------------------------------
14 src/PdfMod/Gui/Actions.cs | 17 +++--------
15 src/PdfMod/Gui/BookmarkView.cs | 2 --
16 src/PdfMod/Gui/Client.cs | 3 --
17 7 files changed, 4 insertions(+), 88 deletions(-)
18 delete mode 100644 src/PdfMod/Core/Configuration.cs
20 diff --git a/configure.ac b/configure.ac
21 index e3b4570..6438aa0 100644
24 @@ -108,7 +108,6 @@ AM_GLIB_GNU_GETTEXT
25 dnl package checks, common for all configs
26 PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0])
27 PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0])
28 -PKG_CHECK_MODULES([GCONF_SHARP_20], [gconf-sharp-2.0])
30 dnl package checks, per config
31 PKG_CHECK_MODULES(HYENA, hyena >= 0.5)
32 diff --git a/src/Makefile.am b/src/Makefile.am
33 index 9eb4c74..a3ead39 100644
36 @@ -29,7 +29,6 @@ all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES)
38 PdfMod/Core/AssemblyInfo.cs \
39 PdfMod/Core/Client.cs \
40 - PdfMod/Core/Configuration.cs \
41 PdfMod/Core/Defines.cs \
42 PdfMod/Gui/Actions.cs \
43 PdfMod/Gui/BookmarkView.cs \
44 @@ -63,7 +62,6 @@ EXTRAS = \
48 - -pkg:gconf-sharp-2.0 \
52 diff --git a/src/PdfMod/Core/Client.cs b/src/PdfMod/Core/Client.cs
53 index e8d4d11..fac4c75 100644
54 --- a/src/PdfMod/Core/Client.cs
55 +++ b/src/PdfMod/Core/Client.cs
56 @@ -32,13 +32,11 @@ namespace PdfMod.Core
57 static readonly string CacheDir = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory ("XDG_CACHE_HOME", ".cache"), "pdfmod");
59 public Document Document { get; protected set; }
60 - public static Configuration Configuration { get; private set; }
62 public event EventHandler DocumentLoaded;
66 - Configuration = new Configuration ();
70 diff --git a/src/PdfMod/Core/Configuration.cs b/src/PdfMod/Core/Configuration.cs
71 deleted file mode 100644
72 index 817b9f4..0000000
73 --- a/src/PdfMod/Core/Configuration.cs
76 -// Copyright (C) 2009-2010 Novell, Inc.
78 -// This program is free software; you can redistribute it and/or
79 -// modify it under the terms of the GNU General Public License
80 -// as published by the Free Software Foundation; either version 2
81 -// of the License, or (at your option) any later version.
83 -// This program is distributed in the hope that it will be useful,
84 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
85 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86 -// GNU General Public License for more details.
88 -// You should have received a copy of the GNU General Public License
89 -// along with this program; if not, write to the Free Software
90 -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
94 -namespace PdfMod.Core
96 - public class Configuration
98 - GConf.Client client = new GConf.Client ();
99 - string ns = "/apps/pdfmod/";
101 - public Configuration()
105 - T Get<T> (string key, T fallback)
108 - return (T) client.Get (ns + key);
114 - void Set<T> (string key, T val)
116 - client.Set (ns + key, val);
119 - public bool ShowToolbar {
120 - get { return Get<bool> ("show_toolbar", true); }
121 - set { Set<bool> ("show_toolbar", value); }
124 - public bool ShowBookmarks {
125 - get { return Get<bool> ("show_bookmarks", false); }
126 - set { Set<bool> ("show_bookmarks", value); }
129 - public string LastOpenFolder {
130 - get { return Get<string> ("last_folder", System.Environment.GetFolderPath (System.Environment.SpecialFolder.Desktop)); }
132 - if (value != null && value.StartsWith ("file:/") && !value.StartsWith ("file://")) {
133 - value = "file://" + value.Substring (6);
136 - Set<string> ("last_folder", value);
141 diff --git a/src/PdfMod/Gui/Actions.cs b/src/PdfMod/Gui/Actions.cs
142 index 3fc452b..9651a36 100644
143 --- a/src/PdfMod/Gui/Actions.cs
144 +++ b/src/PdfMod/Gui/Actions.cs
145 @@ -110,8 +110,8 @@ namespace PdfMod.Gui
147 new ToggleActionEntry ("Properties", Stock.Properties, null, "<alt>Return", Catalog.GetString ("View and edit the title, keywords, and more for this document"), OnProperties, false),
148 new ToggleActionEntry ("ZoomFit", Stock.ZoomFit, null, "<control>0", null, OnZoomFit, true),
149 - new ToggleActionEntry ("ViewToolbar", null, Catalog.GetString ("Toolbar"), null, null, OnViewToolbar, Client.Configuration.ShowToolbar),
150 - new ToggleActionEntry ("ViewBookmarks", null, Catalog.GetString ("Bookmarks"), "F9", null, OnViewBookmarks, Client.Configuration.ShowBookmarks),
151 + new ToggleActionEntry ("ViewToolbar", null, Catalog.GetString ("Toolbar"), null, null, OnViewToolbar, true),
152 + new ToggleActionEntry ("ViewBookmarks", null, Catalog.GetString ("Bookmarks"), "F9", null, OnViewBookmarks, false),
153 new ToggleActionEntry ("FullScreenView", null, Catalog.GetString ("Fullscreen"), "F11", null, OnFullScreenView, false)
156 @@ -230,12 +230,6 @@ namespace PdfMod.Gui
157 chooser.SelectMultiple = true;
158 chooser.AddButton (Stock.Open, ResponseType.Ok);
160 - if (app.Document != null) {
161 - chooser.SetCurrentFolder (System.IO.Path.GetDirectoryName (app.Document.SuggestedSavePath));
163 - chooser.SetCurrentFolder (Client.Configuration.LastOpenFolder);
166 var response = chooser.Run ();
167 var filenames = chooser.Filenames;
169 @@ -266,7 +260,6 @@ namespace PdfMod.Gui
170 chooser.DoOverwriteConfirmation = true;
171 chooser.CurrentName = System.IO.Path.GetFileName (app.Document.SuggestedSavePath);
172 chooser.AddButton (Stock.SaveAs, ResponseType.Ok);
173 - chooser.SetCurrentFolder (System.IO.Path.GetDirectoryName (app.Document.SuggestedSavePath));
175 var response = chooser.Run ();
176 string filename = chooser.Filename;
177 @@ -462,14 +455,12 @@ namespace PdfMod.Gui
179 void OnViewToolbar (object o, EventArgs args)
181 - bool show = (this["ViewToolbar"] as ToggleAction).Active;
182 - Client.Configuration.ShowToolbar = app.HeaderToolbar.Visible = show;
183 + app.HeaderToolbar.Visible = (this["ViewToolbar"] as ToggleAction).Active;
186 void OnViewBookmarks (object o, EventArgs args)
188 - bool show = (this["ViewBookmarks"] as ToggleAction).Active;
189 - Client.Configuration.ShowBookmarks = app.BookmarkView.Visible = show;
190 + app.BookmarkView.Visible = (this["ViewBookmarks"] as ToggleAction).Active;
191 if (app.BookmarkView.Visible) {
192 app.BookmarkView.GrabFocus ();
194 diff --git a/src/PdfMod/Gui/BookmarkView.cs b/src/PdfMod/Gui/BookmarkView.cs
195 index 00303cd..29f9d16 100644
196 --- a/src/PdfMod/Gui/BookmarkView.cs
197 +++ b/src/PdfMod/Gui/BookmarkView.cs
198 @@ -69,8 +69,6 @@ namespace PdfMod.Gui
200 AddOutlineCollection (document, document.Pdf.Outlines, TreeIter.Zero);
203 - Visible = Client.Configuration.ShowBookmarks;
206 // Bookmark action handlers
207 diff --git a/src/PdfMod/Gui/Client.cs b/src/PdfMod/Gui/Client.cs
208 index d7a408b..a614dcb 100644
209 --- a/src/PdfMod/Gui/Client.cs
210 +++ b/src/PdfMod/Gui/Client.cs
211 @@ -125,8 +125,6 @@ namespace PdfMod.Gui
212 HeaderToolbar.ShowArrow = false;
213 HeaderToolbar.ToolbarStyle = ToolbarStyle.Icons;
214 HeaderToolbar.Tooltips = true;
215 - HeaderToolbar.NoShowAll = true;
216 - HeaderToolbar.Visible = Configuration.ShowToolbar;
219 BookmarkView = new BookmarkView (this);
220 @@ -272,7 +270,6 @@ namespace PdfMod.Gui
221 path = System.IO.Path.GetFullPath (path);
224 - Configuration.LastOpenFolder = System.IO.Path.GetDirectoryName (suggestedFilename ?? path);
225 status_label.Text = Catalog.GetString ("Loading document...");
227 ThreadAssist.SpawnFromMain (delegate {