Merge lp:~ubuntu-desktop/evince/313 into lp:~ubuntu-desktop/evince/ubuntu

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 252
Proposed branch: lp:~ubuntu-desktop/evince/313
Merge into: lp:~ubuntu-desktop/evince/ubuntu
Diff against target: 6972 lines (+1104/-5400)
19 files modified
debian/changelog (+166/-240)
debian/control.in (+9/-10)
debian/evince-common.install (+0/-1)
debian/evince-gtk.install (+3/-0)
debian/evince.install (+1/-0)
debian/libevdocument3-4.symbols (+18/-9)
debian/libevview3-3.symbols (+46/-19)
debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch (+0/-4679)
debian/patches/0002-Don-t-use-gtk_application_set_accels_for_action.patch (+0/-193)
debian/patches/11_grip_gestures.patch (+65/-48)
debian/patches/git_Don-t-allow-Send-To-when-there-is-no-mail-client-ava.patch (+0/-62)
debian/patches/gnome_icon_theme.patch (+23/-0)
debian/patches/gtk310-secondary-keybindings.patch (+0/-86)
debian/patches/gtk_no_gesture.patch (+220/-0)
debian/patches/series (+5/-4)
debian/patches/traditional_menu_bar.patch (+481/-0)
debian/patches/unity_normal_titlebar.patch (+49/-0)
debian/patches/workaround_notes_color_issue.patch (+0/-11)
debian/rules (+18/-38)
To merge this branch: bzr merge lp:~ubuntu-desktop/evince/313
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+234121@code.launchpad.net

Commit message

Resynchronize on Debian, update to the current upstream version

Description of the change

Resynchronize on Debian, update to the current upstream version

To post a comment you must log in.
lp:~ubuntu-desktop/evince/313 updated
251. By Sebastien Bacher

don't set headerbar titles when not using it as decoration

252. By Sebastien Bacher

* debian/control:
  - drop libsm build-depends, that has been deprecated upstream
  - build-depends on libgnome-desktop-3-dev
  - updated gtk requirement
* debian/rules:
  - disable libgnome support in the gtk build

Revision history for this message
Lars Karlitski (larsu) wrote :

Hm, the toolbar looks a bit odd with one button when no document is loaded. But that's a very rare case. I don't think we should block on that.

There are a couple of theming issues:

- the zoom dropdown is now a popover (which looks better with lp:~larsu/ubuntu-themes/lp1347321, but still not perfect as it uses radio buttons)
- the page input looks weird when focussing it or when the window is unfocussed
- the header bar needs some margins

All of these should be fixable from within the theme. I'll look into that.

The new patch looks good to me.

Great work. Thanks!

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the review Lars, those don't seem important enough to be blocker imho, we should still fix them this cycle if we can

Revision history for this message
Lars Karlitski (larsu) wrote :

I've fixed those issues in lp:~larsu/ubuntu-themes/lp1347321.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-13 14:26:39 +0000
3+++ debian/changelog 2014-09-10 14:34:55 +0000
4@@ -1,3 +1,81 @@
5+evince (3.13.91-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ * New upstream version (lp: #1367769):
8+ - Do not open single page pdfs in dual mode by default (lp: #256445)
9+ - Set the window title for empty windows to make sure it's exposed
10+ to accessibility (lp: #704928)
11+ - Close the window when CTRL+w shortcut is used in presentation
12+ mode, instead of turning the screen white (lp #1289581)
13+ - Keep the scroll position when switching between continuous and
14+ non continuous mode (lp: #276749)
15+ - Fix rotation direction in DJVU backend (lp: #1242678)
16+ - Better handling of hi-dpi screen (lp: #1287915)
17+ - Make <Ctrl>Home/End scroll to the start/end of the document
18+ (lp: #1279387)
19+ - New Preserve Zoom Feature (lp: #286218)
20+ * debian/control:
21+ - drop libsm build-depends, that has been deprecated upstream
22+ - build-depends on libgnome-desktop-3-dev
23+ - updated gtk requirement
24+ * debian/libevdocument3-4.symbols, debian/libevview3-3.symbols:
25+ - updated for the new version
26+ * debian/patches/gnome_icon_theme.patch:
27+ - use old gnome-icon-theme name until we update that component
28+ * debian/patches/gtk_no_gesture.patch:
29+ - revert use of gtk gesture until we get gtk 3.13 (new in that version)
30+ * debian/patches/traditional_menu_bar.patch:
31+ - use traditionnal menubars under Unity (the gmenumodel work has been
32+ commited upstream but not the menubar changes)
33+ * debian/patches/unity_normal_titlebar.patch:
34+ - use traditionnal menubars out of gnome-shell
35+ * debian/rules:
36+ - disable libgnome support in the gtk build
37+ * Resynchronize on Debian
38+ * debian/apparmor-profile:
39+ * debian/apparmor-profile.abstraction:
40+ * debian/evince.apport:
41+ * debian/evince-common.dirs:
42+ - Ubuntu apparmor profile
43+ * debian/control:
44+ - Build-Depend on dh-apparmor and libgrip-dev
45+ - Suggests on apparmor
46+ * debian/rules:
47+ - install apparmor files
48+ * debian/patches/11_grip_gestures.patch:
49+ - supports pinch to zoom, rotate, and drag gestures
50+ * Changes deprecated with that version
51+ * debian/rules:
52+ - save some space by not shipping the synctex screencast.
53+ (the video is not included in the new upstream version)
54+
55+ -- Sebastien Bacher <seb128@ubuntu.com> Thu, 26 Jun 2014 17:49:21 +0200
56+
57+evince (3.12.1-1) unstable; urgency=medium
58+
59+ * New upstream release
60+ * debian/libevview3-3.symbols: Updated
61+
62+ -- Sjoerd Simons <sjoerd@debian.org> Sat, 26 Apr 2014 16:39:37 +0200
63+
64+evince (3.12.0-1) unstable; urgency=medium
65+
66+ * New upstream release.
67+
68+ -- Andreas Henriksson <andreas@fatal.se> Tue, 25 Mar 2014 21:04:58 +0100
69+
70+evince (3.11.90-1) experimental; urgency=medium
71+
72+ [ Emilio Pozuelo Monfort ]
73+ * debian/control.in:
74+ + Build depend on libtiff-dev instead of libtiff4-dev. Closes: #736001.
75+
76+ [ Andreas Henriksson ]
77+ * New upstream release.
78+ * Add one new symbol to debian/libevdocument3-4.symbols
79+ * Add one new symbol to debian/libevview3-3.symbols
80+
81+ -- Andreas Henriksson <andreas@fatal.se> Sun, 23 Feb 2014 20:11:04 +0100
82+
83 evince (3.10.3-0ubuntu16) utopic; urgency=medium
84
85 * debian/apparmor-profile: fix at-spi2 rules added in last update to use a
86@@ -27,247 +105,95 @@
87
88 -- Matthias Klose <doko@ubuntu.com> Tue, 05 Aug 2014 18:22:04 +0200
89
90-evince (3.10.3-0ubuntu13) utopic; urgency=medium
91-
92- * debian/apparmor-profile.abstraction: allow rw to ~/.config/evince
93- (LP: #1016103)
94-
95- -- Jamie Strandboge <jamie@ubuntu.com> Fri, 06 Jun 2014 13:03:06 -0500
96-
97-evince (3.10.3-0ubuntu12) utopic; urgency=medium
98-
99- * debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch:
100- - use the correct "previous/next page" tooltips (lp: #1318581)
101-
102- [ Lars Uebernickel ]
103- * restore keybindings that stopped working with the gmenumodel work
104- (lp: #1313250, #1310782, #1312179)
105-
106- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 03 Jun 2014 16:25:15 +0200
107-
108-evince (3.10.3-0ubuntu11) utopic; urgency=medium
109-
110- * debian/apparmor-profile.abstraction: allow 'r' of /etc/xfce4/defaults.list
111- (LP: #1315830)
112-
113- -- Jamie Strandboge <jamie@ubuntu.com> Mon, 05 May 2014 09:06:14 -0500
114-
115-evince (3.10.3-0ubuntu10) trusty; urgency=medium
116-
117- [ Lars Uebernickel ]
118- * debian/patches/gtk310-secondary-keybindings.patch:
119- - get multiple keybindings to work with gtk 3.10 (lp: #1290104)
120- * debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch:
121- "gmenumodel patch: restore zoom selector popup.
122- It got deleted by accident in the last commit. (lp: #1289180)
123-
124- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 11 Mar 2014 18:40:10 +0100
125-
126-evince (3.10.3-0ubuntu9) trusty; urgency=medium
127-
128- [ Lars Uebernickel ]
129- * debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch:
130- - don't show menubar in presentation mode (lp: #1283235)
131- - restore the context menu by using gmenumodel as well there
132-
133- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 04 Mar 2014 18:11:03 +0100
134-
135-evince (3.10.3-0ubuntu8) trusty; urgency=medium
136-
137- * debian/apparmor-profile: allow alternate file managers to nautilus when
138- using 'Show containing folder' (LP: #1022962)
139-
140- -- Jamie Strandboge <jamie@ubuntu.com> Wed, 26 Feb 2014 08:37:42 -0600
141-
142-evince (3.10.3-0ubuntu7) trusty; urgency=medium
143-
144- * debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch:
145- - updated to fix issue with autoreload on changes,
146- thanks Lars Uebernickel for the update
147- (lp: #1279755)
148-
149- -- Sebastien Bacher <seb128@ubuntu.com> Thu, 13 Feb 2014 17:00:16 +0100
150-
151-evince (3.10.3-0ubuntu6) trusty; urgency=medium
152-
153- * Restore working keybindings under non unity sessions,
154- thanks Lars Uebernickel (lp: #1277370)
155-
156- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 11 Feb 2014 17:02:46 +0100
157-
158-evince (3.10.3-0ubuntu5) trusty; urgency=medium
159-
160- * Updated previous patch to fix some issues, thanks Lars Uebernickel
161- (lp: #1277370)
162-
163- -- Sebastien Bacher <seb128@ubuntu.com> Fri, 07 Feb 2014 16:24:46 +0000
164-
165-evince (3.10.3-0ubuntu4) trusty; urgency=medium
166-
167- * debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch:
168- - updated to fix menus not showing in other desktops (lp: #1131664)
169-
170- -- Sebastien Bacher <seb128@ubuntu.com> Thu, 06 Feb 2014 13:52:03 +0000
171-
172-evince (3.10.3-0ubuntu3) trusty; urgency=medium
173-
174- * Add GMenuModel port (lp: #1131664)
175-
176- -- Lars Uebernickel <lars.uebernickel@ubuntu.com> Tue, 04 Feb 2014 15:22:45 +0000
177-
178-evince (3.10.3-0ubuntu2) trusty; urgency=medium
179-
180- * debian/apparmor-profile.abstraction, debian/apparmor-profile:
181- - let create directories, from the file selector, on devices mounted
182- by the user, thanks Jamie Strandboge (lp: #1265491)
183- - updated to allow opening/saving pdf.xz files, thanks Martin Thornton
184- (lp: #1252771)
185- * debian/control.in: Depends on gnome-icon-theme-symbolic (lp: #1246448)
186-
187- -- Sebastien Bacher <seb128@ubuntu.com> Wed, 08 Jan 2014 18:24:03 +0100
188-
189-evince (3.10.3-0ubuntu1) trusty; urgency=low
190-
191- * New upstream version
192-
193- -- Sebastien Bacher <seb128@ubuntu.com> Mon, 18 Nov 2013 15:37:35 +0100
194-
195-evince (3.10.2-0ubuntu1) trusty; urgency=low
196-
197- * New upstream version
198- * debian/patches/git_give_focus_correctly.patch,
199- debian/patches/git_correct_page_info.patch,
200- debian/patches/git_djvu_segfault.patch:
201- - dropped, those changes are in the new version
202-
203- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 12 Nov 2013 12:10:03 +0100
204-
205-evince (3.10.0-0ubuntu3) trusty; urgency=low
206-
207- * Backport some fixes from git
208- * debian/patches/CVE-2013-3718.patch:
209- - dropped, the fix was already in the new version in a slightly
210- different place, the patch there is not needed and creates warnings
211- * debian/patches/git_give_focus_correctly.patch:
212- - 'fix annotation window focus change after creation' (lp: #919965)
213- * debian/patches/git_correct_page_info.patch:
214- - "This fixes the page size always reported as 0x0 in
215- the properties dialog" (lp: #1245637)
216- * debian/patches/git_djvu_segfault.patch:
217- - ' djvu: Fix a segfault caused by a double free'
218-
219- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 05 Nov 2013 16:09:18 +0100
220-
221-evince (3.10.0-0ubuntu2) saucy; urgency=low
222-
223- * debian/apparmor-profile: Update evince profiles
224- - Include the AppArmor dbus-accessibility abstraction in the evince and
225- evince-previewer profiles to gain access to the accessibility bus
226- (LP: #1226141)
227- - Include the AppArmor dbus abstraction in the evince profile to gain
228- access to the system bus for avahi and colord when printing
229- (LP: #1235216)
230- - Include the AppArmor dbus-session abstraction in the evince-thumbnailer
231- profile to gain access to the session bus (LP: #1236082)
232-
233- -- Tyler Hicks <tyhicks@canonical.com> Sun, 06 Oct 2013 14:26:18 -0700
234-
235-evince (3.10.0-0ubuntu1) saucy; urgency=low
236-
237- * New upstream version
238-
239- -- Sebastien Bacher <seb128@ubuntu.com> Mon, 30 Sep 2013 13:47:16 +0200
240-
241-evince (3.9.90-0ubuntu1) saucy; urgency=low
242-
243- * New upstream release
244-
245- -- Luke Yelavich <themuso@ubuntu.com> Wed, 28 Aug 2013 07:51:41 +1000
246-
247-evince (3.9.5-0ubuntu1~saucy1) saucy; urgency=medium
248-
249- * New upstream release
250- * debian/libevdocument3-4.symbols, libevview3-3.symbols: updated
251-
252- -- Tim Lunn <tim@feathertop.org> Fri, 09 Aug 2013 21:14:49 +1000
253-
254-evince (3.9.4-0ubuntu1~saucy1) saucy; urgency=medium
255-
256- * New upstream release
257- * debian/control.in: bump b-d on glib, gtk and poppler
258- * debian/patches/11_grip_gestures.patch: Refreshed
259- * debian/libevdocument3-4.symbols, libevview3-3.symbols: updated
260-
261- -- Tim Lunn <tim@feathertop.org> Wed, 24 Jul 2013 20:08:56 +1000
262-
263-evince (3.8.2-0ubuntu4) saucy; urgency=low
264-
265- * SECURITY UPDATE: denial of service and possible code execution via
266- missing page number check
267- - debian/patches/CVE-2013-3718.patch: check number of pages in
268- libview/ev-view.c.
269- - CVE-2013-3718
270-
271- -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 06 Jun 2013 13:36:38 -0400
272-
273-evince (3.8.2-0ubuntu3) saucy; urgency=low
274-
275- * Rebuild again, the new library is published this time...
276-
277- -- Sebastien Bacher <seb128@ubuntu.com> Thu, 30 May 2013 13:10:46 +0200
278-
279-evince (3.8.2-0ubuntu2) saucy; urgency=low
280-
281- * Rebuild with the new poppler soname
282-
283- -- Sebastien Bacher <seb128@ubuntu.com> Thu, 30 May 2013 11:29:11 +0200
284-
285-evince (3.8.2-0ubuntu1) saucy; urgency=medium
286-
287- * Upload to saucy based on the work from the GNOME3 ppa, thanks Rico
288- * The new version fixes those issues:
289- - "use nautilus's frame for thumbnails" (lp: #155726)
290- - "When <Ctrl>+Scroll zooming, include Page Width, Fit Page" (lp: #254519)
291- - "Fix rendering of the first visible page while resizing" (lp: #349670)
292- - "Allow case-sensitive and/or regexp search in evince" (lp: #360152)
293- - "When manually zooming below 50% Evince still shows 50% as
294- the zoom level." (lp: #653911)
295- - "can´t resize side pane" (lp: #704232)
296- - "incorrectly reports document Location in its Properties if
297- there are % in filename" (lp: #1112641)
298-
299- [ Rico Tzschichholz ]
300- * New upstream release
301- * debian/control:
302- - Bump build-depends on libgtk-3-dev (>= 3.7.5),
303- Add libsecret-1-dev (>= 0.5) and drop libgnome-keyring-dev
304- * debian/libevdocument3-4.symbols,libevview3-3.symbols:
305- - Updated
306- * debian/patches:
307- - Drop 03_nodisplay.patch, upstream
308- * debian/patches/11_grip_gestures.patch:
309- - Refreshed
310-
311- -- Sebastien Bacher <seb128@ubuntu.com> Tue, 28 May 2013 13:43:47 +0200
312-
313-evince (3.6.1-1ubuntu1) raring; urgency=low
314-
315- * Resynchronize on Debian
316- * debian/apparmor-profile:
317- * debian/apparmor-profile.abstraction:
318- * debian/evince.apport:
319- * debian/evince-common.dirs:
320- - Ubuntu apparmor profile
321- * debian/control:
322- - Build-Depend on dh-apparmor, use tiff5 rather than tiff4
323- - Suggests on apparmor
324+evince (3.10.0-2) unstable; urgency=medium
325+
326+ * Remove t1lib dependency (Closes: #638759)
327+
328+ -- Andreas Henriksson <andreas@fatal.se> Fri, 17 Jan 2014 22:35:24 +0100
329+
330+evince (3.10.0-1) unstable; urgency=low
331+
332+ * New upstream release.
333+ * Bump build-dependencies according to configure.ac (except poppler):
334+ - libgtk-3-dev to >= 3.8.0
335+ - libglib2.0-dev to >= 2.36
336+ * Add patches to revert more poppler version bumps:
337+ - debian/patches/revert-poppler-0.24.patch
338+ - debian/patches/revert-poppler-0.23.3.patch
339+ * Refresh debian/patches/01-poppler-0.18-compat.patch while at it.
340+ * Update debian/libevdocument3-4.symbols with one added symbol
341+ * Update debian/libevview3-3.symbols
342+ - several additions and one removal: ev_view_selection_mode_get_type
343+ - dropped symbol used (or wrapped atleast) in gnome-python-desktop
344+ - Noone else seems to have noticed, so I'll just stick my head
345+ in the sand for now and hope this doesn't cause any issues.
346+
347+ -- Andreas Henriksson <andreas@fatal.se> Thu, 17 Oct 2013 12:44:30 +0200
348+
349+evince (3.8.3-2) unstable; urgency=low
350+
351+ * Depend on gnome-icon-theme-symbolic for the symbolic icons used in the
352+ redesigned UI. Closes: #717057
353+
354+ -- Michael Biebl <biebl@debian.org> Thu, 05 Sep 2013 17:17:59 +0200
355+
356+evince (3.8.3-1) unstable; urgency=low
357+
358+ * New upstream release.
359+ * Bump Standards-Version to 3.9.4. No further changes.
360+ * debian/patches/01-poppler-0.18-compat.patch: Make it possible to compile
361+ evince against poppler 0.18 since unstable doesn't have 0.20 yet.
362+ * Lower the Build-Depends on libpoppler-glib-dev to (>= 0.18.0) again for
363+ now.
364+ * Upload to unstable.
365+
366+ -- Michael Biebl <biebl@debian.org> Wed, 28 Aug 2013 01:54:46 +0200
367+
368+evince (3.8.2-1) experimental; urgency=low
369+
370+ * New upstream release.
371+ * debian/evince-common.install,
372+ debian/rules:
373+ + Install the xpm icon from debian/rules.
374 * debian/rules:
375- - install apparmor files
376- - save some space by not shipping the synctex screencast.
377- * debian/patches/11_grip_gestures.patch:
378- - supports pinch to zoom, rotate, and drag gestures
379-
380- -- Sebastien Bacher <seb128@ubuntu.com> Mon, 12 Nov 2012 16:36:53 +0100
381+ + Take advantage of CDBS' flavor support.
382+ + Drop --disable-scrollkeeper, no longer used.
383+ + No need to remove /usr/share/gtk-doc from evince-common, we're
384+ not installing it in the first place.
385+ + Include utils.mk
386+ * debian/evince-gtk.install,
387+ debian/rules:
388+ + Install what we need for evince-gtk from the install file
389+ instead of installing everything and then removing various bits.
390+
391+ -- Emilio Pozuelo Monfort <pochu@debian.org> Sun, 02 Jun 2013 23:37:15 +0200
392+
393+evince (3.8.0-1) experimental; urgency=low
394+
395+ * New upstream release.
396+ + debian/patches/03_nodisplay.patch:
397+ - Dropped, included upstream.
398+
399+ -- Emilio Pozuelo Monfort <pochu@debian.org> Thu, 28 Mar 2013 23:42:03 +0100
400+
401+evince (3.7.90-1) experimental; urgency=low
402+
403+ [ Josselin Mouette ]
404+ * Finally remove evince.mime for good.
405+
406+ [ Andreas Henriksson ]
407+ * New upstream release.
408+ - bump gtk+ build-dependency to >= 3.7.5 according to configure.ac
409+ - also replace libgnome-keyring-dev with libsecret-1-dev (>= 0.5)
410+ * Update debian/libevdocument3-4.symbols:
411+ - dropping (optional)ev_{doc,fc}_mutex@Base 3.3.90
412+ - adding new symbols
413+ * Update debian/libevview3-3.symbols:
414+ - dropping ev_loading_window_{get_size,get_type,move,new}@Base 3.0.2
415+ and ev_view_accessible_factory_get_type@Base 3.0.2
416+ - adding new symbols
417+
418+ -- Andreas Henriksson <andreas@fatal.se> Fri, 15 Mar 2013 18:58:50 +0100
419
420 evince (3.6.1-1) experimental; urgency=low
421
422
423=== modified file 'debian/control.in'
424--- debian/control.in 2014-08-12 21:31:14 +0000
425+++ debian/control.in 2014-09-10 14:34:55 +0000
426@@ -14,16 +14,15 @@
427 gtk-doc-tools (>= 1.0),
428 libx11-dev,
429 libcairo2-dev (>= 1.10.0),
430- libgtk-3-dev (>= 3.8.0),
431+ libgtk-3-dev (>= 3.12.0),
432 libgail-3-dev (>= 3.0.2),
433 libglib2.0-dev (>= 2.36),
434 libsecret-1-dev (>= 0.5),
435 gnome-icon-theme (>= 2.17.1),
436 libxml2-dev (>= 2.5.0),
437- libsm-dev (>= 2:1.0.0),
438 zlib1g-dev,
439 libnautilus-extension-dev (>= 2.91.4),
440- libpoppler-glib-dev (>= 0.24.0),
441+ libpoppler-glib-dev (>= 0.18.0),
442 libspectre-dev (>= 0.2.0),
443 libtiff5-dev | libtiff-dev,
444 libdjvulibre-dev (>= 3.5.17),
445@@ -35,10 +34,11 @@
446 gsettings-desktop-schemas-dev,
447 gnome-common,
448 dh-apparmor,
449- libgrip-dev (>= 0.3.1)
450-Standards-Version: 3.9.3
451+ libgrip-dev (>= 0.3.1),
452+ libgnome-desktop-3-dev
453+Standards-Version: 3.9.4
454 Homepage: http://www.gnome.org/projects/evince/
455-Vcs-Svn: svn://anonscm.debian.org/svn/pkg-gnome/desktop/unstable/evince
456+Vcs-Svn: svn://anonscm.debian.org/pkg-gnome/desktop/unstable/evince
457 Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/evince
458
459 Package: evince
460@@ -50,9 +50,8 @@
461 libevview3-3 (= ${binary:Version}),
462 evince-common (>= ${gnome:Version}),
463 evince-common (<< ${gnome:NextVersion}),
464- gnome-icon-theme (>= 2.17.1),
465- shared-mime-info,
466- gnome-icon-theme-symbolic
467+ gnome-icon-theme-symbolic (>= 2.17.1),
468+ shared-mime-info
469 Recommends: dbus-x11,
470 gvfs
471 Provides: pdf-viewer,
472@@ -98,7 +97,7 @@
473 libevview3-3 (= ${binary:Version}),
474 evince-common (>= ${gnome:Version}),
475 evince-common (<< ${gnome:NextVersion}),
476- gnome-icon-theme (>= 2.17.1),
477+ gnome-icon-theme-symbolic (>= 2.17.1),
478 shared-mime-info
479 Recommends: dbus-x11
480 Provides: pdf-viewer,
481
482=== modified file 'debian/evince-common.install'
483--- debian/evince-common.install 2012-08-22 03:50:38 +0000
484+++ debian/evince-common.install 2014-09-10 14:34:55 +0000
485@@ -1,4 +1,3 @@
486-debian/evince.xpm /usr/share/pixmaps/
487 usr/share/dbus-1
488 usr/share/help
489 usr/share/evince
490
491=== added file 'debian/evince-gtk.install'
492--- debian/evince-gtk.install 1970-01-01 00:00:00 +0000
493+++ debian/evince-gtk.install 2014-09-10 14:34:55 +0000
494@@ -0,0 +1,3 @@
495+# keep in sync with evince.install as needed
496+usr/bin
497+usr/lib/evince/evinced
498
499=== modified file 'debian/evince.install'
500--- debian/evince.install 2011-11-24 16:51:14 +0000
501+++ debian/evince.install 2014-09-10 14:34:55 +0000
502@@ -1,3 +1,4 @@
503+# keep in sync with evince-gtk.install as needed
504 usr/bin
505 usr/lib/nautilus/*/*.so
506 usr/lib/evince/evinced
507
508=== modified file 'debian/libevdocument3-4.symbols'
509--- debian/libevdocument3-4.symbols 2013-09-30 11:45:55 +0000
510+++ debian/libevdocument3-4.symbols 2014-09-10 14:34:55 +0000
511@@ -56,12 +56,13 @@
512 ev_backends_manager_get_document_module_name@Base 3.0.2
513 ev_backends_manager_get_document_type_info@Base 3.0.2
514 ev_compression_type_get_type@Base 3.0.2
515-#MISSING: 3.9.5-0ubuntu1~saucy1# (optional)ev_doc_mutex@Base 3.3.90
516 ev_document_annotations_add_annotation@Base 3.0.2
517 ev_document_annotations_can_add_annotation@Base 3.0.2
518+ ev_document_annotations_can_remove_annotation@Base 3.13.91
519 ev_document_annotations_document_is_modified@Base 3.0.2
520 ev_document_annotations_get_annotations@Base 3.0.2
521 ev_document_annotations_get_type@Base 3.0.2
522+ ev_document_annotations_remove_annotation@Base 3.13.91
523 ev_document_annotations_save_annotation@Base 3.0.2
524 ev_document_attachments_get_attachments@Base 3.0.2
525 ev_document_attachments_get_type@Base 3.0.2
526@@ -85,7 +86,7 @@
527 ev_document_find_get_type@Base 3.0.2
528 ev_document_find_page_by_label@Base 3.0.2
529 ev_document_fonts_fill_model@Base 3.0.2
530- ev_document_fonts_get_fonts_summary@Base 3.7.4
531+ ev_document_fonts_get_fonts_summary@Base 3.7.90
532 ev_document_fonts_get_progress@Base 3.0.2
533 ev_document_fonts_get_type@Base 3.0.2
534 ev_document_fonts_scan@Base 3.0.2
535@@ -114,6 +115,7 @@
536 ev_document_get_page_label@Base 3.0.2
537 ev_document_get_page_size@Base 3.0.2
538 ev_document_get_thumbnail@Base 3.0.2
539+ ev_document_get_thumbnail_surface@Base 3.13.91
540 ev_document_get_title@Base 3.0.2
541 ev_document_get_type@Base 3.0.2
542 ev_document_get_uri@Base 3.0.2
543@@ -165,8 +167,10 @@
544 ev_document_misc_invert_surface@Base 3.0.2
545 ev_document_misc_paint_one_page@Base 3.0.2
546 ev_document_misc_pixbuf_from_surface@Base 3.0.2
547- ev_document_misc_render_loading_thumbnail@Base 3.7.4
548- ev_document_misc_render_thumbnail_with_frame@Base 3.7.4
549+ ev_document_misc_render_loading_thumbnail@Base 3.7.90
550+ ev_document_misc_render_loading_thumbnail_surface@Base 3.13.91
551+ ev_document_misc_render_thumbnail_surface_with_frame@Base 3.13.91
552+ ev_document_misc_render_thumbnail_with_frame@Base 3.7.90
553 ev_document_misc_surface_from_pixbuf@Base 3.0.2
554 ev_document_misc_surface_rotate_and_scale@Base 3.0.2
555 ev_document_mode_get_type@Base 3.0.2
556@@ -181,7 +185,7 @@
557 ev_document_synctex_backward_search@Base 3.0.2
558 ev_document_synctex_forward_search@Base 3.0.2
559 ev_document_text_get_text@Base 3.0.2
560- ev_document_text_get_text_attrs@Base 3.9.5
561+ ev_document_text_get_text_attrs@Base 3.10.0
562 ev_document_text_get_text_layout@Base 3.0.2
563 ev_document_text_get_text_mapping@Base 3.0.2
564 ev_document_text_get_type@Base 3.0.2
565@@ -189,7 +193,6 @@
566 ev_document_transition_get_page_duration@Base 3.0.2
567 ev_document_transition_get_type@Base 3.0.2
568 ev_document_ui_hints_get_type@Base 3.0.2
569-#MISSING: 3.9.5-0ubuntu1~saucy1# (optional)ev_fc_mutex@Base 3.3.90
570 ev_file_compress@Base 3.0.2
571 ev_file_copy_metadata@Base 3.5.2
572 ev_file_exporter_begin@Base 3.0.2
573@@ -275,14 +278,16 @@
574 ev_link_new@Base 3.0.2
575 ev_mapping_list_find@Base 3.0.2
576 ev_mapping_list_find_custom@Base 3.0.2
577+ ev_mapping_list_get@Base 3.11.90
578 ev_mapping_list_get_data@Base 3.0.2
579 ev_mapping_list_get_list@Base 3.0.2
580 ev_mapping_list_get_page@Base 3.0.2
581- ev_mapping_list_get_type@Base 3.7.5
582- ev_mapping_list_length@Base 3.7.5
583+ ev_mapping_list_get_type@Base 3.7.90
584+ ev_mapping_list_length@Base 3.7.90
585 ev_mapping_list_new@Base 3.0.2
586- ev_mapping_list_nth@Base 3.7.5
587+ ev_mapping_list_nth@Base 3.7.90
588 ev_mapping_list_ref@Base 3.0.2
589+ ev_mapping_list_remove@Base 3.13.91
590 ev_mapping_list_unref@Base 3.0.2
591 ev_mkdtemp@Base 3.0.2
592 ev_mkstemp@Base 3.0.2
593@@ -294,11 +299,15 @@
594 ev_rectangle_free@Base 3.0.2
595 ev_rectangle_get_type@Base 3.0.2
596 ev_rectangle_new@Base 3.0.2
597+ ev_render_context_compute_scaled_size@Base 3.13.91
598+ ev_render_context_compute_scales@Base 3.13.91
599+ ev_render_context_compute_transformed_size@Base 3.13.91
600 ev_render_context_get_type@Base 3.0.2
601 ev_render_context_new@Base 3.0.2
602 ev_render_context_set_page@Base 3.0.2
603 ev_render_context_set_rotation@Base 3.0.2
604 ev_render_context_set_scale@Base 3.0.2
605+ ev_render_context_set_target_size@Base 3.13.91
606 ev_selection_get_selected_text@Base 3.0.2
607 ev_selection_get_selection_region@Base 3.0.2
608 ev_selection_get_type@Base 3.0.2
609
610=== modified file 'debian/libevview3-3.symbols'
611--- debian/libevview3-3.symbols 2013-09-30 11:45:55 +0000
612+++ debian/libevview3-3.symbols 2014-09-10 14:34:55 +0000
613@@ -17,7 +17,7 @@
614 ev_document_model_get_max_scale@Base 3.0.2
615 ev_document_model_get_min_scale@Base 3.0.2
616 ev_document_model_get_page@Base 3.0.2
617- ev_document_model_get_page_layout@Base 3.7.4
618+ ev_document_model_get_page_layout@Base 3.7.90
619 ev_document_model_get_rotation@Base 3.0.2
620 ev_document_model_get_scale@Base 3.0.2
621 ev_document_model_get_sizing_mode@Base 3.0.2
622@@ -34,10 +34,16 @@
623 ev_document_model_set_min_scale@Base 3.0.2
624 ev_document_model_set_page@Base 3.0.2
625 ev_document_model_set_page_by_label@Base 3.0.2
626- ev_document_model_set_page_layout@Base 3.7.4
627+ ev_document_model_set_page_layout@Base 3.7.90
628 ev_document_model_set_rotation@Base 3.0.2
629 ev_document_model_set_scale@Base 3.0.2
630 ev_document_model_set_sizing_mode@Base 3.0.2
631+ ev_form_field_accessible_get_field@Base 3.13.91
632+ ev_form_field_accessible_get_type@Base 3.13.91
633+ ev_form_field_accessible_new@Base 3.13.91
634+ ev_form_field_accessible_update_state@Base 3.13.91
635+ ev_image_accessible_get_type@Base 3.13.91
636+ ev_image_accessible_new@Base 3.13.91
637 ev_job_annots_get_type@Base 3.0.2
638 ev_job_annots_new@Base 3.0.2
639 ev_job_attachments_get_type@Base 3.0.2
640@@ -101,30 +107,42 @@
641 ev_job_scheduler_update_job@Base 3.0.2
642 ev_job_set_run_mode@Base 3.0.2
643 ev_job_succeeded@Base 3.0.2
644+ ev_job_thumbnail_format_get_type@Base 3.13.91
645 ev_job_thumbnail_get_type@Base 3.0.2
646 ev_job_thumbnail_new@Base 3.0.2
647- ev_job_thumbnail_set_has_frame@Base 3.7.4
648- ev_link_accessible_get_type@Base 3.7.5
649- ev_link_accessible_new@Base 3.7.5
650+ ev_job_thumbnail_new_with_target_size@Base 3.13.91
651+ ev_job_thumbnail_set_has_frame@Base 3.7.90
652+ ev_job_thumbnail_set_output_format@Base 3.13.91
653+ ev_link_accessible_get_type@Base 3.7.90
654+ ev_link_accessible_new@Base 3.7.90
655+ ev_page_accessible_get_accessible_for_mapping@Base 3.13.91
656+ ev_page_accessible_get_page@Base 3.12.1
657+ ev_page_accessible_get_type@Base 3.12.1
658+ ev_page_accessible_get_view@Base 3.12.1
659+ ev_page_accessible_get_view_accessible@Base 3.12.1
660+ ev_page_accessible_new@Base 3.12.1
661+ ev_page_accessible_update_element_state@Base 3.13.91
662+ ev_page_cache_ensure_page@Base 3.12.1
663 ev_page_cache_get_annot_mapping@Base 3.0.2
664 ev_page_cache_get_flags@Base 3.0.2
665 ev_page_cache_get_form_field_mapping@Base 3.0.2
666 ev_page_cache_get_image_mapping@Base 3.0.2
667 ev_page_cache_get_link_mapping@Base 3.0.2
668 ev_page_cache_get_text@Base 3.0.2
669- ev_page_cache_get_text_attrs@Base 3.9.5
670+ ev_page_cache_get_text_attrs@Base 3.10.0
671 ev_page_cache_get_text_layout@Base 3.0.2
672- ev_page_cache_get_text_log_attrs@Base 3.9.5
673+ ev_page_cache_get_text_log_attrs@Base 3.10.0
674 ev_page_cache_get_text_mapping@Base 3.0.2
675 ev_page_cache_get_type@Base 3.0.2
676+ ev_page_cache_is_page_cached@Base 3.13.91
677 ev_page_cache_mark_dirty@Base 3.0.2
678 ev_page_cache_new@Base 3.0.2
679 ev_page_cache_set_flags@Base 3.0.2
680 ev_page_cache_set_page_range@Base 3.0.2
681- ev_page_layout_get_type@Base 3.7.4
682+ ev_page_layout_get_type@Base 3.7.90
683 ev_pixbuf_cache_clear@Base 3.0.2
684 ev_pixbuf_cache_get_selection_list@Base 3.0.2
685- ev_pixbuf_cache_get_selection_region@Base 3.9.5
686+ ev_pixbuf_cache_get_selection_region@Base 3.10.0
687 ev_pixbuf_cache_get_selection_surface@Base 3.0.2
688 ev_pixbuf_cache_get_surface@Base 3.0.2
689 ev_pixbuf_cache_get_type@Base 3.0.2
690@@ -175,9 +193,15 @@
691 ev_transition_animation_ready@Base 3.0.2
692 ev_transition_animation_set_dest_surface@Base 3.0.2
693 ev_transition_animation_set_origin_surface@Base 3.0.2
694- ev_view_accessible_get_type@Base 3.7.4
695- ev_view_accessible_new@Base 3.7.4
696- ev_view_accessible_set_model@Base 3.9.5
697+ ev_view_accessible_get_n_pages@Base 3.12.1
698+ ev_view_accessible_get_relevant_page@Base 3.12.1
699+ ev_view_accessible_get_type@Base 3.7.90
700+ ev_view_accessible_is_doc_rect_showing@Base 3.13.91
701+ ev_view_accessible_new@Base 3.7.90
702+ ev_view_accessible_set_focused_element@Base 3.13.91
703+ ev_view_accessible_set_model@Base 3.10.0
704+ ev_view_accessible_set_page_range@Base 3.13.91
705+ ev_view_accessible_update_element_state@Base 3.13.91
706 ev_view_autoscroll_start@Base 3.0.2
707 ev_view_autoscroll_stop@Base 3.0.2
708 ev_view_begin_add_annotation@Base 3.0.2
709@@ -191,19 +215,21 @@
710 ev_view_find_changed@Base 3.0.2
711 ev_view_find_next@Base 3.0.2
712 ev_view_find_previous@Base 3.0.2
713+ ev_view_find_restart@Base 3.11.90
714 ev_view_find_search_changed@Base 3.0.2
715 ev_view_find_set_highlight_search@Base 3.0.2
716- ev_view_find_set_result@Base 3.9.5
717+ ev_view_find_set_result@Base 3.10.0
718 ev_view_find_started@Base 3.5.92
719 ev_view_focus_annotation@Base 3.0.2
720+ ev_view_get_allow_links_change_zoom@Base 3.13.91
721 ev_view_get_has_selection@Base 3.0.2
722 ev_view_get_page_extents@Base 3.0.2
723 ev_view_get_type@Base 3.0.2
724 ev_view_handle_link@Base 3.0.2
725 ev_view_hide_cursor@Base 3.0.2
726 ev_view_highlight_forward_search@Base 3.0.2
727- ev_view_is_caret_navigation_enabled@Base 3.9.5
728- ev_view_is_loading@Base 3.7.1
729+ ev_view_is_caret_navigation_enabled@Base 3.10.0
730+ ev_view_is_loading@Base 3.7.90
731 ev_view_new@Base 3.0.2
732 ev_view_next_page@Base 3.0.2
733 ev_view_presentation_get_current_page@Base 3.0.2
734@@ -215,15 +241,16 @@
735 ev_view_presentation_set_rotation@Base 3.0.2
736 ev_view_previous_page@Base 3.0.2
737 ev_view_reload@Base 3.0.2
738+ ev_view_remove_annotation@Base 3.13.91
739 ev_view_scroll@Base 3.0.2
740 ev_view_select_all@Base 3.0.2
741-#MISSING: 3.9.5-0ubuntu1~saucy1# ev_view_selection_mode_get_type@Base 3.0.2
742- ev_view_set_caret_cursor_position@Base 3.9.5
743- ev_view_set_caret_navigation_enabled@Base 3.9.5
744+ ev_view_set_allow_links_change_zoom@Base 3.13.91
745+ ev_view_set_caret_cursor_position@Base 3.10.0
746+ ev_view_set_caret_navigation_enabled@Base 3.10.0
747 ev_view_set_loading@Base 3.0.2
748 ev_view_set_model@Base 3.0.2
749 ev_view_set_page_cache_size@Base 3.0.2
750 ev_view_show_cursor@Base 3.0.2
751- ev_view_supports_caret_navigation@Base 3.9.5
752+ ev_view_supports_caret_navigation@Base 3.10.0
753 ev_view_zoom_in@Base 3.0.2
754 ev_view_zoom_out@Base 3.0.2
755
756=== removed file 'debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch'
757--- debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch 2014-06-03 13:45:25 +0000
758+++ debian/patches/0001-Port-to-GMenuModel-and-add-menu-bar.patch 1970-01-01 00:00:00 +0000
759@@ -1,4679 +0,0 @@
760-From 2e12bde40c4b9b4433caea9015bd63df3907dad2 Mon Sep 17 00:00:00 2001
761-From: Lars Uebernickel <lars.uebernickel@canonical.com>
762-Date: Thu, 30 Jan 2014 15:13:13 +0100
763-Subject: [PATCH 1/2] Port to GMenuModel and add menu bar
764-
765----
766- shell/Makefile.am | 7 +-
767- shell/ev-application.c | 325 ++++++++-
768- shell/ev-application.h | 8 +
769- shell/ev-bookmarks.c | 8 +
770- shell/ev-bookmarks.h | 1 +
771- shell/ev-recent-menu-model.c | 108 +++
772- shell/ev-recent-menu-model.h | 30 +
773- shell/ev-sidebar-bookmarks.c | 32 +-
774- shell/ev-toolbar.c | 164 +++--
775- shell/ev-utils.c | 89 +++
776- shell/ev-utils.h | 7 +
777- shell/ev-window.c | 1498 +++++++++++++-----------------------------
778- shell/ev-window.h | 2 +-
779- shell/evince-appmenu.ui | 10 +
780- shell/evince-ui.xml | 88 ---
781- shell/evince.gresource.xml | 3 +-
782- shell/menus.ui | 188 ++++++
783- shell/traditional-menus.ui | 229 +++++++
784- 18 files changed, 1591 insertions(+), 1206 deletions(-)
785- create mode 100644 shell/ev-recent-menu-model.c
786- create mode 100644 shell/ev-recent-menu-model.h
787- create mode 100644 shell/menus.ui
788- create mode 100644 shell/traditional-menus.ui
789-
790-Index: evince-3.10.3/shell/Makefile.am
791-===================================================================
792---- evince-3.10.3.orig/shell/Makefile.am 2014-04-28 15:33:25.038869346 +0200
793-+++ evince-3.10.3/shell/Makefile.am 2014-04-28 15:33:25.022869346 +0200
794-@@ -75,6 +75,8 @@
795- ev-sidebar-page.h \
796- ev-sidebar-thumbnails.c \
797- ev-sidebar-thumbnails.h \
798-+ ev-recent-menu-model.c \
799-+ ev-recent-menu-model.h \
800- main.c
801-
802- nodist_evince_SOURCES = \
803-@@ -172,12 +174,13 @@
804-
805- EXTRA_DIST = \
806- evince.css \
807-- evince-appmenu.ui \
808- evince-icon.rc \
809- evince-ui.xml \
810- evince.gresource.xml \
811- ev-gdbus.xml \
812-- ev-daemon-gdbus.xml
813-+ ev-daemon-gdbus.xml \
814-+ menus.ui \
815-+ traditional-menus.ui
816-
817- ev-resources.c: evince.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/evince.gresource.xml)
818- $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate-source --c-name ev $<
819-Index: evince-3.10.3/shell/ev-application.c
820-===================================================================
821---- evince-3.10.3.orig/shell/ev-application.c 2014-04-28 15:33:25.038869346 +0200
822-+++ evince-3.10.3/shell/ev-application.c 2014-04-28 15:33:30.000000000 +0200
823-@@ -42,6 +42,9 @@
824- #include "ev-application.h"
825- #include "ev-file-helpers.h"
826- #include "ev-stock-icons.h"
827-+#include "ev-utils.h"
828-+#include "ev-document-factory.h"
829-+#include "ev-recent-menu-model.h"
830-
831- #ifdef ENABLE_DBUS
832- #include "ev-gdbus-generated.h"
833-@@ -54,6 +57,8 @@
834- gchar *uri;
835-
836- gchar *dot_dir;
837-+ GSettings *settings;
838-+ GMenu *bookmarks_menu;
839-
840- #ifdef ENABLE_DBUS
841- EvEvinceApplication *skeleton;
842-@@ -1028,15 +1033,118 @@
843- }
844-
845- static void
846-+app_about_cb (GSimpleAction *action,
847-+ GVariant *parameter,
848-+ gpointer user_data)
849-+{
850-+ EvApplication *application = user_data;
851-+
852-+ ev_application_show_about (application);
853-+}
854-+
855-+static void
856-+app_open_cb (GSimpleAction *action,
857-+ GVariant *parameter,
858-+ gpointer user_data)
859-+{
860-+ EvApplication *application = user_data;
861-+
862-+ ev_application_open (application);
863-+}
864-+
865-+static void
866-+app_open_file_cb (GSimpleAction *action,
867-+ GVariant *parameter,
868-+ gpointer user_data)
869-+{
870-+ EvApplication *application = user_data;
871-+
872-+ ev_application_open_uri_at_dest (application, g_variant_get_string (parameter, NULL),
873-+ gdk_screen_get_default (), NULL, 0, NULL,
874-+ GDK_CURRENT_TIME);
875-+}
876-+
877-+static void
878-+ev_application_dispose (GObject *object)
879-+{
880-+ EvApplication *app = EV_APPLICATION (object);
881-+
882-+ g_clear_object (&app->settings);
883-+
884-+ G_OBJECT_CLASS (ev_application_parent_class)->dispose (object);
885-+}
886-+
887-+static void
888-+ev_application_update_bookmarks_menu (EvApplication *application)
889-+{
890-+ GtkWindow *window;
891-+
892-+ /* The bookmarks menu has two sections: the first one contains
893-+ * the "Add Bookmark" menu item and the second one is filled
894-+ * with the active window's bookmarks.
895-+ */
896-+
897-+ if (g_menu_model_get_n_items (G_MENU_MODEL (application->bookmarks_menu)) == 2)
898-+ g_menu_remove (application->bookmarks_menu, 1);
899-+
900-+ window = gtk_application_get_active_window (GTK_APPLICATION (application));
901-+ if (window) {
902-+ g_menu_append_section (application->bookmarks_menu, NULL,
903-+ ev_window_get_bookmarks_menu (EV_WINDOW (window)));
904-+ }
905-+}
906-+
907-+static void
908- ev_application_startup (GApplication *gapplication)
909- {
910- const GActionEntry app_menu_actions[] = {
911-+ { "open", app_open_cb, NULL, NULL, NULL },
912-+ { "open-file", app_open_file_cb, "s", NULL, NULL },
913-+ { "about", app_about_cb, NULL, NULL, NULL },
914- { "help", app_help_cb, NULL, NULL, NULL },
915- };
916-
917-+ const gchar *action_accels[] = {
918-+ "app.open", "<Ctrl>O", NULL,
919-+ "win.open-copy", "<Ctrl>N", NULL,
920-+ "win.save-copy", "<Ctrl>S", NULL,
921-+ "win.print", "<Ctrl>P", NULL,
922-+ "win.copy", "<Ctrl>C", "<Ctrl>Insert", NULL,
923-+ "win.select-all", "<Ctrl>A", NULL,
924-+ "win.save-settings", "<Ctrl>T", NULL,
925-+ "win.go-first-page", "<Ctrl>Home", NULL,
926-+ "win.go-last-page", "<Ctrl>End", NULL,
927-+ "win.add-bookmark", "<Ctrl>D", NULL,
928-+ "win.close", "<Ctrl>W", NULL,
929-+ "win.escape", "Escape", NULL,
930-+ "win.find", "<Ctrl>F", "slash", NULL,
931-+ "win.find-next", "<Ctrl>G", NULL,
932-+ "win.find-previous", "<Ctrl><Shift>G", NULL,
933-+ "win.select-page", "<Ctrl>L", NULL,
934-+ "win.go-backward", "<Shift>Page_Up", NULL,
935-+ "win.go-forward", "<Shift>Page_Down", NULL,
936-+ "win.go-next-page", "<Ctrl>Page_Down", "n", NULL,
937-+ "win.go-previous-page", "<Ctrl>Page_Up", "p", NULL,
938-+ "win.sizing-mode::fit-page", "f", NULL,
939-+ "win.sizing-mode::fit-width", "w", NULL,
940-+ "win.open-menu", "F10", NULL,
941-+ "win.caret-navigation", "F7", NULL,
942-+ "win.zoom-in", "plus", "<Ctrl>plus", "KP_Add", "<Ctrl>KP_Add", "equal", NULL,
943-+ "win.zoom-out", "minus", "<Ctrl>minus", "KP_Subtract", "<Ctrl>KP_Subtract", NULL,
944-+ "win.show-side-pane", "F9", NULL,
945-+ "win.fullscreen", "F11", NULL,
946-+ "win.presentation", "F5", NULL,
947-+ "win.rotate-left", "<Ctrl>Left", NULL,
948-+ "win.rotate-right", "<Ctrl>Right", NULL,
949-+ "win.inverted-colors", "<Ctrl>I", NULL,
950-+ "win.reload", "<Ctrl>R", NULL,
951-+ NULL
952-+ };
953-+
954- EvApplication *application = EV_APPLICATION (gapplication);
955- GtkBuilder *builder;
956- GError *error = NULL;
957-+ const gchar **it;
958-
959- G_APPLICATION_CLASS (ev_application_parent_class)->startup (gapplication);
960-
961-@@ -1045,12 +1153,49 @@
962- application);
963-
964- builder = gtk_builder_new ();
965-- gtk_builder_add_from_resource (builder, "/org/gnome/evince/shell/ui/appmenu.ui", &error);
966-- g_assert_no_error (error);
967-
968-- gtk_application_set_app_menu (GTK_APPLICATION (application),
969-- G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu")));
970-+ if (ev_application_has_traditional_menus (application))
971-+ {
972-+ GMenu *recent_section;
973-+ GMenuModel *recent_menu_model;
974-+
975-+ gtk_builder_add_from_resource (builder, "/org/gnome/evince/shell/ui/traditional-menus.ui", &error);
976-+ g_assert_no_error (error);
977-+
978-+ gtk_application_set_menubar (GTK_APPLICATION (application),
979-+ G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
980-+
981-+ recent_menu_model = ev_recent_menu_model_new (gtk_recent_manager_get_default (),
982-+ "app.open-file",
983-+ g_get_application_name ());
984-+
985-+ recent_section = G_MENU (gtk_builder_get_object (builder, "recent"));
986-+ g_menu_append_section (recent_section, NULL, recent_menu_model);
987-+
988-+ application->bookmarks_menu = G_MENU (gtk_builder_get_object (builder, "bookmarks"));
989-+ g_signal_connect_swapped (application, "notify::active-window",
990-+ G_CALLBACK (ev_application_update_bookmarks_menu), application);
991-+ ev_application_update_bookmarks_menu (application);
992-+
993-+ g_object_unref (recent_menu_model);
994-+ }
995-+ else
996-+ {
997-+ gtk_builder_add_from_resource (builder, "/org/gnome/evince/shell/ui/menus.ui", &error);
998-+ g_assert_no_error (error);
999-+
1000-+ gtk_application_set_app_menu (GTK_APPLICATION (application),
1001-+ G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu")));
1002-+ }
1003-+
1004- g_object_unref (builder);
1005-+
1006-+ it = action_accels;
1007-+ while (it[0])
1008-+ {
1009-+ gtk_application_set_accels_for_action (GTK_APPLICATION (application), it[0], &it[1]);
1010-+ it += g_strv_length ((gchar **) it) + 1;
1011-+ }
1012- }
1013-
1014- static void
1015-@@ -1155,8 +1300,11 @@
1016- static void
1017- ev_application_class_init (EvApplicationClass *ev_application_class)
1018- {
1019-+ GObjectClass *object_class = G_OBJECT_CLASS (ev_application_class);
1020- GApplicationClass *g_application_class = G_APPLICATION_CLASS (ev_application_class);
1021-
1022-+ object_class->dispose = ev_application_dispose;
1023-+
1024- g_application_class->startup = ev_application_startup;
1025- g_application_class->activate = ev_application_activate;
1026- g_application_class->shutdown = ev_application_shutdown;
1027-@@ -1175,6 +1323,8 @@
1028- if (!g_file_test (ev_application->dot_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
1029- ev_application_migrate_config_dir (ev_application);
1030-
1031-+ ev_application->settings = g_settings_new ("org.gnome.Evince");
1032-+
1033- ev_application_init_session (ev_application);
1034-
1035- ev_application_accel_map_load (ev_application);
1036-@@ -1274,3 +1424,170 @@
1037- gtk_show_uri (screen, uri, gtk_get_current_event_time (), NULL);
1038- g_free (uri);
1039- }
1040-+
1041-+/**
1042-+ * ev_application_show_about:
1043-+ * @application: an #EvApplication
1044-+ *
1045-+ * Shows an about dialog for @application with the most recently
1046-+ * focussed window as transient parent.
1047-+ */
1048-+void
1049-+ev_application_show_about (EvApplication *application)
1050-+{
1051-+ const char *authors[] = {
1052-+ "Martin Kretzschmar <m_kretzschmar@gmx.net>",
1053-+ "Jonathan Blandford <jrb@gnome.org>",
1054-+ "Marco Pesenti Gritti <marco@gnome.org>",
1055-+ "Nickolay V. Shmyrev <nshmyrev@yandex.ru>",
1056-+ "Bryan Clark <clarkbw@gnome.org>",
1057-+ "Carlos Garcia Campos <carlosgc@gnome.org>",
1058-+ "Wouter Bolsterlee <wbolster@gnome.org>",
1059-+ "Christian Persch <chpe" "\100" "gnome.org>",
1060-+ NULL
1061-+ };
1062-+
1063-+ const char *documenters[] = {
1064-+ "Nickolay V. Shmyrev <nshmyrev@yandex.ru>",
1065-+ "Phil Bull <philbull@gmail.com>",
1066-+ "Tiffany Antpolski <tiffany.antopolski@gmail.com>",
1067-+ NULL
1068-+ };
1069-+
1070-+ const char *license[] = {
1071-+ N_("Evince is free software; you can redistribute it and/or modify "
1072-+ "it under the terms of the GNU General Public License as published by "
1073-+ "the Free Software Foundation; either version 2 of the License, or "
1074-+ "(at your option) any later version.\n"),
1075-+ N_("Evince is distributed in the hope that it will be useful, "
1076-+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "
1077-+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
1078-+ "GNU General Public License for more details.\n"),
1079-+ N_("You should have received a copy of the GNU General Public License "
1080-+ "along with Evince; if not, write to the Free Software Foundation, Inc., "
1081-+ "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n")
1082-+ };
1083-+
1084-+ char *license_trans;
1085-+
1086-+#ifdef ENABLE_NLS
1087-+ const char **p;
1088-+
1089-+ for (p = authors; *p; ++p)
1090-+ *p = _(*p);
1091-+
1092-+ for (p = documenters; *p; ++p)
1093-+ *p = _(*p);
1094-+#endif
1095-+
1096-+ license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n",
1097-+ _(license[2]), "\n", NULL);
1098-+
1099-+ gtk_show_about_dialog (
1100-+ gtk_application_get_active_window (GTK_APPLICATION (application)),
1101-+ "name", _("Evince"),
1102-+ "version", VERSION,
1103-+ "copyright",
1104-+ _("© 1996–2012 The Evince authors"),
1105-+ "license", license_trans,
1106-+ "website", "http://www.gnome.org/projects/evince",
1107-+ "authors", authors,
1108-+ "documenters", documenters,
1109-+ "translator-credits", _("translator-credits"),
1110-+ "logo-icon-name", "evince",
1111-+ "wrap-license", TRUE,
1112-+ NULL);
1113-+
1114-+ g_free (license_trans);
1115-+}
1116-+
1117-+static void
1118-+ev_application_open_dialog_response (GtkWidget *chooser,
1119-+ gint response_id,
1120-+ gpointer user_data)
1121-+{
1122-+ if (response_id == GTK_RESPONSE_OK) {
1123-+ GSList *uris;
1124-+
1125-+ ev_file_chooser_save_folder (GTK_FILE_CHOOSER (chooser),
1126-+ G_USER_DIRECTORY_DOCUMENTS);
1127-+
1128-+ uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
1129-+
1130-+ ev_application_open_uri_list (EV_APP, uris,
1131-+ gtk_widget_get_screen (chooser),
1132-+ gtk_get_current_event_time ());
1133-+
1134-+ g_slist_foreach (uris, (GFunc)g_free, NULL);
1135-+ g_slist_free (uris);
1136-+ }
1137-+
1138-+ gtk_widget_destroy (chooser);
1139-+}
1140-+
1141-+/**
1142-+ * ev_application_open:
1143-+ * @application: an #EvApplication
1144-+ *
1145-+ * Shows an open dialog and opens the chosen document(s) in new windows.
1146-+ *
1147-+ * The dialog's parent will be the most recently focussed window of
1148-+ * @application.
1149-+ */
1150-+void
1151-+ev_application_open (EvApplication *application)
1152-+{
1153-+ GtkWidget *chooser;
1154-+ GtkWindow *active_window;
1155-+
1156-+ active_window = gtk_application_get_active_window (GTK_APPLICATION (application));
1157-+
1158-+ chooser = gtk_file_chooser_dialog_new (_("Open Document"),
1159-+ active_window,
1160-+ GTK_FILE_CHOOSER_ACTION_OPEN,
1161-+ _("Cancel"), GTK_RESPONSE_CANCEL,
1162-+ _("Open"), GTK_RESPONSE_OK,
1163-+ NULL);
1164-+
1165-+ ev_document_factory_add_filters (chooser, NULL);
1166-+ gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), TRUE);
1167-+ gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), FALSE);
1168-+
1169-+ ev_file_chooser_restore_folder (GTK_FILE_CHOOSER (chooser),
1170-+ NULL, G_USER_DIRECTORY_DOCUMENTS);
1171-+
1172-+ g_signal_connect (chooser, "response",
1173-+ G_CALLBACK (ev_application_open_dialog_response), NULL);
1174-+
1175-+ gtk_widget_show (chooser);
1176-+}
1177-+
1178-+GSettings *
1179-+ev_application_get_settings (EvApplication *application)
1180-+{
1181-+ g_return_val_if_fail (EV_IS_APPLICATION (application), NULL);
1182-+
1183-+ return application->settings;
1184-+}
1185-+
1186-+gboolean
1187-+ev_application_has_traditional_menus (EvApplication *application)
1188-+{
1189-+ GdkDisplay *display;
1190-+ GdkScreen *screen;
1191-+ GtkSettings *settings;
1192-+ gboolean show_app_menu;
1193-+ gboolean show_menubar;
1194-+
1195-+ g_return_val_if_fail (EV_IS_APPLICATION (application), FALSE);
1196-+
1197-+ display = gdk_display_get_default ();
1198-+ screen = gdk_display_get_default_screen (display);
1199-+ settings = gtk_settings_get_for_screen (screen);
1200-+ g_object_get (G_OBJECT (settings),
1201-+ "gtk-shell-shows-app-menu", &show_app_menu,
1202-+ "gtk-shell-shows-menubar", &show_menubar,
1203-+ NULL);
1204-+
1205-+ return !show_app_menu || show_menubar;
1206-+}
1207-Index: evince-3.10.3/shell/ev-application.h
1208-===================================================================
1209---- evince-3.10.3.orig/shell/ev-application.h 2014-04-28 15:33:25.038869346 +0200
1210-+++ evince-3.10.3/shell/ev-application.h 2014-04-28 15:33:25.022869346 +0200
1211-@@ -81,6 +81,14 @@
1212- GdkScreen *screen,
1213- const char *topic);
1214-
1215-+void ev_application_show_about (EvApplication *application);
1216-+
1217-+void ev_application_open (EvApplication *application);
1218-+
1219-+GSettings * ev_application_get_settings (EvApplication *application);
1220-+
1221-+gboolean ev_application_has_traditional_menus (EvApplication *application);
1222-+
1223- G_END_DECLS
1224-
1225- #endif /* !EV_APPLICATION_H */
1226-Index: evince-3.10.3/shell/ev-bookmarks.c
1227-===================================================================
1228---- evince-3.10.3.orig/shell/ev-bookmarks.c 2014-04-28 15:33:25.038869346 +0200
1229-+++ evince-3.10.3/shell/ev-bookmarks.c 2014-04-28 15:33:25.026869346 +0200
1230-@@ -224,6 +224,14 @@
1231- return g_list_copy (bookmarks->items);
1232- }
1233-
1234-+gboolean
1235-+ev_bookmarks_has_bookmarks (EvBookmarks *bookmarks)
1236-+{
1237-+ g_return_val_if_fail (EV_IS_BOOKMARKS (bookmarks), NULL);
1238-+
1239-+ return bookmarks->items != NULL;
1240-+}
1241-+
1242- void
1243- ev_bookmarks_add (EvBookmarks *bookmarks,
1244- EvBookmark *bookmark)
1245-Index: evince-3.10.3/shell/ev-bookmarks.h
1246-===================================================================
1247---- evince-3.10.3.orig/shell/ev-bookmarks.h 2014-04-28 15:33:25.038869346 +0200
1248-+++ evince-3.10.3/shell/ev-bookmarks.h 2014-04-28 15:33:25.026869346 +0200
1249-@@ -43,6 +43,7 @@
1250- GType ev_bookmarks_get_type (void) G_GNUC_CONST;
1251- EvBookmarks *ev_bookmarks_new (EvMetadata *metadata);
1252- GList *ev_bookmarks_get_bookmarks (EvBookmarks *bookmarks);
1253-+gboolean ev_bookmarks_has_bookmarks (EvBookmarks *bookmarks);
1254- void ev_bookmarks_add (EvBookmarks *bookmarks,
1255- EvBookmark *bookmark);
1256- void ev_bookmarks_delete (EvBookmarks *bookmarks,
1257-Index: evince-3.10.3/shell/ev-recent-menu-model.c
1258-===================================================================
1259---- /dev/null 1970-01-01 00:00:00.000000000 +0000
1260-+++ evince-3.10.3/shell/ev-recent-menu-model.c 2014-04-28 15:33:25.026869346 +0200
1261-@@ -0,0 +1,108 @@
1262-+/*
1263-+ * Copyright 2014 Canonical Ltd
1264-+ *
1265-+ * Evince is free software; you can redistribute it and/or modify it
1266-+ * under the terms of the GNU General Public License as published by
1267-+ * the Free Software Foundation; either version 2 of the License, or
1268-+ * (at your option) any later version.
1269-+ *
1270-+ * Evince is distributed in the hope that it will be useful, but
1271-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
1272-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1273-+ * General Public License for more details.
1274-+ *
1275-+ * You should have received a copy of the GNU General Public License
1276-+ * along with this program; if not, write to the Free Software
1277-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1278-+ *
1279-+ * Author: Lars Uebernickel <lars.uebernickel@canonical.com>
1280-+ */
1281-+
1282-+#include "ev-recent-menu-model.h"
1283-+
1284-+typedef struct
1285-+{
1286-+ GMenu *menu;
1287-+ GtkRecentManager *manager;
1288-+ gchar *action_name;
1289-+ gchar *application;
1290-+} EvRecentMenuModel;
1291-+
1292-+static void
1293-+ev_recent_menu_model_update (GtkRecentManager *manager,
1294-+ gpointer data)
1295-+{
1296-+ EvRecentMenuModel *recent_menu = data;
1297-+ GList *items, *it;
1298-+ guint n_items = 0;
1299-+
1300-+ g_menu_remove_all (recent_menu->menu);
1301-+
1302-+ items = gtk_recent_manager_get_items (recent_menu->manager);
1303-+
1304-+ for (it = items; it && n_items < 5; it = it->next)
1305-+ {
1306-+ GtkRecentInfo *info = it->data;
1307-+ gchar *label;
1308-+ GIcon *icon;
1309-+ GMenuItem *item;
1310-+
1311-+ if (!gtk_recent_info_has_application (info, recent_menu->application))
1312-+ continue;
1313-+
1314-+ label = g_strdup_printf ("_%d. %s", n_items + 1, gtk_recent_info_get_display_name (info));
1315-+
1316-+ item = g_menu_item_new (label, NULL);
1317-+ g_menu_item_set_action_and_target (item, recent_menu->action_name,
1318-+ "s", gtk_recent_info_get_uri (info));
1319-+
1320-+ icon = gtk_recent_info_get_gicon (info);
1321-+ if (icon)
1322-+ {
1323-+ g_menu_item_set_icon (item, icon);
1324-+ g_object_unref (icon);
1325-+ }
1326-+
1327-+ g_menu_append_item (recent_menu->menu, item);
1328-+
1329-+ g_free (label);
1330-+ g_object_unref (item);
1331-+
1332-+ n_items++;
1333-+ }
1334-+
1335-+ g_list_free_full (items, (GDestroyNotify) gtk_recent_info_unref);
1336-+}
1337-+
1338-+static void
1339-+ev_recent_menu_model_destroy (gpointer data,
1340-+ GObject *menu)
1341-+{
1342-+ EvRecentMenuModel *recent_menu = data;
1343-+
1344-+ g_signal_handlers_disconnect_by_func (recent_menu->manager, ev_recent_menu_model_update, recent_menu);
1345-+ g_object_unref (recent_menu->manager);
1346-+ g_free (recent_menu->application);
1347-+ g_free (recent_menu->action_name);
1348-+
1349-+ g_slice_free (EvRecentMenuModel, recent_menu);
1350-+}
1351-+
1352-+GMenuModel *
1353-+ev_recent_menu_model_new (GtkRecentManager *manager,
1354-+ const gchar *action_name,
1355-+ const gchar *application)
1356-+{
1357-+ EvRecentMenuModel *recent_menu;
1358-+
1359-+ recent_menu = g_slice_new0 (EvRecentMenuModel);
1360-+ recent_menu->menu = g_menu_new ();
1361-+ recent_menu->manager = g_object_ref (manager);
1362-+ recent_menu->action_name = g_strdup (action_name);
1363-+ recent_menu->application = g_strdup (application);
1364-+
1365-+ g_object_weak_ref (G_OBJECT (recent_menu->menu), ev_recent_menu_model_destroy, recent_menu);
1366-+ g_signal_connect (manager, "changed", G_CALLBACK (ev_recent_menu_model_update), recent_menu);
1367-+
1368-+ return G_MENU_MODEL (recent_menu->menu);
1369-+}
1370-Index: evince-3.10.3/shell/ev-recent-menu-model.h
1371-===================================================================
1372---- /dev/null 1970-01-01 00:00:00.000000000 +0000
1373-+++ evince-3.10.3/shell/ev-recent-menu-model.h 2014-04-28 15:33:25.026869346 +0200
1374-@@ -0,0 +1,30 @@
1375-+/*
1376-+ * Copyright 2014 Canonical Ltd
1377-+ *
1378-+ * Evince is free software; you can redistribute it and/or modify it
1379-+ * under the terms of the GNU General Public License as published by
1380-+ * the Free Software Foundation; either version 2 of the License, or
1381-+ * (at your option) any later version.
1382-+ *
1383-+ * Evince is distributed in the hope that it will be useful, but
1384-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
1385-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1386-+ * General Public License for more details.
1387-+ *
1388-+ * You should have received a copy of the GNU General Public License
1389-+ * along with this program; if not, write to the Free Software
1390-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1391-+ *
1392-+ * Author: Lars Uebernickel <lars.uebernickel@canonical.com>
1393-+ */
1394-+
1395-+#ifndef EV_RECENT_MENU_MODEL_H
1396-+#define EV_RECENT_MENU_MODEL_H
1397-+
1398-+#include <gtk/gtk.h>
1399-+
1400-+GMenuModel * ev_recent_menu_model_new (GtkRecentManager *manager,
1401-+ const gchar *action_name,
1402-+ const gchar *application);
1403-+
1404-+#endif
1405-Index: evince-3.10.3/shell/ev-sidebar-bookmarks.c
1406-===================================================================
1407---- evince-3.10.3.orig/shell/ev-sidebar-bookmarks.c 2014-04-28 15:33:25.038869346 +0200
1408-+++ evince-3.10.3/shell/ev-sidebar-bookmarks.c 2014-04-28 15:33:25.026869346 +0200
1409-@@ -40,11 +40,6 @@
1410- N_COLUMNS
1411- };
1412-
1413--enum {
1414-- ADD_BOOKMARK,
1415-- N_SIGNALS
1416--};
1417--
1418- struct _EvSidebarBookmarksPrivate {
1419- EvDocumentModel *model;
1420- EvBookmarks *bookmarks;
1421-@@ -68,8 +63,6 @@
1422- G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE,
1423- ev_sidebar_bookmarks_page_iface_init))
1424-
1425--static guint signals[N_SIGNALS];
1426--
1427- static const gchar popup_menu_ui[] =
1428- "<popup name=\"BookmarksPopup\" action=\"BookmarksPopupAction\">\n"
1429- " <menuitem name=\"OpenBookmark\" action=\"OpenBookmark\"/>\n"
1430-@@ -224,16 +217,6 @@
1431- }
1432-
1433- static void
1434--ev_sidebar_bookmarks_add_clicked (GtkWidget *button,
1435-- EvSidebarBookmarks *sidebar_bookmarks)
1436--{
1437-- /* Let the window add the bookmark since
1438-- * since we don't know the page title
1439-- */
1440-- g_signal_emit (sidebar_bookmarks, signals[ADD_BOOKMARK], 0);
1441--}
1442--
1443--static void
1444- ev_sidebar_bookmarks_del_clicked (GtkWidget *button,
1445- EvSidebarBookmarks *sidebar_bookmarks)
1446- {
1447-@@ -469,9 +452,8 @@
1448- hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
1449-
1450- priv->add_button = gtk_button_new_from_stock (GTK_STOCK_ADD);
1451-- g_signal_connect (priv->add_button, "clicked",
1452-- G_CALLBACK (ev_sidebar_bookmarks_add_clicked),
1453-- sidebar_bookmarks);
1454-+ gtk_actionable_set_action_name (GTK_ACTIONABLE (priv->add_button),
1455-+ "win.add-bookmark");
1456- gtk_widget_set_sensitive (priv->add_button, FALSE);
1457- gtk_box_pack_start (GTK_BOX (hbox), priv->add_button, TRUE, TRUE, 6);
1458- gtk_widget_show (priv->add_button);
1459-@@ -534,16 +516,6 @@
1460- g_type_class_add_private (g_object_class, sizeof (EvSidebarBookmarksPrivate));
1461-
1462- g_object_class_override_property (g_object_class, PROP_WIDGET, "main-widget");
1463--
1464-- signals[ADD_BOOKMARK] =
1465-- g_signal_new ("add-bookmark",
1466-- G_TYPE_FROM_CLASS (g_object_class),
1467-- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
1468-- G_STRUCT_OFFSET (EvSidebarBookmarksClass, add_bookmark),
1469-- NULL, NULL,
1470-- g_cclosure_marshal_VOID__VOID,
1471-- G_TYPE_NONE, 0,
1472-- G_TYPE_NONE);
1473- }
1474-
1475- GtkWidget *
1476-Index: evince-3.10.3/shell/ev-toolbar.c
1477-===================================================================
1478---- evince-3.10.3.orig/shell/ev-toolbar.c 2014-04-28 15:33:25.038869346 +0200
1479-+++ evince-3.10.3/shell/ev-toolbar.c 2014-04-28 15:33:25.026869346 +0200
1480-@@ -24,9 +24,12 @@
1481-
1482- #include "ev-toolbar.h"
1483-
1484-+#include <glib/gi18n.h>
1485- #include "ev-stock-icons.h"
1486- #include "ev-zoom-action.h"
1487- #include "ev-history-action.h"
1488-+#include "ev-application.h"
1489-+#include "ev-recent-menu-model.h"
1490- #include <math.h>
1491-
1492- enum
1493-@@ -40,6 +43,7 @@
1494-
1495- GtkWidget *view_menu_button;
1496- GtkWidget *action_menu_button;
1497-+ GMenu *bookmarks_section;
1498- };
1499-
1500- G_DEFINE_TYPE (EvToolbar, ev_toolbar, GTK_TYPE_TOOLBAR)
1501-@@ -62,38 +66,49 @@
1502- }
1503-
1504- static void
1505--ev_toolbar_set_button_action (EvToolbar *ev_toolbar,
1506-- GtkButton *button,
1507-- GtkAction *action)
1508-+ev_toolbar_set_button_action (EvToolbar *ev_toolbar,
1509-+ GtkButton *button,
1510-+ const gchar *action_name,
1511-+ const gchar *tooltip)
1512- {
1513-- gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
1514-+ gtk_actionable_set_action_name (GTK_ACTIONABLE (button), action_name);
1515- gtk_button_set_label (button, NULL);
1516- gtk_button_set_focus_on_click (button, FALSE);
1517-- gtk_widget_set_tooltip_text (GTK_WIDGET (button), gtk_action_get_tooltip (action));
1518-+ gtk_widget_set_tooltip_text (GTK_WIDGET (button), tooltip);
1519- }
1520-
1521- static GtkWidget *
1522--ev_toolbar_create_button (EvToolbar *ev_toolbar,
1523-- GtkAction *action)
1524-+ev_toolbar_create_button (EvToolbar *ev_toolbar,
1525-+ const gchar *action_name,
1526-+ const gchar *icon_name,
1527-+ const gchar *tooltip)
1528- {
1529- GtkWidget *button = gtk_button_new ();
1530-+ GtkWidget *image;
1531-+
1532-+ image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
1533-
1534- gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
1535-- gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
1536-- ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
1537-+ gtk_button_set_image (GTK_BUTTON (button), image);
1538-+ ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action_name, tooltip);
1539-
1540- return button;
1541- }
1542-
1543- static GtkWidget *
1544- ev_toolbar_create_toggle_button (EvToolbar *ev_toolbar,
1545-- GtkAction *action)
1546-+ const gchar *action_name,
1547-+ const gchar *icon_name,
1548-+ const gchar *tooltip)
1549- {
1550- GtkWidget *button = gtk_toggle_button_new ();
1551-+ GtkWidget *image;
1552-+
1553-+ image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
1554-
1555- gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
1556-- gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
1557-- ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
1558-+ gtk_button_set_image (GTK_BUTTON (button), image);
1559-+ ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action_name, tooltip);
1560-
1561- return button;
1562- }
1563-@@ -101,17 +116,21 @@
1564- static GtkWidget *
1565- ev_toolbar_create_menu_button (EvToolbar *ev_toolbar,
1566- const gchar *icon_name,
1567-- GtkWidget *menu,
1568-+ GMenuModel *menu,
1569- GtkAlign menu_align)
1570- {
1571-- GtkWidget *button = gtk_menu_button_new ();
1572-+ GtkWidget *button;
1573-+ GtkMenu *popup;
1574-
1575-+ button = gtk_menu_button_new ();
1576- gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
1577- gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
1578- gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON (button))),
1579- icon_name, GTK_ICON_SIZE_MENU);
1580-- gtk_widget_set_halign (menu, menu_align);
1581-- gtk_menu_button_set_popup (GTK_MENU_BUTTON (button), menu);
1582-+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
1583-+
1584-+ popup = gtk_menu_button_get_popup (GTK_MENU_BUTTON (button));
1585-+ gtk_widget_set_halign (GTK_WIDGET (popup), menu_align);
1586-
1587- return button;
1588- }
1589-@@ -132,16 +151,39 @@
1590- }
1591-
1592- static void
1593-+ev_toolbar_update_bookmarks (EvToolbar *toolbar)
1594-+{
1595-+ GMenu *bookmarks_section;
1596-+ GMenuModel *bookmarks_submenu;
1597-+
1598-+ /* The bookmarks section has one or two items: "Add Bookmark"
1599-+ * and the "Bookmarks" submenu item. Hide the latter when there
1600-+ * are no bookmarks.
1601-+ */
1602-+
1603-+ bookmarks_section = toolbar->priv->bookmarks_section;
1604-+ bookmarks_submenu = ev_window_get_bookmarks_menu (toolbar->priv->window);
1605-+
1606-+ if (g_menu_model_get_n_items (bookmarks_submenu) > 0) {
1607-+ if (g_menu_model_get_n_items (G_MENU_MODEL (bookmarks_section)) == 1)
1608-+ g_menu_append_submenu (bookmarks_section, _("Bookmarks"), bookmarks_submenu);
1609-+ }
1610-+ else {
1611-+ if (g_menu_model_get_n_items (G_MENU_MODEL (bookmarks_section)) == 2)
1612-+ g_menu_remove (bookmarks_section, 1);
1613-+ }
1614-+}
1615-+
1616-+static void
1617- ev_toolbar_constructed (GObject *object)
1618- {
1619- EvToolbar *ev_toolbar = EV_TOOLBAR (object);
1620-- GtkUIManager *ui_manager;
1621- GtkActionGroup *action_group;
1622- GtkWidget *tool_item;
1623- GtkWidget *hbox;
1624- GtkAction *action;
1625- GtkWidget *button;
1626-- GtkWidget *menu;
1627-+ GMenuModel *menu;
1628-
1629- G_OBJECT_CLASS (ev_toolbar_parent_class)->constructed (object);
1630-
1631-@@ -151,18 +193,17 @@
1632- GTK_STYLE_CLASS_MENUBAR);
1633-
1634- action_group = ev_window_get_main_action_group (ev_toolbar->priv->window);
1635-- ui_manager = ev_window_get_ui_manager (ev_toolbar->priv->window);
1636-
1637- /* Navigation */
1638- hbox = ev_toolbar_create_button_group (ev_toolbar);
1639-
1640-- action = gtk_action_group_get_action (action_group, "GoPreviousPage");
1641-- button = ev_toolbar_create_button (ev_toolbar, action);
1642-+ button = ev_toolbar_create_button (ev_toolbar, "win.go-previous-page",
1643-+ "go-up-symbolic", _("Go to the previous page"));
1644- gtk_container_add (GTK_CONTAINER (hbox), button);
1645- gtk_widget_show (button);
1646-
1647-- action = gtk_action_group_get_action (action_group, "GoNextPage");
1648-- button = ev_toolbar_create_button (ev_toolbar, action);
1649-+ button = ev_toolbar_create_button (ev_toolbar, "win.go-next-page",
1650-+ "go-down-symbolic", _("Go to the next page"));
1651- gtk_container_add (GTK_CONTAINER (hbox), button);
1652- gtk_widget_show (button);
1653-
1654-@@ -195,8 +236,8 @@
1655- gtk_widget_show (tool_item);
1656-
1657- /* Find */
1658-- action = gtk_action_group_get_action (action_group, "EditFind");
1659-- button = ev_toolbar_create_toggle_button (ev_toolbar, action);
1660-+ button = ev_toolbar_create_toggle_button (ev_toolbar, "win.find", "edit-find-symbolic",
1661-+ _("Find a word or phrase in the document"));
1662- tool_item = GTK_WIDGET (gtk_tool_item_new ());
1663- gtk_container_add (GTK_CONTAINER (tool_item), button);
1664- gtk_widget_show (button);
1665-@@ -211,30 +252,55 @@
1666- gtk_container_add (GTK_CONTAINER (ev_toolbar), tool_item);
1667- gtk_widget_show (tool_item);
1668-
1669-- /* View Menu */
1670-- menu = gtk_ui_manager_get_widget (ui_manager, "/ViewMenuPopup");
1671-- button = ev_toolbar_create_menu_button (ev_toolbar, "document-properties-symbolic",
1672-- menu, GTK_ALIGN_END);
1673-- ev_toolbar->priv->view_menu_button = button;
1674-- tool_item = GTK_WIDGET (gtk_tool_item_new ());
1675-- gtk_container_add (GTK_CONTAINER (tool_item), button);
1676-- gtk_widget_show (button);
1677-- gtk_widget_set_margin_right (tool_item, 6);
1678--
1679-- gtk_container_add (GTK_CONTAINER (ev_toolbar), tool_item);
1680-- gtk_widget_show (tool_item);
1681--
1682-- /* Action Menu */
1683-- menu = gtk_ui_manager_get_widget (ui_manager, "/ActionMenu");
1684-- button = ev_toolbar_create_menu_button (ev_toolbar, "emblem-system-symbolic",
1685-- menu, GTK_ALIGN_END);
1686-- ev_toolbar->priv->action_menu_button = button;
1687-- tool_item = GTK_WIDGET (gtk_tool_item_new ());
1688-- gtk_container_add (GTK_CONTAINER (tool_item), button);
1689-- gtk_widget_show (button);
1690-+ if (!ev_application_has_traditional_menus (EV_APP)) {
1691-+ GtkBuilder *builder;
1692-+ GMenu *recent_submenu;
1693-+ GMenuModel *recent_menu_model;
1694-+
1695-+ builder = gtk_builder_new_from_resource ("/org/gnome/evince/shell/ui/menus.ui");
1696-+
1697-+ /* View Menu */
1698-+ menu = G_MENU_MODEL (gtk_builder_get_object (builder, "view-menu"));
1699-+ button = ev_toolbar_create_menu_button (ev_toolbar, "document-properties-symbolic",
1700-+ menu, GTK_ALIGN_END);
1701-+ ev_toolbar->priv->view_menu_button = button;
1702-+ tool_item = GTK_WIDGET (gtk_tool_item_new ());
1703-+ gtk_widget_set_margin_left (tool_item, 12);
1704-+ gtk_container_add (GTK_CONTAINER (tool_item), button);
1705-+ gtk_widget_show (button);
1706-+ gtk_widget_set_margin_right (tool_item, 6);
1707-+
1708-+ gtk_container_add (GTK_CONTAINER (ev_toolbar), tool_item);
1709-+ gtk_widget_show (tool_item);
1710-+
1711-+ /* Action Menu */
1712-+ menu = G_MENU_MODEL (gtk_builder_get_object (builder, "action-menu"));
1713-+ button = ev_toolbar_create_menu_button (ev_toolbar, "emblem-system-symbolic",
1714-+ menu, GTK_ALIGN_END);
1715-+ ev_toolbar->priv->action_menu_button = button;
1716-+ tool_item = GTK_WIDGET (gtk_tool_item_new ());
1717-+ gtk_container_add (GTK_CONTAINER (tool_item), button);
1718-+ gtk_widget_show (button);
1719-+
1720-+ gtk_container_add (GTK_CONTAINER (ev_toolbar), tool_item);
1721-+ gtk_widget_show (tool_item);
1722-+
1723-+ /* insert dynamic recent files submenu */
1724-+ recent_menu_model = ev_recent_menu_model_new (gtk_recent_manager_get_default (),
1725-+ "app.open-file",
1726-+ g_get_application_name ());
1727-+ recent_submenu = G_MENU (gtk_builder_get_object (builder, "recent"));
1728-+ g_menu_append_section (recent_submenu, NULL, recent_menu_model);
1729-+
1730-+ /* insert bookmarks section */
1731-+ ev_toolbar->priv->bookmarks_section = G_MENU (gtk_builder_get_object (builder, "bookmarks"));
1732-+ g_signal_connect_swapped (ev_window_get_bookmarks_menu (ev_toolbar->priv->window), "items-changed",
1733-+ G_CALLBACK (ev_toolbar_update_bookmarks), ev_toolbar);
1734-+ ev_toolbar_update_bookmarks (ev_toolbar);
1735-
1736-- gtk_container_add (GTK_CONTAINER (ev_toolbar), tool_item);
1737-- gtk_widget_show (tool_item);
1738-+ g_object_unref (recent_menu_model);
1739-+ g_object_unref (builder);
1740-+ }
1741- }
1742-
1743- static void
1744-Index: evince-3.10.3/shell/ev-utils.c
1745-===================================================================
1746---- evince-3.10.3.orig/shell/ev-utils.c 2014-04-28 15:33:25.038869346 +0200
1747-+++ evince-3.10.3/shell/ev-utils.c 2014-04-28 15:33:25.030869346 +0200
1748-@@ -22,6 +22,7 @@
1749-
1750- #include "ev-utils.h"
1751- #include "ev-file-helpers.h"
1752-+#include "ev-application.h"
1753-
1754- #include <string.h>
1755- #include <math.h>
1756-@@ -391,3 +392,90 @@
1757- g_slist_free (pixbuf_formats);
1758- return NULL;
1759- }
1760-+
1761-+static const gchar *
1762-+get_settings_key_for_directory (GUserDirectory directory)
1763-+{
1764-+ switch (directory) {
1765-+ case G_USER_DIRECTORY_PICTURES:
1766-+ return "pictures-directory";
1767-+ case G_USER_DIRECTORY_DOCUMENTS:
1768-+ default:
1769-+ return "document-directory";
1770-+ }
1771-+}
1772-+
1773-+/**
1774-+ * ev_file_chooser_save_folder:
1775-+ * @file_chooser: a #GtkFileChooser
1776-+ * @uri: (allow-none): optional fallback path
1777-+ * @directory: the #GUserDirectory from which to restore
1778-+ *
1779-+ * Saves the directory of @file_chooser for @directory. Use
1780-+ * ev_file_chooser_restore_folder() to restore this folder in a
1781-+ * different file chooser.
1782-+ */
1783-+void
1784-+ev_file_chooser_save_folder (GtkFileChooser *file_chooser,
1785-+ GUserDirectory directory)
1786-+{
1787-+ gchar *uri, *folder;
1788-+
1789-+ folder = gtk_file_chooser_get_current_folder (file_chooser);
1790-+ if (g_strcmp0 (folder, g_get_user_special_dir (directory)) == 0) {
1791-+ /* Store 'nothing' if the folder is the default one */
1792-+ uri = NULL;
1793-+ } else {
1794-+ uri = gtk_file_chooser_get_current_folder_uri (file_chooser);
1795-+ }
1796-+ g_free (folder);
1797-+
1798-+ g_settings_set (ev_application_get_settings (EV_APP),
1799-+ get_settings_key_for_directory (directory),
1800-+ "ms", uri);
1801-+ g_free (uri);
1802-+}
1803-+
1804-+/**
1805-+ * ev_file_chooser_restore_folder:
1806-+ * @file_chooser: a #GtkFileChooser
1807-+ * @uri: (allow-none): optional fallback path
1808-+ * @directory: the #GUserDirectory from which to restore
1809-+ *
1810-+ * Sets the folder of @file_chooser to the last-visited directory for
1811-+ * the given @directory type.
1812-+ */
1813-+void
1814-+ev_file_chooser_restore_folder (GtkFileChooser *file_chooser,
1815-+ const gchar *uri,
1816-+ GUserDirectory directory)
1817-+{
1818-+ const gchar *dir;
1819-+ gchar *folder_uri;
1820-+ gchar *parent_uri = NULL;
1821-+
1822-+ g_settings_get (ev_application_get_settings (EV_APP),
1823-+ get_settings_key_for_directory (directory),
1824-+ "ms", &folder_uri);
1825-+ if (folder_uri == NULL && uri != NULL) {
1826-+ GFile *file, *parent;
1827-+
1828-+ file = g_file_new_for_uri (uri);
1829-+ parent = g_file_get_parent (file);
1830-+ g_object_unref (file);
1831-+ if (parent) {
1832-+ folder_uri = parent_uri = g_file_get_uri (parent);
1833-+ g_object_unref (parent);
1834-+ }
1835-+ }
1836-+
1837-+ if (folder_uri) {
1838-+ gtk_file_chooser_set_current_folder_uri (file_chooser, folder_uri);
1839-+ } else {
1840-+ dir = g_get_user_special_dir (directory);
1841-+ gtk_file_chooser_set_current_folder (file_chooser,
1842-+ dir ? dir : g_get_home_dir ());
1843-+ }
1844-+
1845-+ g_free (folder_uri);
1846-+}
1847-Index: evince-3.10.3/shell/ev-utils.h
1848-===================================================================
1849---- evince-3.10.3.orig/shell/ev-utils.h 2014-04-28 15:33:25.038869346 +0200
1850-+++ evince-3.10.3/shell/ev-utils.h 2014-04-28 15:33:25.030869346 +0200
1851-@@ -42,6 +42,13 @@
1852- void file_chooser_dialog_add_writable_pixbuf_formats (GtkFileChooser *chooser);
1853- GdkPixbufFormat* get_gdk_pixbuf_format_by_extension (const gchar *uri);
1854-
1855-+void ev_file_chooser_save_folder (GtkFileChooser *file_chooser,
1856-+ GUserDirectory directory);
1857-+
1858-+void ev_file_chooser_restore_folder (GtkFileChooser *file_chooser,
1859-+ const gchar *uri,
1860-+ GUserDirectory directory);
1861-+
1862- G_END_DECLS
1863-
1864- #endif /* __EV_VIEW_H__ */
1865-Index: evince-3.10.3/shell/ev-window.c
1866-===================================================================
1867---- evince-3.10.3.orig/shell/ev-window.c 2014-04-28 15:33:25.038869346 +0200
1868-+++ evince-3.10.3/shell/ev-window.c 2014-04-28 15:33:37.626869432 +0200
1869-@@ -87,10 +87,10 @@
1870- #include "ev-print-operation.h"
1871- #include "ev-progress-message-area.h"
1872- #include "ev-annotation-properties-dialog.h"
1873--#include "ev-bookmarks.h"
1874- #include "ev-bookmark-action.h"
1875- #include "ev-zoom-action.h"
1876- #include "ev-toolbar.h"
1877-+#include "ev-bookmarks.h"
1878-
1879- #ifdef ENABLE_DBUS
1880- #include "ev-gdbus-generated.h"
1881-@@ -171,24 +171,26 @@
1882-
1883- /* UI Builders */
1884- GtkActionGroup *action_group;
1885-- GtkActionGroup *view_popup_action_group;
1886-- GtkActionGroup *attachment_popup_action_group;
1887- GtkActionGroup *zoom_selector_popup_action_group;
1888- GtkRecentManager *recent_manager;
1889-- GtkActionGroup *recent_action_group;
1890-- guint recent_ui_id;
1891- GtkActionGroup *bookmarks_action_group;
1892- guint bookmarks_ui_id;
1893- GtkUIManager *ui_manager;
1894-
1895- /* Popup view */
1896-- GtkWidget *view_popup;
1897- EvLink *link;
1898- EvImage *image;
1899- EvAnnotation *annot;
1900-
1901-+ GMenuModel *document_view_menu;
1902-+ GMenuModel *external_link_section;
1903-+ GMenuModel *internal_link_section;
1904-+ GMenuModel *image_section;
1905-+ GMenuModel *attachment_section;
1906-+ GMenuModel *annotation_section;
1907-+ GtkWidget *popup_menu;
1908-+
1909- /* Popup attachment */
1910-- GtkWidget *attachment_popup;
1911- GList *attach_list;
1912-
1913- /* Document */
1914-@@ -206,6 +208,7 @@
1915- EvWindowTitle *title;
1916- EvMetadata *metadata;
1917- EvBookmarks *bookmarks;
1918-+ GMenu *bookmarks_menu;
1919-
1920- /* Load params */
1921- EvLinkDest *dest;
1922-@@ -262,8 +265,6 @@
1923- #define GS_OVERRIDE_RESTRICTIONS "override-restrictions"
1924- #define GS_PAGE_CACHE_SIZE "page-cache-size"
1925- #define GS_AUTO_RELOAD "auto-reload"
1926--#define GS_LAST_DOCUMENT_DIRECTORY "document-directory"
1927--#define GS_LAST_PICTURES_DIRECTORY "pictures-directory"
1928-
1929- #define SIDEBAR_DEFAULT_SIZE 132
1930- #define LINKS_SIDEBAR_ID "links"
1931-@@ -328,29 +329,9 @@
1932- static void ev_window_run_fullscreen (EvWindow *window);
1933- static void ev_window_stop_fullscreen (EvWindow *window,
1934- gboolean unfullscreen_window);
1935--static void ev_window_cmd_view_fullscreen (GtkAction *action,
1936-- EvWindow *window);
1937- static void ev_window_run_presentation (EvWindow *window);
1938- static void ev_window_stop_presentation (EvWindow *window,
1939- gboolean unfullscreen_window);
1940--static void ev_window_cmd_view_presentation (GtkAction *action,
1941-- EvWindow *window);
1942--static void ev_view_popup_cmd_open_link (GtkAction *action,
1943-- EvWindow *window);
1944--static void ev_view_popup_cmd_open_link_new_window (GtkAction *action,
1945-- EvWindow *window);
1946--static void ev_view_popup_cmd_copy_link_address (GtkAction *action,
1947-- EvWindow *window);
1948--static void ev_view_popup_cmd_save_image_as (GtkAction *action,
1949-- EvWindow *window);
1950--static void ev_view_popup_cmd_copy_image (GtkAction *action,
1951-- EvWindow *window);
1952--static void ev_view_popup_cmd_annot_properties (GtkAction *action,
1953-- EvWindow *window);
1954--static void ev_attachment_popup_cmd_open_attachment (GtkAction *action,
1955-- EvWindow *window);
1956--static void ev_attachment_popup_cmd_save_attachment_as (GtkAction *action,
1957-- EvWindow *window);
1958- static void ev_window_cmd_view_fit_page (GtkAction *action,
1959- EvWindow *ev_window);
1960- static void ev_window_cmd_view_fit_width (GtkAction *action,
1961-@@ -361,8 +342,6 @@
1962- EvLink *link,
1963- EvWindow *window);
1964- static void ev_window_update_find_status_message (EvWindow *ev_window);
1965--static void ev_window_cmd_edit_find (GtkAction *action,
1966-- EvWindow *ev_window);
1967- static void find_bar_search_changed_cb (EggFindBar *find_bar,
1968- GParamSpec *param,
1969- EvWindow *ev_window);
1970-@@ -396,6 +375,17 @@
1971- }
1972-
1973- static void
1974-+ev_window_set_action_enabled (EvWindow *ev_window,
1975-+ const char *name,
1976-+ gboolean enabled)
1977-+{
1978-+ GAction *action;
1979-+
1980-+ action = g_action_map_lookup_action (G_ACTION_MAP (ev_window), name);
1981-+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
1982-+}
1983-+
1984-+static void
1985- ev_window_set_action_sensitive (EvWindow *ev_window,
1986- const char *name,
1987- gboolean sensitive)
1988-@@ -419,6 +409,7 @@
1989- gboolean can_get_text = FALSE;
1990- gboolean has_pages = FALSE;
1991- gboolean can_find = FALSE;
1992-+ GSettings *settings = ev_application_get_settings (EV_APP);
1993-
1994- if (document) {
1995- has_document = TRUE;
1996-@@ -438,10 +429,8 @@
1997- can_find = TRUE;
1998- }
1999-
2000-- if (has_document && ev_window->priv->settings) {
2001-- override_restrictions =
2002-- g_settings_get_boolean (ev_window->priv->settings,
2003-- GS_OVERRIDE_RESTRICTIONS);
2004-+ if (has_document && settings) {
2005-+ override_restrictions = g_settings_get_boolean (settings, GS_OVERRIDE_RESTRICTIONS);
2006- }
2007-
2008- if (!override_restrictions && info && info->fields_mask & EV_DOCUMENT_INFO_PERMISSIONS) {
2009-@@ -463,33 +452,31 @@
2010- }
2011-
2012- /* File menu */
2013-- ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document);
2014-- ev_window_set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy);
2015-- ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
2016-- ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
2017-- ev_window_set_action_sensitive (ev_window, "FileOpenContainingFolder", has_document);
2018-- ev_window_set_action_sensitive (ev_window, "FileSendTo",
2019-- has_document && ev_window->priv->has_mailto_handler);
2020-- ev_window_set_action_sensitive (ev_window, "ViewPresentation", has_document);
2021-+ ev_window_set_action_enabled (ev_window, "open-copy", has_document);
2022-+ ev_window_set_action_enabled (ev_window, "save-copy", has_document && ok_to_copy);
2023-+ ev_window_set_action_enabled (ev_window, "print", has_pages && ok_to_print);
2024-+ ev_window_set_action_enabled (ev_window, "show-properties", has_document && has_properties);
2025-+ ev_window_set_action_enabled (ev_window, "open-containing-folder", has_document);
2026-+ ev_window_set_action_enabled (ev_window, "send-to",
2027-+ has_document && ev_window->priv->has_mailto_handler);
2028-+ ev_window_set_action_enabled (ev_window, "presentation", has_document);
2029-
2030- /* Edit menu */
2031-- ev_window_set_action_sensitive (ev_window, "EditSelectAll", has_pages && can_get_text);
2032-- ev_window_set_action_sensitive (ev_window, "EditFind", can_find);
2033-- ev_window_set_action_sensitive (ev_window, "Slash", can_find);
2034-- ev_window_set_action_sensitive (ev_window, "CtrlF", can_find);
2035-- ev_window_set_action_sensitive (ev_window, "EditRotateLeft", has_pages);
2036-- ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages);
2037-+ ev_window_set_action_enabled (ev_window, "select-all", has_pages && can_get_text);
2038-+ ev_window_set_action_enabled (ev_window, "find", can_find);
2039-+ ev_window_set_action_enabled (ev_window, "rotate-left", has_pages);
2040-+ ev_window_set_action_enabled (ev_window, "rotate-right", has_pages);
2041-
2042- /* View menu */
2043-- ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages);
2044-- ev_window_set_action_sensitive (ev_window, "ViewDual", has_pages);
2045-- ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", has_pages);
2046-- ev_window_set_action_sensitive (ev_window, "ViewReload", has_pages);
2047-- ev_window_set_action_sensitive (ev_window, "ViewAutoscroll", has_pages);
2048-- ev_window_set_action_sensitive (ev_window, "ViewInvertedColors", has_pages);
2049-+ ev_window_set_action_enabled (ev_window, "continuous", has_pages);
2050-+ ev_window_set_action_enabled (ev_window, "dual-page", has_pages);
2051-+ ev_window_set_action_enabled (ev_window, "dual-odd-left", has_pages);
2052-+ ev_window_set_action_enabled (ev_window, "reload", has_pages);
2053-+ ev_window_set_action_enabled (ev_window, "auto-scroll", has_pages);
2054-+ ev_window_set_action_enabled (ev_window, "inverted-colors", has_pages);
2055-
2056- /* Bookmarks menu */
2057-- ev_window_set_action_sensitive (ev_window, "BookmarksAdd",
2058-+ ev_window_set_action_enabled (ev_window, "add-bookmark",
2059- has_pages && ev_window->priv->bookmarks);
2060-
2061- /* Toolbar-specific actions: */
2062-@@ -507,62 +494,58 @@
2063- gboolean has_pages = FALSE;
2064- gboolean presentation_mode;
2065- gboolean can_find_in_page = FALSE;
2066-- gboolean dual_mode = FALSE;
2067-
2068- if (ev_window->priv->document) {
2069- page = ev_document_model_get_page (ev_window->priv->model);
2070- n_pages = ev_document_get_n_pages (ev_window->priv->document);
2071- has_pages = n_pages > 0;
2072-- dual_mode = ev_document_model_get_dual_page (ev_window->priv->model);
2073- }
2074-
2075- can_find_in_page = (ev_window->priv->find_job &&
2076- ev_job_find_has_results (EV_JOB_FIND (ev_window->priv->find_job)));
2077-
2078-- ev_window_set_action_sensitive (ev_window, "EditCopy",
2079-+ ev_window_set_action_enabled (ev_window, "copy",
2080- has_pages &&
2081- ev_view_get_has_selection (view));
2082-- ev_window_set_action_sensitive (ev_window, "CtrlG",
2083-- has_pages && can_find_in_page);
2084-- ev_window_set_action_sensitive (ev_window, "ShiftCtrlG",
2085-- has_pages && can_find_in_page);
2086-- ev_window_set_action_sensitive (ev_window, "F3",
2087-- has_pages && can_find_in_page);
2088-+ ev_window_set_action_enabled (ev_window, "find-next",
2089-+ has_pages && can_find_in_page);
2090-+ ev_window_set_action_enabled (ev_window, "find-previous",
2091-+ has_pages && can_find_in_page);
2092-
2093- presentation_mode = EV_WINDOW_IS_PRESENTATION (ev_window);
2094-
2095-- ev_window_set_action_sensitive (ev_window, "ViewZoomIn",
2096-- has_pages &&
2097-- ev_view_can_zoom_in (view) &&
2098-- !presentation_mode);
2099-- ev_window_set_action_sensitive (ev_window, "ViewZoomOut",
2100-- has_pages &&
2101-- ev_view_can_zoom_out (view) &&
2102-- !presentation_mode);
2103-- ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", dual_mode);
2104-+ ev_window_set_action_enabled (ev_window, "zoom-in",
2105-+ has_pages &&
2106-+ ev_view_can_zoom_in (view) &&
2107-+ !presentation_mode);
2108-+ ev_window_set_action_enabled (ev_window, "zoom-out",
2109-+ has_pages &&
2110-+ ev_view_can_zoom_out (view) &&
2111-+ !presentation_mode);
2112-+ // ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", dual_mode);
2113-
2114- /* Go menu */
2115- if (has_pages) {
2116-- ev_window_set_action_sensitive (ev_window, "GoPreviousPage", page > 0);
2117-- ev_window_set_action_sensitive (ev_window, "GoNextPage", page < n_pages - 1);
2118-- ev_window_set_action_sensitive (ev_window, "GoFirstPage", page > 0);
2119-- ev_window_set_action_sensitive (ev_window, "GoLastPage", page < n_pages - 1);
2120-- ev_window_set_action_sensitive (ev_window, "GoToPage", TRUE);
2121-+ ev_window_set_action_enabled (ev_window, "go-previous-page", page > 0);
2122-+ ev_window_set_action_enabled (ev_window, "go-next-page", page < n_pages - 1);
2123-+ ev_window_set_action_enabled (ev_window, "go-first-page", page > 0);
2124-+ ev_window_set_action_enabled (ev_window, "go-last-page", page < n_pages - 1);
2125-+ ev_window_set_action_enabled (ev_window, "select-page", TRUE);
2126- } else {
2127-- ev_window_set_action_sensitive (ev_window, "GoFirstPage", FALSE);
2128-- ev_window_set_action_sensitive (ev_window, "GoPreviousPage", FALSE);
2129-- ev_window_set_action_sensitive (ev_window, "GoNextPage", FALSE);
2130-- ev_window_set_action_sensitive (ev_window, "GoLastPage", FALSE);
2131-- ev_window_set_action_sensitive (ev_window, "GoToPage", FALSE);
2132-+ ev_window_set_action_enabled (ev_window, "go-first-page", FALSE);
2133-+ ev_window_set_action_enabled (ev_window, "go-previous-page", FALSE);
2134-+ ev_window_set_action_enabled (ev_window, "go-next-page", FALSE);
2135-+ ev_window_set_action_enabled (ev_window, "go-last-page", FALSE);
2136-+ ev_window_set_action_enabled (ev_window, "select-page", FALSE);
2137- }
2138-
2139- ev_window_set_action_sensitive (ev_window, "History",
2140- !ev_history_is_frozen (ev_window->priv->history));
2141-
2142-- ev_window_set_action_sensitive (ev_window, "F7",
2143-- has_pages &&
2144-- ev_view_supports_caret_navigation (view) &&
2145-- !presentation_mode);
2146-+ ev_window_set_action_enabled (ev_window, "caret-navigation",
2147-+ has_pages &&
2148-+ ev_view_supports_caret_navigation (view) &&
2149-+ !presentation_mode);
2150- }
2151-
2152- static void
2153-@@ -593,6 +576,8 @@
2154- set_widget_visibility (priv->toolbar, toolbar);
2155- set_widget_visibility (priv->find_bar, findbar);
2156- set_widget_visibility (priv->sidebar, sidebar);
2157-+
2158-+ gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), !presentation);
2159- }
2160-
2161- static void
2162-@@ -892,7 +877,7 @@
2163- view_selection_changed_cb (EvView *view,
2164- EvWindow *window)
2165- {
2166-- ev_window_set_action_sensitive (window, "EditCopy",
2167-+ ev_window_set_action_enabled (window, "copy",
2168- ev_view_get_has_selection (view));
2169- }
2170-
2171-@@ -1436,27 +1421,6 @@
2172- }
2173- #endif
2174-
2175--static GSettings *
2176--ev_window_ensure_settings (EvWindow *ev_window)
2177--{
2178-- EvWindowPrivate *priv = ev_window->priv;
2179--
2180-- if (priv->settings != NULL)
2181-- return priv->settings;
2182--
2183-- priv->settings = g_settings_new (GS_SCHEMA_NAME);
2184-- g_signal_connect (priv->settings,
2185-- "changed::"GS_OVERRIDE_RESTRICTIONS,
2186-- G_CALLBACK (override_restrictions_changed),
2187-- ev_window);
2188-- g_signal_connect (priv->settings,
2189-- "changed::"GS_PAGE_CACHE_SIZE,
2190-- G_CALLBACK (page_cache_size_changed),
2191-- ev_window);
2192--
2193-- return priv->settings;
2194--}
2195--
2196- static gboolean
2197- ev_window_setup_document (EvWindow *ev_window)
2198- {
2199-@@ -1471,8 +1435,6 @@
2200- ev_window_title_set_document (ev_window->priv->title, document);
2201- ev_window_title_set_uri (ev_window->priv->title, ev_window->priv->uri);
2202-
2203-- ev_window_ensure_settings (ev_window);
2204--
2205- #ifdef HAVE_DESKTOP_SCHEMAS
2206- if (!ev_window->priv->lockdown_settings) {
2207- ev_window->priv->lockdown_settings = g_settings_new (GS_LOCKDOWN_SCHEMA_NAME);
2208-@@ -1563,8 +1525,9 @@
2209- ev_window_document_changed (EvWindow *ev_window,
2210- gpointer user_data)
2211- {
2212-- if (ev_window->priv->settings &&
2213-- g_settings_get_boolean (ev_window->priv->settings, GS_AUTO_RELOAD))
2214-+ GSettings *settings = ev_application_get_settings (EV_APP);
2215-+
2216-+ if (settings && g_settings_get_boolean (settings, GS_AUTO_RELOAD))
2217- ev_window_reload_document (ev_window, NULL);
2218- }
2219-
2220-@@ -2410,124 +2373,10 @@
2221- }
2222- }
2223-
2224--static const gchar *
2225--get_settings_key_for_directory (GUserDirectory directory)
2226--{
2227-- switch (directory) {
2228-- case G_USER_DIRECTORY_PICTURES:
2229-- return GS_LAST_PICTURES_DIRECTORY;
2230-- case G_USER_DIRECTORY_DOCUMENTS:
2231-- default:
2232-- return GS_LAST_DOCUMENT_DIRECTORY;
2233-- }
2234--}
2235--
2236--static void
2237--ev_window_file_chooser_restore_folder (EvWindow *window,
2238-- GtkFileChooser *file_chooser,
2239-- const gchar *uri,
2240-- GUserDirectory directory)
2241--{
2242-- const gchar *folder_uri, *dir;
2243-- gchar *parent_uri = NULL;
2244--
2245-- g_settings_get (ev_window_ensure_settings (window),
2246-- get_settings_key_for_directory (directory),
2247-- "m&s", &folder_uri);
2248-- if (folder_uri == NULL && uri != NULL) {
2249-- GFile *file, *parent;
2250--
2251-- file = g_file_new_for_uri (uri);
2252-- parent = g_file_get_parent (file);
2253-- g_object_unref (file);
2254-- if (parent) {
2255-- folder_uri = parent_uri = g_file_get_uri (parent);
2256-- g_object_unref (parent);
2257-- }
2258-- }
2259--
2260-- if (folder_uri) {
2261-- gtk_file_chooser_set_current_folder_uri (file_chooser, folder_uri);
2262-- } else {
2263-- dir = g_get_user_special_dir (directory);
2264-- gtk_file_chooser_set_current_folder (file_chooser,
2265-- dir ? dir : g_get_home_dir ());
2266-- }
2267--
2268-- g_free (parent_uri);
2269--}
2270--
2271--static void
2272--ev_window_file_chooser_save_folder (EvWindow *window,
2273-- GtkFileChooser *file_chooser,
2274-- GUserDirectory directory)
2275--{
2276-- gchar *uri, *folder;
2277--
2278-- folder = gtk_file_chooser_get_current_folder (file_chooser);
2279-- if (g_strcmp0 (folder, g_get_user_special_dir (directory)) == 0) {
2280-- /* Store 'nothing' if the folder is the default one */
2281-- uri = NULL;
2282-- } else {
2283-- uri = gtk_file_chooser_get_current_folder_uri (file_chooser);
2284-- }
2285-- g_free (folder);
2286--
2287-- g_settings_set (ev_window_ensure_settings (window),
2288-- get_settings_key_for_directory (directory),
2289-- "ms", uri);
2290-- g_free (uri);
2291--}
2292--
2293--static void
2294--file_open_dialog_response_cb (GtkWidget *chooser,
2295-- gint response_id,
2296-- EvWindow *ev_window)
2297--{
2298-- if (response_id == GTK_RESPONSE_OK) {
2299-- GSList *uris;
2300--
2301-- ev_window_file_chooser_save_folder (ev_window, GTK_FILE_CHOOSER (chooser),
2302-- G_USER_DIRECTORY_DOCUMENTS);
2303--
2304-- uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
2305--
2306-- ev_application_open_uri_list (EV_APP, uris,
2307-- gtk_window_get_screen (GTK_WINDOW (ev_window)),
2308-- gtk_get_current_event_time ());
2309--
2310-- g_slist_foreach (uris, (GFunc)g_free, NULL);
2311-- g_slist_free (uris);
2312-- }
2313--
2314-- gtk_widget_destroy (chooser);
2315--}
2316--
2317- static void
2318- ev_window_cmd_file_open (GtkAction *action, EvWindow *window)
2319- {
2320-- GtkWidget *chooser;
2321--
2322-- chooser = gtk_file_chooser_dialog_new (_("Open Document"),
2323-- GTK_WINDOW (window),
2324-- GTK_FILE_CHOOSER_ACTION_OPEN,
2325-- GTK_STOCK_CANCEL,
2326-- GTK_RESPONSE_CANCEL,
2327-- GTK_STOCK_OPEN, GTK_RESPONSE_OK,
2328-- NULL);
2329--
2330-- ev_document_factory_add_filters (chooser, NULL);
2331-- gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), TRUE);
2332-- gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), FALSE);
2333--
2334-- ev_window_file_chooser_restore_folder (window, GTK_FILE_CHOOSER (chooser),
2335-- NULL, G_USER_DIRECTORY_DOCUMENTS);
2336--
2337-- g_signal_connect (chooser, "response",
2338-- G_CALLBACK (file_open_dialog_response_cb),
2339-- window);
2340--
2341-- gtk_widget_show (chooser);
2342-+ ev_application_open (EV_APP);
2343- }
2344-
2345- static void
2346-@@ -2545,26 +2394,13 @@
2347- }
2348-
2349- static void
2350--ev_window_cmd_file_open_copy (GtkAction *action, EvWindow *window)
2351-+ev_window_activate_open_copy_action (GSimpleAction *action,
2352-+ GVariant *parameter,
2353-+ gpointer user_data)
2354- {
2355-- ev_window_open_copy_at_dest (window, NULL);
2356--}
2357-+ EvWindow *window = user_data;
2358-
2359--static void
2360--ev_window_cmd_recent_file_activate (GtkAction *action,
2361-- EvWindow *window)
2362--{
2363-- GtkRecentInfo *info;
2364-- const gchar *uri;
2365--
2366-- info = g_object_get_data (G_OBJECT (action), "gtk-recent-info");
2367-- g_assert (info != NULL);
2368--
2369-- uri = gtk_recent_info_get_uri (info);
2370--
2371-- ev_application_open_uri_at_dest (EV_APP, uri,
2372-- gtk_window_get_screen (GTK_WINDOW (window)),
2373-- NULL, 0, NULL, gtk_get_current_event_time ());
2374-+ ev_window_open_copy_at_dest (window, NULL);
2375- }
2376-
2377- static void
2378-@@ -2583,185 +2419,6 @@
2379- gtk_recent_manager_add_item (window->priv->recent_manager, filename);
2380- }
2381-
2382--static gint
2383--compare_recent_items (GtkRecentInfo *a, GtkRecentInfo *b)
2384--{
2385-- gboolean has_ev_a, has_ev_b;
2386-- const gchar *evince = g_get_application_name ();
2387--
2388-- has_ev_a = gtk_recent_info_has_application (a, evince);
2389-- has_ev_b = gtk_recent_info_has_application (b, evince);
2390--
2391-- if (has_ev_a && has_ev_b) {
2392-- time_t time_a, time_b;
2393--
2394-- time_a = gtk_recent_info_get_modified (a);
2395-- time_b = gtk_recent_info_get_modified (b);
2396--
2397-- return (time_b - time_a);
2398-- } else if (has_ev_a) {
2399-- return -1;
2400-- } else if (has_ev_b) {
2401-- return 1;
2402-- }
2403--
2404-- return 0;
2405--}
2406--
2407--/*
2408-- * Doubles underscore to avoid spurious menu accels.
2409-- */
2410--static gchar *
2411--ev_window_get_recent_file_label (gint index, const gchar *filename)
2412--{
2413-- GString *str;
2414-- gint length;
2415-- const gchar *p;
2416-- const gchar *end;
2417-- gboolean is_rtl;
2418--
2419-- is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL);
2420--
2421-- g_return_val_if_fail (filename != NULL, NULL);
2422--
2423-- length = strlen (filename);
2424-- str = g_string_sized_new (length + 10);
2425-- g_string_printf (str, "%s_%d. ", is_rtl ? "\xE2\x80\x8F" : "", index);
2426--
2427-- p = filename;
2428-- end = filename + length;
2429--
2430-- while (p != end) {
2431-- const gchar *next;
2432-- next = g_utf8_next_char (p);
2433--
2434-- switch (*p) {
2435-- case '_':
2436-- g_string_append (str, "__");
2437-- break;
2438-- default:
2439-- g_string_append_len (str, p, next - p);
2440-- break;
2441-- }
2442--
2443-- p = next;
2444-- }
2445--
2446-- return g_string_free (str, FALSE);
2447--}
2448--
2449--static void
2450--ev_window_recent_action_connect_proxy_cb (GtkActionGroup *action_group,
2451-- GtkAction *action,
2452-- GtkWidget *proxy,
2453-- gpointer data)
2454--{
2455-- GtkLabel *label;
2456--
2457-- if (!GTK_IS_MENU_ITEM (proxy))
2458-- return;
2459--
2460-- label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (proxy)));
2461--
2462-- gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_MIDDLE);
2463-- gtk_label_set_max_width_chars (label, MAX_RECENT_ITEM_LEN);
2464--}
2465--
2466--static void
2467--ev_window_setup_recent (EvWindow *ev_window)
2468--{
2469-- GList *items, *l;
2470-- guint n_items = 0;
2471-- const gchar *evince = g_get_application_name ();
2472-- static guint i = 0;
2473--
2474-- if (ev_window->priv->recent_ui_id > 0) {
2475-- gtk_ui_manager_remove_ui (ev_window->priv->ui_manager,
2476-- ev_window->priv->recent_ui_id);
2477-- gtk_ui_manager_ensure_update (ev_window->priv->ui_manager);
2478-- }
2479-- ev_window->priv->recent_ui_id = gtk_ui_manager_new_merge_id (ev_window->priv->ui_manager);
2480--
2481-- if (ev_window->priv->recent_action_group) {
2482-- gtk_ui_manager_remove_action_group (ev_window->priv->ui_manager,
2483-- ev_window->priv->recent_action_group);
2484-- g_object_unref (ev_window->priv->recent_action_group);
2485-- }
2486-- ev_window->priv->recent_action_group = gtk_action_group_new ("RecentFilesActions");
2487-- g_signal_connect (ev_window->priv->recent_action_group, "connect-proxy",
2488-- G_CALLBACK (ev_window_recent_action_connect_proxy_cb), NULL);
2489--
2490-- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
2491-- ev_window->priv->recent_action_group, -1);
2492--
2493-- items = gtk_recent_manager_get_items (ev_window->priv->recent_manager);
2494-- items = g_list_sort (items, (GCompareFunc) compare_recent_items);
2495--
2496-- for (l = items; l && l->data; l = g_list_next (l)) {
2497-- GtkRecentInfo *info;
2498-- GtkAction *action;
2499-- gchar *action_name;
2500-- gchar *label;
2501-- const gchar *mime_type;
2502-- gchar *content_type;
2503-- GIcon *icon = NULL;
2504--
2505-- info = (GtkRecentInfo *) l->data;
2506--
2507-- if (!gtk_recent_info_has_application (info, evince))
2508-- continue;
2509--
2510-- action_name = g_strdup_printf ("RecentFile%u", i++);
2511-- label = ev_window_get_recent_file_label (
2512-- n_items + 1, gtk_recent_info_get_display_name (info));
2513--
2514-- mime_type = gtk_recent_info_get_mime_type (info);
2515-- content_type = g_content_type_from_mime_type (mime_type);
2516-- if (content_type != NULL) {
2517-- icon = g_content_type_get_icon (content_type);
2518-- g_free (content_type);
2519-- }
2520--
2521-- action = g_object_new (GTK_TYPE_ACTION,
2522-- "name", action_name,
2523-- "label", label,
2524-- "gicon", icon,
2525-- "always-show-image", TRUE,
2526-- NULL);
2527--
2528-- g_object_set_data_full (G_OBJECT (action),
2529-- "gtk-recent-info",
2530-- gtk_recent_info_ref (info),
2531-- (GDestroyNotify) gtk_recent_info_unref);
2532--
2533-- g_signal_connect (action, "activate",
2534-- G_CALLBACK (ev_window_cmd_recent_file_activate),
2535-- (gpointer) ev_window);
2536--
2537-- gtk_action_group_add_action (ev_window->priv->recent_action_group,
2538-- action);
2539-- g_object_unref (action);
2540--
2541-- gtk_ui_manager_add_ui (ev_window->priv->ui_manager,
2542-- ev_window->priv->recent_ui_id,
2543-- "/ActionMenu/RecentFilesMenu/RecentFiles",
2544-- label,
2545-- action_name,
2546-- GTK_UI_MANAGER_MENUITEM,
2547-- FALSE);
2548-- g_free (action_name);
2549-- g_free (label);
2550-- if (icon != NULL)
2551-- g_object_unref (icon);
2552--
2553-- if (++n_items == 5)
2554-- break;
2555-- }
2556--
2557-- g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL);
2558-- g_list_free (items);
2559--}
2560--
2561- static gboolean
2562- show_saving_progress (GFile *dst)
2563- {
2564-@@ -2952,8 +2609,8 @@
2565- return;
2566- }
2567-
2568-- ev_window_file_chooser_save_folder (ev_window, GTK_FILE_CHOOSER (fc),
2569-- G_USER_DIRECTORY_DOCUMENTS);
2570-+ ev_file_chooser_save_folder (GTK_FILE_CHOOSER (fc),
2571-+ G_USER_DIRECTORY_DOCUMENTS);
2572-
2573- uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc));
2574-
2575-@@ -2975,7 +2632,7 @@
2576- }
2577-
2578- static void
2579--ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
2580-+ev_window_save_copy (EvWindow *ev_window)
2581- {
2582- GtkWidget *fc;
2583- gchar *base_name;
2584-@@ -3003,9 +2660,9 @@
2585- g_object_unref (file);
2586- g_free (base_name);
2587-
2588-- ev_window_file_chooser_restore_folder (ev_window, GTK_FILE_CHOOSER (fc),
2589-- ev_window->priv->uri,
2590-- G_USER_DIRECTORY_DOCUMENTS);
2591-+ ev_file_chooser_restore_folder (GTK_FILE_CHOOSER (fc),
2592-+ ev_window->priv->uri,
2593-+ G_USER_DIRECTORY_DOCUMENTS);
2594-
2595- g_signal_connect (fc, "response",
2596- G_CALLBACK (file_save_dialog_response_cb),
2597-@@ -3015,9 +2672,21 @@
2598- }
2599-
2600- static void
2601--ev_window_cmd_send_to (GtkAction *action,
2602-- EvWindow *ev_window)
2603-+ev_window_activate_save_copy_action (GSimpleAction *action,
2604-+ GVariant *parameter,
2605-+ gpointer user_data)
2606-+{
2607-+ EvWindow *window = user_data;
2608-+
2609-+ ev_window_save_copy (window);
2610-+}
2611-+
2612-+static void
2613-+ev_window_activate_send_to_action (GSimpleAction *action,
2614-+ GVariant *parameter,
2615-+ gpointer user_data)
2616- {
2617-+ EvWindow *ev_window = user_data;
2618- GAppInfo *app_info;
2619- gchar *command;
2620- const char *uri;
2621-@@ -3052,8 +2721,11 @@
2622- }
2623-
2624- static void
2625--ev_window_cmd_open_containing_folder (GtkAction *action, EvWindow *ev_window)
2626-+ev_window_activate_open_containing_folder_action (GSimpleAction *action,
2627-+ GVariant *parameter,
2628-+ gpointer user_data)
2629- {
2630-+ EvWindow *ev_window = user_data;
2631- GtkWidget *ev_window_widget;
2632- GFile *file;
2633- GFile *parent;
2634-@@ -3589,14 +3261,22 @@
2635- }
2636-
2637- static void
2638--ev_window_cmd_file_print (GtkAction *action, EvWindow *ev_window)
2639-+ev_window_activate_print_action (GSimpleAction *action,
2640-+ GVariant *state,
2641-+ gpointer user_data)
2642- {
2643-+ EvWindow *ev_window = user_data;
2644-+
2645- ev_window_print (ev_window);
2646- }
2647-
2648- static void
2649--ev_window_cmd_file_properties (GtkAction *action, EvWindow *ev_window)
2650-+ev_window_activate_show_properties_action (GSimpleAction *action,
2651-+ GVariant *state,
2652-+ gpointer user_data)
2653- {
2654-+ EvWindow *ev_window = user_data;
2655-+
2656- if (ev_window->priv->properties == NULL) {
2657- ev_window->priv->properties = ev_properties_dialog_new ();
2658- ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties),
2659-@@ -3622,7 +3302,7 @@
2660-
2661- switch (response) {
2662- case GTK_RESPONSE_YES:
2663-- ev_window_cmd_save_as (NULL, ev_window);
2664-+ ev_window_save_copy (ev_window);
2665- break;
2666- case GTK_RESPONSE_NO:
2667- gtk_widget_destroy (GTK_WIDGET (ev_window));
2668-@@ -3823,64 +3503,86 @@
2669- }
2670-
2671- static void
2672--ev_window_cmd_file_close_window (GtkAction *action, EvWindow *ev_window)
2673-+ev_window_activate_close_action (GSimpleAction *action,
2674-+ GVariant *parameter,
2675-+ gpointer user_data)
2676- {
2677-+ EvWindow *ev_window = user_data;
2678-+
2679- if (ev_window_close (ev_window))
2680- gtk_widget_destroy (GTK_WIDGET (ev_window));
2681- }
2682-
2683- static void
2684--ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window)
2685-+ev_window_activate_select_page_action (GSimpleAction *action,
2686-+ GVariant *parameter,
2687-+ gpointer user_data)
2688- {
2689-- GtkAction *action;
2690--
2691-+ EvWindow *window = user_data;
2692-+ GtkAction *page_action;
2693-+
2694- update_chrome_flag (window, EV_CHROME_RAISE_TOOLBAR, TRUE);
2695- update_chrome_visibility (window);
2696--
2697-- action = gtk_action_group_get_action (window->priv->action_group,
2698-- PAGE_SELECTOR_ACTION);
2699-- ev_page_action_grab_focus (EV_PAGE_ACTION (action));
2700-+
2701-+ page_action = gtk_action_group_get_action (window->priv->action_group,
2702-+ PAGE_SELECTOR_ACTION);
2703-+ ev_page_action_grab_focus (EV_PAGE_ACTION (page_action));
2704- }
2705-
2706- static void
2707--ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window)
2708-+ev_window_activate_scroll_forward_action (GSimpleAction *action,
2709-+ GVariant *parameter,
2710-+ gpointer user_data)
2711- {
2712-+ EvWindow *window = user_data;
2713-+
2714- g_signal_emit_by_name (window->priv->view, "scroll", GTK_SCROLL_PAGE_FORWARD, GTK_ORIENTATION_VERTICAL);
2715- }
2716-
2717- static void
2718--ev_window_cmd_scroll_backward (GtkAction *action, EvWindow *window)
2719-+ev_window_activate_scroll_backwards_action (GSimpleAction *action,
2720-+ GVariant *parameter,
2721-+ gpointer user_data)
2722- {
2723-+ EvWindow *window = user_data;
2724-+
2725- g_signal_emit_by_name (window->priv->view, "scroll", GTK_SCROLL_PAGE_BACKWARD, GTK_ORIENTATION_VERTICAL);
2726- }
2727-
2728- static void
2729--ev_window_cmd_continuous (GtkAction *action, EvWindow *ev_window)
2730-+ev_window_change_continuous_action_state (GSimpleAction *action,
2731-+ GVariant *state,
2732-+ gpointer user_data)
2733- {
2734-- gboolean continuous;
2735-+ EvWindow *window = user_data;
2736-
2737-- ev_window_stop_presentation (ev_window, TRUE);
2738-- continuous = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2739-- ev_document_model_set_continuous (ev_window->priv->model, continuous);
2740-+ ev_window_stop_presentation (window, TRUE);
2741-+ ev_document_model_set_continuous (window->priv->model, g_variant_get_boolean (state));
2742-+ g_simple_action_set_state (action, state);
2743- }
2744-
2745- static void
2746--ev_window_cmd_dual (GtkAction *action, EvWindow *ev_window)
2747-+ev_window_change_dual_page_action_state (GSimpleAction *action,
2748-+ GVariant *state,
2749-+ gpointer user_data)
2750- {
2751-- gboolean dual_page;
2752-+ EvWindow *window = user_data;
2753-
2754-- ev_window_stop_presentation (ev_window, TRUE);
2755-- dual_page = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2756-- ev_document_model_set_dual_page (ev_window->priv->model, dual_page);
2757-+ ev_window_stop_presentation (window, TRUE);
2758-+ ev_document_model_set_dual_page (window->priv->model, g_variant_get_boolean (state));
2759-+ g_simple_action_set_state (action, state);
2760- }
2761-
2762- static void
2763--ev_window_cmd_dual_odd_pages_left (GtkAction *action, EvWindow *ev_window)
2764-+ev_window_change_dual_odd_left_action_state (GSimpleAction *action,
2765-+ GVariant *state,
2766-+ gpointer user_data)
2767- {
2768-- gboolean dual_page_odd_left;
2769-+ EvWindow *window = user_data;
2770-
2771-- dual_page_odd_left = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2772-- ev_document_model_set_dual_page_odd_pages_left (ev_window->priv->model, dual_page_odd_left);
2773-+ ev_document_model_set_dual_page_odd_pages_left (window->priv->model,
2774-+ g_variant_get_boolean (state));
2775-+ g_simple_action_set_state (action, state);
2776- }
2777-
2778- static void
2779-@@ -3897,9 +3599,27 @@
2780- }
2781-
2782- static void
2783--ev_window_cmd_fit_page (GtkAction *action, EvWindow *ev_window)
2784--{
2785-- ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FIT_PAGE);
2786-+ev_window_change_sizing_mode_action_state (GSimpleAction *action,
2787-+ GVariant *state,
2788-+ gpointer user_data)
2789-+{
2790-+ EvWindow *window = user_data;
2791-+ const gchar *mode;
2792-+
2793-+ mode = g_variant_get_string (state, NULL);
2794-+
2795-+ if (g_str_equal (mode, "fit-page"))
2796-+ ev_document_model_set_sizing_mode (window->priv->model, EV_SIZING_FIT_PAGE);
2797-+ else if (g_str_equal (mode, "fit-width"))
2798-+ ev_document_model_set_sizing_mode (window->priv->model, EV_SIZING_FIT_WIDTH);
2799-+ else if (g_str_equal (mode, "automatic"))
2800-+ ev_document_model_set_sizing_mode (window->priv->model, EV_SIZING_AUTOMATIC);
2801-+ else if (g_str_equal (mode, "free"))
2802-+ ev_document_model_set_sizing_mode (window->priv->model, EV_SIZING_FREE);
2803-+ else
2804-+ g_assert_not_reached ();
2805-+
2806-+ g_simple_action_set_state (action, state);
2807- }
2808-
2809- static void
2810-@@ -3916,12 +3636,6 @@
2811- }
2812-
2813- static void
2814--ev_window_cmd_fit_width (GtkAction *action, EvWindow *ev_window)
2815--{
2816-- ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FIT_WIDTH);
2817--}
2818--
2819--static void
2820- ev_window_cmd_view_zoom_automatic (GtkAction *action,
2821- EvWindow *ev_window)
2822- {
2823-@@ -3957,29 +3671,28 @@
2824- }
2825-
2826- static void
2827--ev_window_cmd_edit_select_all (GtkAction *action, EvWindow *ev_window)
2828-+ev_window_activate_select_all_action (GSimpleAction *action,
2829-+ GVariant *parameter,
2830-+ gpointer user_data)
2831- {
2832-- g_return_if_fail (EV_IS_WINDOW (ev_window));
2833-+ EvWindow *ev_window = user_data;
2834-
2835- ev_view_select_all (EV_VIEW (ev_window->priv->view));
2836- }
2837-
2838- static void
2839--ev_window_cmd_toggle_find (GtkAction *action, EvWindow *ev_window)
2840-+ev_window_change_find_action_state (GSimpleAction *action,
2841-+ GVariant *state,
2842-+ gpointer user_data)
2843- {
2844-- gboolean show_find_bar;
2845-+ EvWindow *ev_window = user_data;
2846-
2847-- show_find_bar = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2848-- if (show_find_bar)
2849-+ if (g_variant_get_boolean (state))
2850- ev_window_show_find_bar (ev_window);
2851- else
2852- ev_window_close_find_bar (ev_window);
2853--}
2854-
2855--static void
2856--ev_window_cmd_edit_find (GtkAction *action, EvWindow *ev_window)
2857--{
2858-- ev_window_show_find_bar (ev_window);
2859-+ g_simple_action_set_state (action, state);
2860- }
2861-
2862- static void
2863-@@ -4004,8 +3717,11 @@
2864- }
2865-
2866- static void
2867--ev_window_cmd_edit_find_next (GtkAction *action, EvWindow *ev_window)
2868-+ev_window_activate_find_next_action (GSimpleAction *action,
2869-+ GVariant *parameter,
2870-+ gpointer user_data)
2871- {
2872-+ EvWindow *ev_window = user_data;
2873- gboolean find_bar_hidden;
2874-
2875- if (EV_WINDOW_IS_PRESENTATION (ev_window))
2876-@@ -4029,8 +3745,11 @@
2877- }
2878-
2879- static void
2880--ev_window_cmd_edit_find_previous (GtkAction *action, EvWindow *ev_window)
2881-+ev_window_activate_find_previous_action (GSimpleAction *action,
2882-+ GVariant *parameter,
2883-+ gpointer user_data)
2884- {
2885-+ EvWindow *ev_window = user_data;
2886- gboolean find_bar_hidden;
2887-
2888- if (EV_WINDOW_IS_PRESENTATION (ev_window))
2889-@@ -4047,9 +3766,11 @@
2890- }
2891-
2892- static void
2893--ev_window_cmd_edit_copy (GtkAction *action, EvWindow *ev_window)
2894-+ev_window_activate_copy_action (GSimpleAction *action,
2895-+ GVariant *parameter,
2896-+ gpointer user_data)
2897- {
2898-- g_return_if_fail (EV_IS_WINDOW (ev_window));
2899-+ EvWindow *ev_window = user_data;
2900-
2901- ev_view_copy (EV_VIEW (ev_window->priv->view));
2902- }
2903-@@ -4067,15 +3788,12 @@
2904- static void
2905- ev_window_update_fullscreen_action (EvWindow *window)
2906- {
2907-- GtkAction *action;
2908-+ GAction *action;
2909-+ gboolean fullscreen;
2910-
2911-- action = gtk_action_group_get_action (window->priv->action_group, "ViewFullscreen");
2912-- g_signal_handlers_block_by_func
2913-- (action, G_CALLBACK (ev_window_cmd_view_fullscreen), window);
2914-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
2915-- ev_document_model_get_fullscreen (window->priv->model));
2916-- g_signal_handlers_unblock_by_func
2917-- (action, G_CALLBACK (ev_window_cmd_view_fullscreen), window);
2918-+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "fullscreen");
2919-+ fullscreen = ev_document_model_get_fullscreen (window->priv->model);
2920-+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (fullscreen));
2921- }
2922-
2923- static void
2924-@@ -4292,16 +4010,19 @@
2925- }
2926-
2927- static void
2928--ev_window_cmd_view_fullscreen (GtkAction *action, EvWindow *window)
2929-+ev_window_change_fullscreen_action_state (GSimpleAction *action,
2930-+ GVariant *state,
2931-+ gpointer user_data)
2932- {
2933-- gboolean fullscreen;
2934-+ EvWindow *window = user_data;
2935-
2936-- fullscreen = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2937-- if (fullscreen) {
2938-+ if (g_variant_get_boolean (state)) {
2939- ev_window_run_fullscreen (window);
2940- } else {
2941- ev_window_stop_fullscreen (window, TRUE);
2942- }
2943-+
2944-+ g_simple_action_set_state (action, state);
2945- }
2946-
2947- static void
2948-@@ -4336,15 +4057,11 @@
2949- static void
2950- ev_window_update_presentation_action (EvWindow *window)
2951- {
2952-- GtkAction *action;
2953-+ GAction *action;
2954-
2955-- action = gtk_action_group_get_action (window->priv->action_group, "ViewPresentation");
2956-- g_signal_handlers_block_by_func
2957-- (action, G_CALLBACK (ev_window_cmd_view_presentation), window);
2958-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
2959-- EV_WINDOW_IS_PRESENTATION (window));
2960-- g_signal_handlers_unblock_by_func
2961-- (action, G_CALLBACK (ev_window_cmd_view_presentation), window);
2962-+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "presentation");
2963-+ g_simple_action_set_state (G_SIMPLE_ACTION (action),
2964-+ g_variant_new_boolean (EV_WINDOW_IS_PRESENTATION (window)));
2965- }
2966-
2967- static void
2968-@@ -4459,14 +4176,17 @@
2969- }
2970-
2971- static void
2972--ev_window_cmd_view_presentation (GtkAction *action, EvWindow *window)
2973-+ev_window_change_presentation_action_state (GSimpleAction *action,
2974-+ GVariant *state,
2975-+ gpointer user_data)
2976- {
2977-- gboolean presentation;
2978-+ EvWindow *window = user_data;
2979-
2980-- presentation = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
2981-- if (presentation) {
2982-+ if (g_variant_get_boolean (state)) {
2983- ev_window_run_presentation (window);
2984- }
2985-+
2986-+ g_simple_action_set_state (action, state);
2987- }
2988-
2989- static gboolean
2990-@@ -4530,10 +4250,12 @@
2991- ev_window_update_actions_sensitivity (window);
2992- }
2993-
2994--
2995- static void
2996--ev_window_cmd_edit_rotate_left (GtkAction *action, EvWindow *ev_window)
2997-+ev_window_activate_rotate_left_action (GSimpleAction *action,
2998-+ GVariant *parameter,
2999-+ gpointer user_data)
3000- {
3001-+ EvWindow *ev_window = user_data;
3002- gint rotation;
3003-
3004- if (EV_WINDOW_IS_PRESENTATION (ev_window)) {
3005-@@ -4548,8 +4270,11 @@
3006- }
3007-
3008- static void
3009--ev_window_cmd_edit_rotate_right (GtkAction *action, EvWindow *ev_window)
3010-+ev_window_activate_rotate_right_action (GSimpleAction *action,
3011-+ GVariant *parameter,
3012-+ gpointer user_data)
3013- {
3014-+ EvWindow *ev_window = user_data;
3015- gint rotation;
3016-
3017- if (EV_WINDOW_IS_PRESENTATION (ev_window)) {
3018-@@ -4564,16 +4289,23 @@
3019- }
3020-
3021- static void
3022--ev_window_cmd_view_inverted_colors (GtkAction *action, EvWindow *ev_window)
3023-+ev_window_change_inverted_colors_action_state (GSimpleAction *action,
3024-+ GVariant *state,
3025-+ gpointer user_data)
3026- {
3027-- gboolean inverted_colors = ev_document_model_get_inverted_colors (ev_window->priv->model);
3028-+ EvWindow *ev_window = user_data;
3029-
3030-- ev_document_model_set_inverted_colors (ev_window->priv->model, !inverted_colors);
3031-+ ev_document_model_set_inverted_colors (ev_window->priv->model,
3032-+ g_variant_get_boolean (state));
3033-+ g_simple_action_set_state (action, state);
3034- }
3035-
3036- static void
3037--ev_window_cmd_edit_save_settings (GtkAction *action, EvWindow *ev_window)
3038-+ev_window_activate_save_settings_action (GSimpleAction *action,
3039-+ GVariant *state,
3040-+ gpointer user_data)
3041- {
3042-+ EvWindow *ev_window = user_data;
3043- EvWindowPrivate *priv = ev_window->priv;
3044- EvDocumentModel *model = priv->model;
3045- GSettings *settings = priv->default_settings;
3046-@@ -4582,7 +4314,7 @@
3047- g_settings_set_boolean (settings, "continuous",
3048- ev_document_model_get_continuous (model));
3049- g_settings_set_boolean (settings, "dual-page",
3050-- ev_document_model_get_dual_page (model));
3051-+ ev_document_model_get_dual_page (model));
3052- g_settings_set_boolean (settings, "dual-page-odd-left",
3053- ev_document_model_get_dual_page_odd_pages_left (model));
3054- g_settings_set_boolean (settings, "fullscreen",
3055-@@ -4607,59 +4339,78 @@
3056- }
3057-
3058- static void
3059--ev_window_cmd_view_zoom_in (GtkAction *action, EvWindow *ev_window)
3060-+ev_window_activate_zoom_in_action (GSimpleAction *action,
3061-+ GVariant *parameter,
3062-+ gpointer user_data)
3063- {
3064-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3065-+ EvWindow *ev_window = user_data;
3066-+
3067-+ g_return_if_fail (EV_IS_WINDOW (ev_window));
3068-
3069- ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FREE);
3070- ev_view_zoom_in (EV_VIEW (ev_window->priv->view));
3071- }
3072-
3073- static void
3074--ev_window_cmd_view_zoom_out (GtkAction *action, EvWindow *ev_window)
3075-+ev_window_activate_zoom_out_action (GSimpleAction *action,
3076-+ GVariant *parameter,
3077-+ gpointer user_data)
3078- {
3079-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3080-+ EvWindow *ev_window = user_data;
3081-+
3082-+ g_return_if_fail (EV_IS_WINDOW (ev_window));
3083-
3084- ev_document_model_set_sizing_mode (ev_window->priv->model, EV_SIZING_FREE);
3085- ev_view_zoom_out (EV_VIEW (ev_window->priv->view));
3086- }
3087-
3088- static void
3089--ev_window_cmd_go_previous_page (GtkAction *action, EvWindow *ev_window)
3090-+ev_window_activate_go_previous_page_action (GSimpleAction *action,
3091-+ GVariant *parameter,
3092-+ gpointer user_data)
3093- {
3094-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3095-+ EvWindow *window = user_data;
3096-
3097-- ev_view_previous_page (EV_VIEW (ev_window->priv->view));
3098-+ ev_view_previous_page (EV_VIEW (window->priv->view));
3099- }
3100-
3101- static void
3102--ev_window_cmd_go_next_page (GtkAction *action, EvWindow *ev_window)
3103-+ev_window_activate_go_next_page_action (GSimpleAction *action,
3104-+ GVariant *parameter,
3105-+ gpointer user_data)
3106- {
3107-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3108-+ EvWindow *window = user_data;
3109-
3110-- ev_view_next_page (EV_VIEW (ev_window->priv->view));
3111-+ ev_view_next_page (EV_VIEW (window->priv->view));
3112- }
3113-
3114- static void
3115--ev_window_cmd_go_first_page (GtkAction *action, EvWindow *ev_window)
3116-+ev_window_activate_go_first_page_action (GSimpleAction *action,
3117-+ GVariant *parameter,
3118-+ gpointer user_data)
3119- {
3120-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3121-+ EvWindow *window = user_data;
3122-
3123-- ev_document_model_set_page (ev_window->priv->model, 0);
3124-+ ev_document_model_set_page (window->priv->model, 0);
3125- }
3126-
3127- static void
3128--ev_window_cmd_go_last_page (GtkAction *action, EvWindow *ev_window)
3129-+ev_window_activate_go_last_page_action (GSimpleAction *action,
3130-+ GVariant *parameter,
3131-+ gpointer user_data)
3132- {
3133-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3134-+ EvWindow *window = user_data;
3135-
3136-- ev_document_model_set_page (ev_window->priv->model,
3137-- ev_document_get_n_pages (ev_window->priv->document) - 1);
3138-+ ev_document_model_set_page (window->priv->model,
3139-+ ev_document_get_n_pages (window->priv->document) - 1);
3140- }
3141-
3142- static void
3143--ev_window_cmd_go_forward (GtkAction *action, EvWindow *ev_window)
3144-+ev_window_activate_go_forward_action (GSimpleAction *action,
3145-+ GVariant *parameter,
3146-+ gpointer user_data)
3147- {
3148-+ EvWindow *ev_window = user_data;
3149- int n_pages, current_page;
3150-
3151- g_return_if_fail (EV_IS_WINDOW (ev_window));
3152-@@ -4673,11 +4424,14 @@
3153- }
3154-
3155- static void
3156--ev_window_cmd_go_backward (GtkAction *action, EvWindow *ev_window)
3157-+ev_window_activate_go_backward_action (GSimpleAction *action,
3158-+ GVariant *parameter,
3159-+ gpointer user_data)
3160- {
3161-+ EvWindow *ev_window = user_data;
3162- int current_page;
3163--
3164-- g_return_if_fail (EV_IS_WINDOW (ev_window));
3165-+
3166-+ g_return_if_fail (EV_IS_WINDOW (ev_window));
3167-
3168- current_page = ev_document_model_get_page (ev_window->priv->model);
3169-
3170-@@ -4686,15 +4440,6 @@
3171- }
3172- }
3173-
3174--static void
3175--ev_window_cmd_bookmark_activate (GtkAction *action,
3176-- EvWindow *window)
3177--{
3178-- guint page = ev_bookmark_action_get_page (EV_BOOKMARK_ACTION (action));
3179--
3180-- ev_document_model_set_page (window->priv->model, page);
3181--}
3182--
3183- static gint
3184- compare_bookmarks (EvBookmark *a,
3185- EvBookmark *b)
3186-@@ -4705,59 +4450,33 @@
3187- static void
3188- ev_window_setup_bookmarks (EvWindow *window)
3189- {
3190-- GList *items, *l;
3191-+ GList *items, *it;
3192-
3193-- if (!window->priv->bookmarks)
3194-- return;
3195-+ g_menu_remove_all (window->priv->bookmarks_menu);
3196-
3197-- if (window->priv->bookmarks_ui_id > 0) {
3198-- gtk_ui_manager_remove_ui (window->priv->ui_manager,
3199-- window->priv->bookmarks_ui_id);
3200-- gtk_ui_manager_ensure_update (window->priv->ui_manager);
3201-- }
3202-- window->priv->bookmarks_ui_id = gtk_ui_manager_new_merge_id (window->priv->ui_manager);
3203-+ items = g_list_sort (ev_bookmarks_get_bookmarks (window->priv->bookmarks),
3204-+ (GCompareFunc) compare_bookmarks);
3205-
3206-- if (window->priv->bookmarks_action_group) {
3207-- gtk_ui_manager_remove_action_group (window->priv->ui_manager,
3208-- window->priv->bookmarks_action_group);
3209-- g_object_unref (window->priv->bookmarks_action_group);
3210-- }
3211-- window->priv->bookmarks_action_group = gtk_action_group_new ("BookmarksActions");
3212-- gtk_ui_manager_insert_action_group (window->priv->ui_manager,
3213-- window->priv->bookmarks_action_group, -1);
3214-+ for (it = items; it; it = it->next) {
3215-+ EvBookmark *bookmark = it->data;
3216-+ GMenuItem *item;
3217-
3218-- items = ev_bookmarks_get_bookmarks (window->priv->bookmarks);
3219-- items = g_list_sort (items, (GCompareFunc)compare_bookmarks);
3220-+ item = g_menu_item_new (bookmark->title, NULL);
3221-+ g_menu_item_set_action_and_target (item, "win.goto-bookmark", "u", bookmark->page);
3222-+ g_menu_append_item (window->priv->bookmarks_menu, item);
3223-
3224-- for (l = items; l && l->data; l = g_list_next (l)) {
3225-- EvBookmark *bm = (EvBookmark *)l->data;
3226-- GtkAction *action;
3227--
3228-- action = ev_bookmark_action_new (bm);
3229-- g_signal_connect (action, "activate",
3230-- G_CALLBACK (ev_window_cmd_bookmark_activate),
3231-- window);
3232-- gtk_action_group_add_action (window->priv->bookmarks_action_group,
3233-- action);
3234--
3235-- gtk_ui_manager_add_ui (window->priv->ui_manager,
3236-- window->priv->bookmarks_ui_id,
3237-- "/ActionMenu/BookmarksMenu/BookmarksItems",
3238-- gtk_action_get_label (action),
3239-- gtk_action_get_name (action),
3240-- GTK_UI_MANAGER_MENUITEM,
3241-- FALSE);
3242--
3243-- g_object_unref (action);
3244-+ g_object_unref (item);
3245- }
3246-
3247- g_list_free (items);
3248- }
3249-
3250- static void
3251--ev_window_cmd_bookmarks_add (GtkAction *action,
3252-- EvWindow *window)
3253-+ev_window_activate_add_bookmark_action (GSimpleAction *action,
3254-+ GVariant *parameter,
3255-+ gpointer user_data)
3256- {
3257-+ EvWindow *window = user_data;
3258- EvBookmark bm;
3259- gchar *page_label;
3260-
3261-@@ -4771,32 +4490,41 @@
3262- }
3263-
3264- static void
3265--ev_window_cmd_view_reload (GtkAction *action, EvWindow *ev_window)
3266-+ev_window_activate_goto_bookmark_action (GSimpleAction *action,
3267-+ GVariant *parameter,
3268-+ gpointer user_data)
3269- {
3270-- ev_window_reload_document (ev_window, NULL);
3271--}
3272-+ EvWindow *window = user_data;
3273-
3274--static void
3275--ev_window_cmd_view_autoscroll (GtkAction *action, EvWindow *ev_window)
3276--{
3277-- ev_view_autoscroll_start (EV_VIEW (ev_window->priv->view));
3278-+ ev_document_model_set_page (window->priv->model, g_variant_get_uint32 (parameter));
3279- }
3280-
3281- static void
3282--ev_window_cmd_leave_fullscreen (GtkAction *action, EvWindow *window)
3283-+ev_window_activate_reload_action (GSimpleAction *action,
3284-+ GVariant *parameter,
3285-+ gpointer user_data)
3286- {
3287-- ev_window_stop_fullscreen (window, TRUE);
3288-+ EvWindow *ev_window = user_data;
3289-+
3290-+ ev_window_reload_document (ev_window, NULL);
3291- }
3292-
3293- static void
3294--ev_window_cmd_start_presentation (GtkAction *action, EvWindow *window)
3295-+ev_window_activate_auto_scroll_action (GSimpleAction *action,
3296-+ GVariant *parameter,
3297-+ gpointer user_data)
3298- {
3299-- ev_window_run_presentation (window);
3300-+ EvWindow *ev_window = user_data;
3301-+
3302-+ ev_view_autoscroll_start (EV_VIEW (ev_window->priv->view));
3303- }
3304-
3305- static void
3306--ev_window_cmd_escape (GtkAction *action, EvWindow *window)
3307-+ev_window_activate_escape_action (GSimpleAction *action,
3308-+ GVariant *parameter,
3309-+ gpointer user_data)
3310- {
3311-+ EvWindow *window = user_data;
3312- ev_view_autoscroll_stop (EV_VIEW (window->priv->view));
3313-
3314- if (gtk_widget_get_visible (window->priv->find_bar))
3315-@@ -4890,29 +4618,20 @@
3316- }
3317-
3318- static void
3319--ev_window_update_continuous_action (EvWindow *window)
3320--{
3321-- GtkAction *action;
3322--
3323-- action = gtk_action_group_get_action (window->priv->action_group, "ViewContinuous");
3324-- g_signal_handlers_block_by_func
3325-- (action, G_CALLBACK (ev_window_cmd_continuous), window);
3326-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
3327-- ev_document_model_get_continuous (window->priv->model));
3328-- g_signal_handlers_unblock_by_func
3329-- (action, G_CALLBACK (ev_window_cmd_continuous), window);
3330--}
3331--
3332--static void
3333- ev_window_continuous_changed_cb (EvDocumentModel *model,
3334- GParamSpec *pspec,
3335- EvWindow *ev_window)
3336- {
3337-- ev_window_update_continuous_action (ev_window);
3338-+ gboolean continuous;
3339-+ GAction *action;
3340-+
3341-+ continuous = ev_document_model_get_continuous (model);
3342-+
3343-+ action = g_action_map_lookup_action (G_ACTION_MAP (ev_window), "continuous");
3344-+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (continuous));
3345-
3346- if (ev_window->priv->metadata && !ev_window_is_empty (ev_window))
3347-- ev_metadata_set_boolean (ev_window->priv->metadata, "continuous",
3348-- ev_document_model_get_continuous (model));
3349-+ ev_metadata_set_boolean (ev_window->priv->metadata, "continuous", continuous);
3350- }
3351-
3352- static void
3353-@@ -4930,27 +4649,16 @@
3354- }
3355-
3356- static void
3357--ev_window_update_inverted_colors_action (EvWindow *window)
3358--{
3359-- GtkAction *action;
3360--
3361-- action = gtk_action_group_get_action (window->priv->action_group, "ViewInvertedColors");
3362-- g_signal_handlers_block_by_func
3363-- (action, G_CALLBACK (ev_window_cmd_view_inverted_colors), window);
3364-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
3365-- ev_document_model_get_inverted_colors (window->priv->model));
3366-- g_signal_handlers_unblock_by_func
3367-- (action, G_CALLBACK (ev_window_cmd_view_inverted_colors), window);
3368--}
3369--
3370--static void
3371- ev_window_inverted_colors_changed_cb (EvDocumentModel *model,
3372- GParamSpec *pspec,
3373- EvWindow *window)
3374- {
3375- gboolean inverted_colors = ev_document_model_get_inverted_colors (model);
3376-+ GAction *action;
3377-
3378-- ev_window_update_inverted_colors_action (window);
3379-+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "inverted-colors");
3380-+ g_simple_action_set_state (G_SIMPLE_ACTION (action),
3381-+ g_variant_new_boolean (inverted_colors));
3382-
3383- if (window->priv->metadata && !ev_window_is_empty (window))
3384- ev_metadata_set_boolean (window->priv->metadata, "inverted-colors",
3385-@@ -4960,43 +4668,20 @@
3386- }
3387-
3388- static void
3389--ev_window_update_dual_page_action (EvWindow *window)
3390--{
3391-- GtkAction *action;
3392--
3393-- action = gtk_action_group_get_action (window->priv->action_group, "ViewDual");
3394-- g_signal_handlers_block_by_func
3395-- (action, G_CALLBACK (ev_window_cmd_dual), window);
3396-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
3397-- ev_document_model_get_dual_page (window->priv->model));
3398-- g_signal_handlers_unblock_by_func
3399-- (action, G_CALLBACK (ev_window_cmd_dual), window);
3400--}
3401--
3402--static void
3403- ev_window_dual_mode_changed_cb (EvDocumentModel *model,
3404- GParamSpec *pspec,
3405- EvWindow *ev_window)
3406- {
3407-- ev_window_update_dual_page_action (ev_window);
3408-+ gboolean dual_page;
3409-+ GAction *action;
3410-
3411-- if (ev_window->priv->metadata && !ev_window_is_empty (ev_window))
3412-- ev_metadata_set_boolean (ev_window->priv->metadata, "dual-page",
3413-- ev_document_model_get_dual_page (model));
3414--}
3415-+ dual_page = ev_document_model_get_dual_page (model);
3416-
3417--static void
3418--ev_window_update_dual_page_odd_pages_left_action (EvWindow *window)
3419--{
3420-- GtkAction *action;
3421-+ action = g_action_map_lookup_action (G_ACTION_MAP (ev_window), "dual-page");
3422-+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (dual_page));
3423-
3424-- action = gtk_action_group_get_action (window->priv->action_group, "ViewDualOddLeft");
3425-- g_signal_handlers_block_by_func
3426-- (action, G_CALLBACK (ev_window_cmd_dual_odd_pages_left), window);
3427-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
3428-- ev_document_model_get_dual_page_odd_pages_left (window->priv->model));
3429-- g_signal_handlers_unblock_by_func
3430-- (action, G_CALLBACK (ev_window_cmd_dual_odd_pages_left), window);
3431-+ if (ev_window->priv->metadata && !ev_window_is_empty (ev_window))
3432-+ ev_metadata_set_boolean (ev_window->priv->metadata, "dual-page", dual_page);
3433- }
3434-
3435- static void
3436-@@ -5004,119 +4689,36 @@
3437- GParamSpec *pspec,
3438- EvWindow *ev_window)
3439- {
3440-- ev_window_update_dual_page_odd_pages_left_action (ev_window);
3441--
3442- if (ev_window->priv->metadata && !ev_window_is_empty (ev_window))
3443- ev_metadata_set_boolean (ev_window->priv->metadata, "dual-page-odd-left",
3444- ev_document_model_get_dual_page_odd_pages_left (model));
3445- }
3446-
3447--static char *
3448--build_comments_string (EvDocument *document)
3449--{
3450-- gchar *comments = NULL;
3451-- EvDocumentBackendInfo info;
3452--
3453-- if (document && ev_document_get_backend_info (document, &info)) {
3454-- comments = g_strdup_printf (
3455-- _("Document Viewer\nUsing %s (%s)"),
3456-- info.name, info.version);
3457-- } else {
3458-- comments = g_strdup_printf (
3459-- _("Document Viewer"));
3460-- }
3461--
3462-- return comments;
3463--}
3464--
3465- static void
3466--ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
3467-+ev_window_activate_open_menu_command (GSimpleAction *action,
3468-+ GVariant *parameter,
3469-+ gpointer user_data)
3470- {
3471-- const char *authors[] = {
3472-- "Martin Kretzschmar <m_kretzschmar@gmx.net>",
3473-- "Jonathan Blandford <jrb@gnome.org>",
3474-- "Marco Pesenti Gritti <marco@gnome.org>",
3475-- "Nickolay V. Shmyrev <nshmyrev@yandex.ru>",
3476-- "Bryan Clark <clarkbw@gnome.org>",
3477-- "Carlos Garcia Campos <carlosgc@gnome.org>",
3478-- "Wouter Bolsterlee <wbolster@gnome.org>",
3479-- "Christian Persch <chpe" "\100" "gnome.org>",
3480-- NULL
3481-- };
3482-+ EvWindow *ev_window = user_data;
3483-
3484-- const char *documenters[] = {
3485-- "Nickolay V. Shmyrev <nshmyrev@yandex.ru>",
3486-- "Phil Bull <philbull@gmail.com>",
3487-- "Tiffany Antpolski <tiffany.antopolski@gmail.com>",
3488-- NULL
3489-- };
3490--
3491-- const char *license[] = {
3492-- N_("Evince is free software; you can redistribute it and/or modify "
3493-- "it under the terms of the GNU General Public License as published by "
3494-- "the Free Software Foundation; either version 2 of the License, or "
3495-- "(at your option) any later version.\n"),
3496-- N_("Evince is distributed in the hope that it will be useful, "
3497-- "but WITHOUT ANY WARRANTY; without even the implied warranty of "
3498-- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
3499-- "GNU General Public License for more details.\n"),
3500-- N_("You should have received a copy of the GNU General Public License "
3501-- "along with Evince; if not, write to the Free Software Foundation, Inc., "
3502-- "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n")
3503-- };
3504--
3505-- char *license_trans;
3506-- char *comments;
3507--
3508--#ifdef ENABLE_NLS
3509-- const char **p;
3510--
3511-- for (p = authors; *p; ++p)
3512-- *p = _(*p);
3513--
3514-- for (p = documenters; *p; ++p)
3515-- *p = _(*p);
3516--#endif
3517--
3518-- license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n",
3519-- _(license[2]), "\n", NULL);
3520--
3521-- comments = build_comments_string (ev_window->priv->document);
3522--
3523-- gtk_show_about_dialog (
3524-- GTK_WINDOW (ev_window),
3525-- "name", _("Evince"),
3526-- "version", VERSION,
3527-- "copyright",
3528-- _("© 1996–2012 The Evince authors"),
3529-- "license", license_trans,
3530-- "website", "http://www.gnome.org/projects/evince",
3531-- "comments", comments,
3532-- "authors", authors,
3533-- "documenters", documenters,
3534-- "translator-credits", _("translator-credits"),
3535-- "logo-icon-name", "evince",
3536-- "wrap-license", TRUE,
3537-- NULL);
3538--
3539-- g_free (comments);
3540-- g_free (license_trans);
3541--}
3542--
3543--static void
3544--ev_window_cmd_action_menu (GtkAction *action, EvWindow *ev_window)
3545--{
3546- ev_toolbar_action_menu_popup (EV_TOOLBAR (ev_window->priv->toolbar));
3547- }
3548-
3549- static void
3550--ev_window_view_sidebar_cb (GtkAction *action, EvWindow *ev_window)
3551-+ev_window_change_show_side_pane_action_state (GSimpleAction *action,
3552-+ GVariant *state,
3553-+ gpointer user_data)
3554- {
3555-+ EvWindow *ev_window = user_data;
3556-+ gboolean show_side_pane;
3557-+
3558- if (EV_WINDOW_IS_PRESENTATION (ev_window))
3559- return;
3560--
3561-- update_chrome_flag (ev_window, EV_CHROME_SIDEBAR,
3562-- gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
3563-+
3564-+ show_side_pane = g_variant_get_boolean (state);
3565-+ g_simple_action_set_state (action, g_variant_new_boolean (show_side_pane));
3566-+
3567-+ update_chrome_flag (ev_window, EV_CHROME_SIDEBAR, show_side_pane);
3568- update_chrome_visibility (ev_window);
3569- }
3570-
3571-@@ -5137,14 +4739,11 @@
3572- GParamSpec *pspec,
3573- EvWindow *ev_window)
3574- {
3575-- GtkAction *action;
3576--
3577-- action = gtk_action_group_get_action (ev_window->priv->action_group, "ViewSidebar");
3578--
3579- if (!EV_WINDOW_IS_PRESENTATION (ev_window)) {
3580- gboolean visible = gtk_widget_get_visible (GTK_WIDGET (ev_sidebar));
3581-
3582-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
3583-+ g_action_group_change_action_state (G_ACTION_GROUP (ev_window), "show-side-pane",
3584-+ g_variant_new_boolean (visible));
3585-
3586- if (ev_window->priv->metadata)
3587- ev_metadata_set_boolean (ev_window->priv->metadata, "sidebar_visibility",
3588-@@ -5154,14 +4753,10 @@
3589- }
3590- }
3591-
3592--static void
3593-+static GMenuModel *
3594- view_menu_link_popup (EvWindow *ev_window,
3595- EvLink *link)
3596- {
3597-- gboolean show_external = FALSE;
3598-- gboolean show_internal = FALSE;
3599-- GtkAction *action;
3600--
3601- if (ev_window->priv->link)
3602- g_object_unref (ev_window->priv->link);
3603-
3604-@@ -5178,42 +4773,23 @@
3605- switch (ev_link_action_get_action_type (ev_action)) {
3606- case EV_LINK_ACTION_TYPE_GOTO_DEST:
3607- case EV_LINK_ACTION_TYPE_GOTO_REMOTE:
3608-- show_internal = TRUE;
3609-- break;
3610-+ return ev_window->priv->internal_link_section;
3611- case EV_LINK_ACTION_TYPE_EXTERNAL_URI:
3612- case EV_LINK_ACTION_TYPE_LAUNCH:
3613-- show_external = TRUE;
3614-- break;
3615-- default:
3616-- break;
3617-+ return ev_window->priv->external_link_section;
3618-+ default:
3619-+ return NULL;
3620- }
3621- }
3622- }
3623--
3624-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3625-- "OpenLink");
3626-- gtk_action_set_visible (action, show_external);
3627--
3628-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3629-- "CopyLinkAddress");
3630-- gtk_action_set_visible (action, show_external);
3631--
3632-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3633-- "GoLink");
3634-- gtk_action_set_visible (action, show_internal);
3635--
3636-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3637-- "OpenLinkNewWindow");
3638-- gtk_action_set_visible (action, show_internal);
3639-+
3640-+ return NULL;
3641- }
3642-
3643--static void
3644-+static GMenuModel *
3645- view_menu_image_popup (EvWindow *ev_window,
3646- EvImage *image)
3647- {
3648-- GtkAction *action;
3649-- gboolean show_image = FALSE;
3650--
3651- if (ev_window->priv->image)
3652- g_object_unref (ev_window->priv->image);
3653-
3654-@@ -5222,38 +4798,22 @@
3655- else
3656- ev_window->priv->image = NULL;
3657-
3658-- show_image = (ev_window->priv->image != NULL);
3659--
3660-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3661-- "SaveImageAs");
3662-- gtk_action_set_visible (action, show_image);
3663--
3664-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3665-- "CopyImage");
3666-- gtk_action_set_visible (action, show_image);
3667-+ return ev_window->priv->image != NULL ? ev_window->priv->image_section : NULL;
3668- }
3669-
3670--static void
3671-+static GMenuModel *
3672- view_menu_annot_popup (EvWindow *ev_window,
3673- EvAnnotation *annot)
3674- {
3675-- GtkAction *action;
3676-- gboolean show_annot = FALSE;
3677--
3678- if (ev_window->priv->annot)
3679- g_object_unref (ev_window->priv->annot);
3680- ev_window->priv->annot = (annot) ? g_object_ref (annot) : NULL;
3681-
3682-- action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
3683-- "AnnotProperties");
3684-- gtk_action_set_visible (action, (annot != NULL && EV_IS_ANNOTATION_MARKUP (annot)));
3685--
3686- if (annot && EV_IS_ANNOTATION_ATTACHMENT (annot)) {
3687- EvAttachment *attachment;
3688-
3689- attachment = ev_annotation_attachment_get_attachment (EV_ANNOTATION_ATTACHMENT (annot));
3690- if (attachment) {
3691-- show_annot = TRUE;
3692- if (ev_window->priv->attach_list) {
3693- g_list_foreach (ev_window->priv->attach_list,
3694- (GFunc) g_object_unref, NULL);
3695-@@ -5263,16 +4823,43 @@
3696- ev_window->priv->attach_list =
3697- g_list_prepend (ev_window->priv->attach_list,
3698- g_object_ref (attachment));
3699-+
3700-+ return ev_window->priv->annotation_section;
3701- }
3702- }
3703-
3704-- action = gtk_action_group_get_action (ev_window->priv->attachment_popup_action_group,
3705-- "OpenAttachment");
3706-- gtk_action_set_visible (action, show_annot);
3707--
3708-- action = gtk_action_group_get_action (ev_window->priv->attachment_popup_action_group,
3709-- "SaveAttachmentAs");
3710-- gtk_action_set_visible (action, show_annot);
3711-+ return NULL;
3712-+}
3713-+
3714-+static void
3715-+popup_menu_detach (GtkWidget *attach_widget,
3716-+ GtkMenu *menu)
3717-+{
3718-+ EvWindow *window = EV_WINDOW (attach_widget);
3719-+
3720-+ window->priv->popup_menu = NULL;
3721-+}
3722-+
3723-+static GMenu *
3724-+menu_new_copy (GMenuModel *source)
3725-+{
3726-+ GMenu *menu;
3727-+ gint n_items;
3728-+ gint i;
3729-+
3730-+ menu = g_menu_new ();
3731-+
3732-+ n_items = g_menu_model_get_n_items (source);
3733-+ for (i = 0; i < n_items; i++) {
3734-+ GMenuItem *item;
3735-+
3736-+ item = g_menu_item_new_from_model (source, i);
3737-+ g_menu_append_item (menu, item);
3738-+
3739-+ g_object_unref (item);
3740-+ }
3741-+
3742-+ return menu;
3743- }
3744-
3745- static gboolean
3746-@@ -5280,34 +4867,44 @@
3747- GList *items,
3748- EvWindow *ev_window)
3749- {
3750-- GList *l;
3751-- gboolean has_link = FALSE;
3752-- gboolean has_image = FALSE;
3753-- gboolean has_annot = FALSE;
3754-+ GList *l;
3755-+ GMenu *popup;
3756-+
3757-+ if (ev_window->priv->popup_menu) {
3758-+ gtk_widget_destroy (ev_window->priv->popup_menu);
3759-+ ev_window->priv->popup_menu = NULL;
3760-+ }
3761-+
3762-+ /* make a deep copy of the base menu to append the optionally
3763-+ * visible sections to */
3764-+ popup = menu_new_copy (ev_window->priv->document_view_menu);
3765-
3766- for (l = items; l; l = g_list_next (l)) {
3767- if (EV_IS_LINK (l->data)) {
3768-- view_menu_link_popup (ev_window, EV_LINK (l->data));
3769-- has_link = TRUE;
3770-+ GMenuModel *section = view_menu_link_popup (ev_window, EV_LINK (l->data));
3771-+ if (section)
3772-+ g_menu_prepend_section (popup, NULL, section);
3773- } else if (EV_IS_IMAGE (l->data)) {
3774-- view_menu_image_popup (ev_window, EV_IMAGE (l->data));
3775-- has_image = TRUE;
3776-+ GMenuModel *section = view_menu_image_popup (ev_window, EV_IMAGE (l->data));
3777-+ if (section)
3778-+ g_menu_append_section (popup, NULL, section);
3779- } else if (EV_IS_ANNOTATION (l->data)) {
3780-- view_menu_annot_popup (ev_window, EV_ANNOTATION (l->data));
3781-- has_annot = TRUE;
3782-+ GMenuModel *section = view_menu_annot_popup (ev_window, EV_ANNOTATION (l->data));
3783-+ if (section)
3784-+ g_menu_append_section (popup, NULL, section);
3785- }
3786- }
3787-
3788-- if (!has_link)
3789-- view_menu_link_popup (ev_window, NULL);
3790-- if (!has_image)
3791-- view_menu_image_popup (ev_window, NULL);
3792-- if (!has_annot)
3793-- view_menu_annot_popup (ev_window, NULL);
3794-+ if (g_menu_model_get_n_items (G_MENU_MODEL (popup)) > 0) {
3795-+ ev_window->priv->popup_menu = gtk_menu_new_from_model (G_MENU_MODEL (popup));
3796-+ gtk_menu_attach_to_widget (GTK_MENU (ev_window->priv->popup_menu),
3797-+ GTK_WIDGET (ev_window), popup_menu_detach);
3798-
3799-- gtk_menu_popup (GTK_MENU (ev_window->priv->view_popup),
3800-- NULL, NULL, NULL, NULL,
3801-- 3, gtk_get_current_event_time ());
3802-+ gtk_menu_popup (GTK_MENU (ev_window->priv->popup_menu), NULL, NULL, NULL, NULL,
3803-+ 3, gtk_get_current_event_time ());
3804-+ }
3805-+
3806-+ g_object_unref (popup);
3807- return TRUE;
3808- }
3809-
3810-@@ -5316,8 +4913,6 @@
3811- GList *attach_list,
3812- EvWindow *ev_window)
3813- {
3814-- GtkWidget *popup;
3815--
3816- g_assert (attach_list != NULL);
3817-
3818- if (ev_window->priv->attach_list) {
3819-@@ -5325,13 +4920,19 @@
3820- (GFunc) g_object_unref, NULL);
3821- g_list_free (ev_window->priv->attach_list);
3822- }
3823--
3824-+
3825- ev_window->priv->attach_list = attach_list;
3826--
3827-- popup = ev_window->priv->attachment_popup;
3828-
3829-- gtk_menu_popup (GTK_MENU (popup), NULL, NULL,
3830-- NULL, NULL,
3831-+ if (ev_window->priv->popup_menu) {
3832-+ gtk_widget_destroy (ev_window->priv->popup_menu);
3833-+ ev_window->priv->popup_menu = NULL;
3834-+ }
3835-+
3836-+ ev_window->priv->popup_menu = gtk_menu_new_from_model (ev_window->priv->attachment_section);
3837-+ gtk_menu_attach_to_widget (GTK_MENU (ev_window->priv->popup_menu),
3838-+ GTK_WIDGET (ev_window), popup_menu_detach);
3839-+
3840-+ gtk_menu_popup (GTK_MENU (ev_window->priv->popup_menu), NULL, NULL, NULL, NULL,
3841- 3, gtk_get_current_event_time ());
3842-
3843- return TRUE;
3844-@@ -5542,21 +5143,6 @@
3845- }
3846-
3847- static void
3848--update_toggle_find_action (EvWindow *ev_window,
3849-- gboolean active)
3850--{
3851-- GtkAction *action;
3852--
3853-- action = gtk_action_group_get_action (ev_window->priv->action_group, "EditFind");
3854-- if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) == active)
3855-- return;
3856--
3857-- g_signal_handlers_block_by_func (action, G_CALLBACK (ev_window_cmd_toggle_find), ev_window);
3858-- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
3859-- g_signal_handlers_unblock_by_func (action, G_CALLBACK (ev_window_cmd_toggle_find), ev_window);
3860--}
3861--
3862--static void
3863- ev_window_show_find_bar (EvWindow *ev_window)
3864- {
3865- if (gtk_widget_get_visible (ev_window->priv->find_bar)) {
3866-@@ -5583,7 +5169,7 @@
3867- update_chrome_flag (ev_window, EV_CHROME_FINDBAR, TRUE);
3868- update_chrome_visibility (ev_window);
3869- gtk_widget_grab_focus (ev_window->priv->find_bar);
3870-- update_toggle_find_action (ev_window, TRUE);
3871-+ g_action_group_change_action_state (G_ACTION_GROUP (ev_window), "find", g_variant_new_boolean (TRUE));
3872- }
3873-
3874- static void
3875-@@ -5601,7 +5187,7 @@
3876- update_chrome_flag (ev_window, EV_CHROME_FINDBAR, FALSE);
3877- update_chrome_visibility (ev_window);
3878- gtk_widget_grab_focus (ev_window->priv->view);
3879-- update_toggle_find_action (ev_window, FALSE);
3880-+ g_action_group_change_action_state (G_ACTION_GROUP (ev_window), "find", g_variant_new_boolean (FALSE));
3881-
3882- ev_history_thaw (ev_window->priv->history);
3883- }
3884-@@ -5651,10 +5237,15 @@
3885- ev_window_set_caret_navigation_enabled (EvWindow *window,
3886- gboolean enabled)
3887- {
3888-+ GAction *action;
3889-+
3890- if (window->priv->metadata)
3891- ev_metadata_set_boolean (window->priv->metadata, "caret-navigation", enabled);
3892-
3893- ev_view_set_caret_navigation_enabled (EV_VIEW (window->priv->view), enabled);
3894-+
3895-+ action = g_action_map_lookup_action (G_ACTION_MAP (window), "caret-navigation");
3896-+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (enabled));
3897- }
3898-
3899- static void
3900-@@ -5668,7 +5259,7 @@
3901-
3902- /* Turn the confirmation dialog off if the user has requested not to show it again */
3903- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (window->priv->ask_caret_navigation_check))) {
3904-- g_settings_set_boolean (ev_window_ensure_settings (window), "show-caret-navigation-message", FALSE);
3905-+ g_settings_set_boolean (ev_application_get_settings (EV_APP), "show-caret-navigation-message", FALSE);
3906- g_settings_apply (window->priv->settings);
3907- }
3908-
3909-@@ -5678,9 +5269,11 @@
3910- }
3911-
3912- static void
3913--ev_window_cmd_view_toggle_caret_navigation (GtkAction *action,
3914-- EvWindow *window)
3915-+ev_window_change_caret_navigation_action_state (GSimpleAction *action,
3916-+ GVariant *state,
3917-+ gpointer user_data)
3918- {
3919-+ EvWindow *window = user_data;
3920- GtkWidget *message_area;
3921- GtkWidget *box;
3922- GtkWidget *hbox;
3923-@@ -5689,7 +5282,7 @@
3924- /* Don't ask for user confirmation to turn the caret navigation off when it is active,
3925- * or to turn it on when the confirmation dialog is not to be shown per settings */
3926- enabled = ev_view_is_caret_navigation_enabled (EV_VIEW (window->priv->view));
3927-- if (enabled || !g_settings_get_boolean (ev_window_ensure_settings (window), "show-caret-navigation-message")) {
3928-+ if (enabled || !g_settings_get_boolean (ev_application_get_settings (EV_APP), "show-caret-navigation-message")) {
3929- ev_window_set_caret_navigation_enabled (window, !enabled);
3930- return;
3931- }
3932-@@ -5793,40 +5386,24 @@
3933- priv->action_group = NULL;
3934- }
3935-
3936-- if (priv->view_popup_action_group) {
3937-- g_object_unref (priv->view_popup_action_group);
3938-- priv->view_popup_action_group = NULL;
3939-- }
3940--
3941-- if (priv->attachment_popup_action_group) {
3942-- g_object_unref (priv->attachment_popup_action_group);
3943-- priv->attachment_popup_action_group = NULL;
3944-- }
3945-+ g_clear_object (&priv->document_view_menu);
3946-+ g_clear_object (&priv->external_link_section);
3947-+ g_clear_object (&priv->internal_link_section);
3948-+ g_clear_object (&priv->image_section);
3949-+ g_clear_object (&priv->attachment_section);
3950-+ g_clear_object (&priv->annotation_section);
3951-
3952- g_clear_object (&priv->zoom_selector_popup_action_group);
3953-
3954-- if (priv->recent_action_group) {
3955-- g_object_unref (priv->recent_action_group);
3956-- priv->recent_action_group = NULL;
3957-- }
3958--
3959- if (priv->bookmarks_action_group) {
3960- g_object_unref (priv->bookmarks_action_group);
3961- priv->bookmarks_action_group = NULL;
3962- }
3963-
3964- if (priv->recent_manager) {
3965-- g_signal_handlers_disconnect_by_func (priv->recent_manager,
3966-- ev_window_setup_recent,
3967-- window);
3968- priv->recent_manager = NULL;
3969- }
3970-
3971-- if (priv->settings) {
3972-- g_object_unref (priv->settings);
3973-- priv->settings = NULL;
3974-- }
3975--
3976- if (priv->default_settings) {
3977- g_settings_apply (priv->default_settings);
3978- g_object_unref (priv->default_settings);
3979-@@ -5838,8 +5415,6 @@
3980- priv->lockdown_settings = NULL;
3981- }
3982-
3983-- priv->recent_ui_id = 0;
3984--
3985- if (priv->model) {
3986- g_signal_handlers_disconnect_by_func (priv->model,
3987- ev_window_page_changed_cb,
3988-@@ -5955,7 +5530,6 @@
3989- G_OBJECT_CLASS (ev_window_parent_class)->dispose (object);
3990- }
3991-
3992--
3993- /*
3994- * GtkWindow catches keybindings for the menu items _before_ passing them to
3995- * the focused widget. This is unfortunate and means that pressing Ctrl+a,
3996-@@ -6012,206 +5586,6 @@
3997- g_type_class_add_private (g_object_class, sizeof (EvWindowPrivate));
3998- }
3999-
4000--/* Normal items */
4001--static const GtkActionEntry entries[] = {
4002-- { "Bookmarks", NULL, N_("_Bookmarks") },
4003-- { "RecentFiles", NULL, N_("_Recent") },
4004--
4005-- /* File menu */
4006-- { "FileOpen", GTK_STOCK_OPEN, N_("_Open…"), "<control>O",
4007-- N_("Open an existing document"),
4008-- G_CALLBACK (ev_window_cmd_file_open) },
4009-- { "FileOpenCopy", NULL, N_("Op_en a Copy"), "<control>N",
4010-- N_("Open a copy of the current document in a new window"),
4011-- G_CALLBACK (ev_window_cmd_file_open_copy) },
4012-- { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy…"), "<control>S",
4013-- N_("Save a copy of the current document"),
4014-- G_CALLBACK (ev_window_cmd_save_as) },
4015-- { "FileSendTo", EV_STOCK_SEND_TO, N_("Send _To…"), NULL,
4016-- N_("Send current document by mail, instant message…"),
4017-- G_CALLBACK (ev_window_cmd_send_to) },
4018-- { "FileOpenContainingFolder", GTK_STOCK_DIRECTORY, N_("Open Containing _Folder"), NULL,
4019-- N_("Show the folder which contains this file in the file manager"),
4020-- G_CALLBACK (ev_window_cmd_open_containing_folder) },
4021-- { "FilePrint", GTK_STOCK_PRINT, N_("_Print…"), "<control>P",
4022-- N_("Print this document"),
4023-- G_CALLBACK (ev_window_cmd_file_print) },
4024-- { "FileProperties", GTK_STOCK_PROPERTIES, N_("P_roperties"), "<alt>Return", NULL,
4025-- G_CALLBACK (ev_window_cmd_file_properties) },
4026-- { "FileCloseWindow", GTK_STOCK_CLOSE, NULL, "<control>W", NULL,
4027-- G_CALLBACK (ev_window_cmd_file_close_window) },
4028--
4029-- /* Edit menu */
4030-- { "EditCopy", GTK_STOCK_COPY, NULL, "<control>C", NULL,
4031-- G_CALLBACK (ev_window_cmd_edit_copy) },
4032-- { "EditSelectAll", GTK_STOCK_SELECT_ALL, N_("Select _All"), "<control>A", NULL,
4033-- G_CALLBACK (ev_window_cmd_edit_select_all) },
4034-- { "EditRotateLeft", EV_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "<control>Left", NULL,
4035-- G_CALLBACK (ev_window_cmd_edit_rotate_left) },
4036-- { "EditRotateRight", EV_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "<control>Right", NULL,
4037-- G_CALLBACK (ev_window_cmd_edit_rotate_right) },
4038-- { "EditSaveSettings", NULL, N_("Save Current Settings as _Default"), "<control>T", NULL,
4039-- G_CALLBACK (ev_window_cmd_edit_save_settings) },
4040--
4041--
4042-- /* View menu */
4043-- { "ViewZoomIn", GTK_STOCK_ZOOM_IN, NULL, "<control>plus",
4044-- N_("Enlarge the document"),
4045-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4046-- { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "<control>minus",
4047-- N_("Shrink the document"),
4048-- G_CALLBACK (ev_window_cmd_view_zoom_out) },
4049-- { "ViewReload", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
4050-- N_("Reload the document"),
4051-- G_CALLBACK (ev_window_cmd_view_reload) },
4052--
4053-- { "ViewAutoscroll", GTK_STOCK_MEDIA_PLAY, N_("Auto_scroll"), NULL, NULL,
4054-- G_CALLBACK (ev_window_cmd_view_autoscroll) },
4055--
4056-- /* Go menu */
4057-- { "GoPreviousPage", "go-up-symbolic", N_("_Previous Page"), "<control>Page_Up",
4058-- N_("Go to the previous page"),
4059-- G_CALLBACK (ev_window_cmd_go_previous_page) },
4060-- { "GoNextPage", "go-down-symbolic", N_("_Next Page"), "<control>Page_Down",
4061-- N_("Go to the next page"),
4062-- G_CALLBACK (ev_window_cmd_go_next_page) },
4063-- { "GoFirstPage", GTK_STOCK_GOTO_TOP, N_("_First Page"), "<control>Home",
4064-- N_("Go to the first page"),
4065-- G_CALLBACK (ev_window_cmd_go_first_page) },
4066-- { "GoLastPage", GTK_STOCK_GOTO_BOTTOM, N_("_Last Page"), "<control>End",
4067-- N_("Go to the last page"),
4068-- G_CALLBACK (ev_window_cmd_go_last_page) },
4069-- { "GoToPage", GTK_STOCK_GOTO_TOP, N_("Go to Pa_ge"),"<control>L",
4070-- N_("Go to Page"),
4071-- G_CALLBACK (ev_window_cmd_focus_page_selector) },
4072--
4073-- /* Bookmarks menu */
4074-- { "BookmarksAdd", GTK_STOCK_ADD, N_("_Add Bookmark"), "<control>D",
4075-- N_("Add a bookmark for the current page"),
4076-- G_CALLBACK (ev_window_cmd_bookmarks_add) },
4077--
4078-- { "HelpAbout", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL,
4079-- G_CALLBACK (ev_window_cmd_help_about) },
4080--
4081-- /* Toolbar-only */
4082-- { "LeaveFullscreen", GTK_STOCK_LEAVE_FULLSCREEN, N_("Leave Fullscreen"), NULL,
4083-- N_("Leave fullscreen mode"),
4084-- G_CALLBACK (ev_window_cmd_leave_fullscreen) },
4085-- { "StartPresentation", EV_STOCK_RUN_PRESENTATION, N_("Start Presentation"), NULL,
4086-- N_("Start a presentation"),
4087-- G_CALLBACK (ev_window_cmd_start_presentation) },
4088--
4089-- /* Accellerators */
4090-- { "Escape", NULL, "", "Escape", "",
4091-- G_CALLBACK (ev_window_cmd_escape) },
4092-- { "CtrlF", GTK_STOCK_FIND, NULL, "<control>F", NULL,
4093-- G_CALLBACK (ev_window_cmd_edit_find) },
4094-- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL,
4095-- G_CALLBACK (ev_window_cmd_edit_find) },
4096-- { "F3", NULL, "", "F3", NULL,
4097-- G_CALLBACK (ev_window_cmd_edit_find_next) },
4098-- { "CtrlG", NULL, "", "<control>G", NULL,
4099-- G_CALLBACK (ev_window_cmd_edit_find_next) },
4100-- { "ShiftCtrlG", NULL, "", "<shift><control>G", NULL,
4101-- G_CALLBACK (ev_window_cmd_edit_find_previous) },
4102-- { "PageDown", NULL, "", "Page_Down", NULL,
4103-- G_CALLBACK (ev_window_cmd_scroll_forward) },
4104-- { "PageUp", NULL, "", "Page_Up", NULL,
4105-- G_CALLBACK (ev_window_cmd_scroll_backward) },
4106-- { "p", GTK_STOCK_GO_UP, "", "p", NULL,
4107-- G_CALLBACK (ev_window_cmd_go_previous_page) },
4108-- { "n", GTK_STOCK_GO_DOWN, "", "n", NULL,
4109-- G_CALLBACK (ev_window_cmd_go_next_page) },
4110-- { "Plus", GTK_STOCK_ZOOM_IN, NULL, "plus", NULL,
4111-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4112-- { "CtrlEqual", GTK_STOCK_ZOOM_IN, NULL, "<control>equal", NULL,
4113-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4114-- { "Equal", GTK_STOCK_ZOOM_IN, NULL, "equal", NULL,
4115-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4116-- { "Minus", GTK_STOCK_ZOOM_OUT, NULL, "minus", NULL,
4117-- G_CALLBACK (ev_window_cmd_view_zoom_out) },
4118-- { "FocusPageSelector", NULL, "", "<control>l", NULL,
4119-- G_CALLBACK (ev_window_cmd_focus_page_selector) },
4120-- { "GoBackwardFast", NULL, "", "<shift>Page_Up", NULL,
4121-- G_CALLBACK (ev_window_cmd_go_backward) },
4122-- { "GoForwardFast", NULL, "", "<shift>Page_Down", NULL,
4123-- G_CALLBACK (ev_window_cmd_go_forward) },
4124-- { "KpPlus", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL,
4125-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4126-- { "KpMinus", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", NULL,
4127-- G_CALLBACK (ev_window_cmd_view_zoom_out) },
4128-- { "CtrlKpPlus", GTK_STOCK_ZOOM_IN, NULL, "<control>KP_Add", NULL,
4129-- G_CALLBACK (ev_window_cmd_view_zoom_in) },
4130-- { "CtrlKpMinus", GTK_STOCK_ZOOM_OUT, NULL, "<control>KP_Subtract", NULL,
4131-- G_CALLBACK (ev_window_cmd_view_zoom_out) },
4132-- { "CtrlInsert", GTK_STOCK_COPY, NULL, "<control>Insert", NULL,
4133-- G_CALLBACK (ev_window_cmd_edit_copy) },
4134-- { "FitPage", EV_STOCK_ZOOM_PAGE, NULL, "f", NULL,
4135-- G_CALLBACK (ev_window_cmd_fit_page) },
4136-- { "FitWidth", EV_STOCK_ZOOM_WIDTH, NULL, "w", NULL,
4137-- G_CALLBACK (ev_window_cmd_fit_width) },
4138-- { "F10", NULL, "", "F10", NULL,
4139-- G_CALLBACK (ev_window_cmd_action_menu) },
4140-- { "F7", NULL, "", "F7", NULL,
4141-- G_CALLBACK (ev_window_cmd_view_toggle_caret_navigation) },
4142--};
4143--
4144--/* Toggle items */
4145--static const GtkToggleActionEntry toggle_entries[] = {
4146-- /* View Menu */
4147-- { "ViewSidebar", GTK_STOCK_INDEX, N_("Side _Pane"), "F9",
4148-- N_("Show or hide the side pane"),
4149-- G_CALLBACK (ev_window_view_sidebar_cb), TRUE },
4150-- { "ViewContinuous", EV_STOCK_VIEW_CONTINUOUS, N_("_Continuous"), NULL,
4151-- N_("Show the entire document"),
4152-- G_CALLBACK (ev_window_cmd_continuous), TRUE },
4153-- { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual"), NULL,
4154-- N_("Show two pages at once"),
4155-- G_CALLBACK (ev_window_cmd_dual), FALSE },
4156-- { "ViewDualOddLeft", NULL, N_("_Odd Pages Left"), NULL,
4157-- N_("Show odd pages on the left in dual mode"),
4158-- G_CALLBACK (ev_window_cmd_dual_odd_pages_left), FALSE },
4159-- { "ViewFullscreen", GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), "F11",
4160-- N_("Expand the window to fill the screen"),
4161-- G_CALLBACK (ev_window_cmd_view_fullscreen) },
4162-- { "ViewPresentation", EV_STOCK_RUN_PRESENTATION, N_("Pre_sentation"), "F5",
4163-- N_("Run document as a presentation"),
4164-- G_CALLBACK (ev_window_cmd_view_presentation) },
4165-- { "ViewInvertedColors", EV_STOCK_INVERTED_COLORS, N_("_Inverted Colors"), "<control>I",
4166-- N_("Show page contents with the colors inverted"),
4167-- G_CALLBACK (ev_window_cmd_view_inverted_colors) },
4168--
4169-- { "EditFind", "edit-find-symbolic", N_("_Find…"), "<control>F",
4170-- N_("Find a word or phrase in the document"),
4171-- G_CALLBACK (ev_window_cmd_toggle_find) },
4172--};
4173--
4174--/* Popups specific items */
4175--static const GtkActionEntry view_popup_entries [] = {
4176-- /* Links */
4177-- { "OpenLink", GTK_STOCK_OPEN, N_("_Open Link"), NULL,
4178-- NULL, G_CALLBACK (ev_view_popup_cmd_open_link) },
4179-- { "GoLink", GTK_STOCK_GO_FORWARD, N_("_Go To"), NULL,
4180-- NULL, G_CALLBACK (ev_view_popup_cmd_open_link) },
4181-- { "OpenLinkNewWindow", NULL, N_("Open in New _Window"), NULL,
4182-- NULL, G_CALLBACK (ev_view_popup_cmd_open_link_new_window) },
4183-- { "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL,
4184-- NULL, G_CALLBACK (ev_view_popup_cmd_copy_link_address) },
4185-- { "SaveImageAs", NULL, N_("_Save Image As…"), NULL,
4186-- NULL, G_CALLBACK (ev_view_popup_cmd_save_image_as) },
4187-- { "CopyImage", NULL, N_("Copy _Image"), NULL,
4188-- NULL, G_CALLBACK (ev_view_popup_cmd_copy_image) },
4189-- { "AnnotProperties", NULL, N_("Annotation Properties…"), NULL,
4190-- NULL, G_CALLBACK (ev_view_popup_cmd_annot_properties) }
4191--};
4192--
4193--static const GtkActionEntry attachment_popup_entries [] = {
4194-- { "OpenAttachment", GTK_STOCK_OPEN, N_("_Open Attachment"), NULL,
4195-- NULL, G_CALLBACK (ev_attachment_popup_cmd_open_attachment) },
4196-- { "SaveAttachmentAs", GTK_STOCK_SAVE_AS, N_("_Save Attachment As…"), NULL,
4197-- NULL, G_CALLBACK (ev_attachment_popup_cmd_save_attachment_as) },
4198--};
4199--
4200- static const GtkToggleActionEntry zoom_selector_popup_actions[] = {
4201- { "ViewFitPage", EV_STOCK_ZOOM_PAGE, N_("Fit Pa_ge"), NULL,
4202- N_("Make the current document fill the window"),
4203-@@ -6276,13 +5650,6 @@
4204- }
4205-
4206- static void
4207--sidebar_bookmarks_add_bookmark (EvSidebarBookmarks *sidebar_bookmarks,
4208-- EvWindow *window)
4209--{
4210-- ev_window_cmd_bookmarks_add (NULL, window);
4211--}
4212--
4213--static void
4214- zoom_action_activated_cb (EvZoomAction *action,
4215- EvWindow *window)
4216- {
4217-@@ -6378,42 +5745,6 @@
4218- }
4219-
4220- static void
4221--set_action_properties (GtkActionGroup *action_group)
4222--{
4223-- GtkAction *action;
4224--
4225-- action = gtk_action_group_get_action (action_group, "FileOpenContainingFolder");
4226-- /*translators: this is the label for toolbar button*/
4227-- g_object_set (action, "short_label", _("Open Folder"), NULL);
4228--
4229-- action = gtk_action_group_get_action (action_group, "FileSendTo");
4230-- /*translators: this is the label for toolbar button*/
4231-- g_object_set (action, "short_label", _("Send To"), NULL);
4232-- gtk_action_set_visible (action, nautilus_sendto != NULL);
4233--
4234-- action = gtk_action_group_get_action (action_group, "GoPreviousPage");
4235-- g_object_set (action, "is-important", TRUE, NULL);
4236-- /*translators: this is the label for toolbar button*/
4237-- g_object_set (action, "short_label", _("Previous"), NULL);
4238--
4239-- action = gtk_action_group_get_action (action_group, "GoNextPage");
4240-- g_object_set (action, "is-important", TRUE, NULL);
4241-- /*translators: this is the label for toolbar button*/
4242-- g_object_set (action, "short_label", _("Next"), NULL);
4243--
4244-- action = gtk_action_group_get_action (action_group, "ViewZoomIn");
4245-- /*translators: this is the label for toolbar button*/
4246-- g_object_set (action, "short_label", _("Zoom In"), NULL);
4247--
4248-- action = gtk_action_group_get_action (action_group, "ViewZoomOut");
4249-- /*translators: this is the label for toolbar button*/
4250-- g_object_set (action, "short_label", _("Zoom Out"), NULL);
4251--
4252-- action = gtk_action_group_get_action (action_group, "LeaveFullscreen");
4253-- g_object_set (action, "is-important", TRUE, NULL);
4254--}
4255--
4256--static void
4257- sidebar_widget_model_set (EvSidebarLinks *ev_sidebar_links,
4258- GParamSpec *pspec,
4259- EvWindow *ev_window)
4260-@@ -6647,21 +5978,21 @@
4261- const gchar *name = ev_link_action_get_name (action);
4262-
4263- if (g_ascii_strcasecmp (name, "FirstPage") == 0) {
4264-- ev_window_cmd_go_first_page (NULL, window);
4265-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-first-page", NULL);
4266- } else if (g_ascii_strcasecmp (name, "PrevPage") == 0) {
4267-- ev_window_cmd_go_previous_page (NULL, window);
4268-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-previous-page", NULL);
4269- } else if (g_ascii_strcasecmp (name, "NextPage") == 0) {
4270-- ev_window_cmd_go_next_page (NULL, window);
4271-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-next-page", NULL);
4272- } else if (g_ascii_strcasecmp (name, "LastPage") == 0) {
4273-- ev_window_cmd_go_last_page (NULL, window);
4274-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-last-page", NULL);
4275- } else if (g_ascii_strcasecmp (name, "GoToPage") == 0) {
4276-- ev_window_cmd_focus_page_selector (NULL, window);
4277-+ g_action_group_activate_action (G_ACTION_GROUP (window), "select-page", NULL);
4278- } else if (g_ascii_strcasecmp (name, "Find") == 0) {
4279-- ev_window_show_find_bar (window);
4280-+ g_action_group_activate_action (G_ACTION_GROUP (window), "find", NULL);
4281- } else if (g_ascii_strcasecmp (name, "Close") == 0) {
4282-- ev_window_cmd_file_close_window (NULL, window);
4283-+ g_action_group_activate_action (G_ACTION_GROUP (window), "close", NULL);
4284- } else if (g_ascii_strcasecmp (name, "Print") == 0) {
4285-- ev_window_cmd_file_print (NULL, window);
4286-+ g_action_group_activate_action (G_ACTION_GROUP (window), "print", NULL);
4287- } else {
4288- g_warning ("Unimplemented named action: %s, please post a "
4289- "bug report in Evince bugzilla "
4290-@@ -6702,14 +6033,21 @@
4291- }
4292-
4293- static void
4294--ev_view_popup_cmd_open_link (GtkAction *action, EvWindow *window)
4295-+ev_window_activate_open_link_action (GSimpleAction *action,
4296-+ GVariant *parameter,
4297-+ gpointer user_data)
4298- {
4299-+ EvWindow *window = user_data;
4300-+
4301- ev_view_handle_link (EV_VIEW (window->priv->view), window->priv->link);
4302- }
4303-
4304- static void
4305--ev_view_popup_cmd_open_link_new_window (GtkAction *action, EvWindow *window)
4306-+ev_window_activate_open_link_in_new_window_action (GSimpleAction *action,
4307-+ GVariant *parameter,
4308-+ gpointer user_data)
4309- {
4310-+ EvWindow *window = user_data;
4311- EvLinkAction *ev_action = NULL;
4312- EvLinkDest *dest;
4313-
4314-@@ -6725,8 +6063,11 @@
4315- }
4316-
4317- static void
4318--ev_view_popup_cmd_copy_link_address (GtkAction *action, EvWindow *window)
4319-+ev_window_activate_copy_link_address_action (GSimpleAction *action,
4320-+ GVariant *parameter,
4321-+ gpointer user_data)
4322- {
4323-+ EvWindow *window = user_data;
4324- EvLinkAction *ev_action;
4325-
4326- ev_action = ev_link_get_action (window->priv->link);
4327-@@ -6782,8 +6123,8 @@
4328- return;
4329- }
4330-
4331-- ev_window_file_chooser_save_folder (ev_window, GTK_FILE_CHOOSER (fc),
4332-- G_USER_DIRECTORY_PICTURES);
4333-+ ev_file_chooser_save_folder (GTK_FILE_CHOOSER (fc),
4334-+ G_USER_DIRECTORY_PICTURES);
4335-
4336- uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc));
4337- filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (fc));
4338-@@ -6862,8 +6203,11 @@
4339- }
4340-
4341- static void
4342--ev_view_popup_cmd_save_image_as (GtkAction *action, EvWindow *window)
4343-+ev_window_activate_save_image_action (GSimpleAction *action,
4344-+ GVariant *parameter,
4345-+ gpointer user_data)
4346- {
4347-+ EvWindow *window = user_data;
4348- GtkWidget *fc;
4349-
4350- if (!window->priv->image)
4351-@@ -6887,9 +6231,9 @@
4352- gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
4353-
4354- file_chooser_dialog_add_writable_pixbuf_formats (GTK_FILE_CHOOSER (fc));
4355--
4356-- ev_window_file_chooser_restore_folder (window, GTK_FILE_CHOOSER (fc), NULL,
4357-- G_USER_DIRECTORY_PICTURES);
4358-+
4359-+ ev_file_chooser_restore_folder (GTK_FILE_CHOOSER (fc), NULL,
4360-+ G_USER_DIRECTORY_PICTURES);
4361-
4362- g_signal_connect (fc, "response",
4363- G_CALLBACK (image_save_dialog_response_cb),
4364-@@ -6899,8 +6243,11 @@
4365- }
4366-
4367- static void
4368--ev_view_popup_cmd_copy_image (GtkAction *action, EvWindow *window)
4369-+ev_window_activate_copy_image_action (GSimpleAction *action,
4370-+ GVariant *parameter,
4371-+ gpointer user_data)
4372- {
4373-+ EvWindow *window = user_data;
4374- GtkClipboard *clipboard;
4375- GdkPixbuf *pixbuf;
4376-
4377-@@ -6919,9 +6266,11 @@
4378- }
4379-
4380- static void
4381--ev_view_popup_cmd_annot_properties (GtkAction *action,
4382-- EvWindow *window)
4383-+ev_window_activate_show_annotation_properties_action (GSimpleAction *action,
4384-+ GVariant *parameter,
4385-+ gpointer user_data)
4386- {
4387-+ EvWindow *window = user_data;
4388- const gchar *author;
4389- GdkRGBA rgba;
4390- gdouble opacity;
4391-@@ -6980,8 +6329,11 @@
4392- }
4393-
4394- static void
4395--ev_attachment_popup_cmd_open_attachment (GtkAction *action, EvWindow *window)
4396-+ev_window_activate_open_attachment_action (GSimpleAction *action,
4397-+ GVariant *parameter,
4398-+ gpointer user_data)
4399- {
4400-+ EvWindow *window = user_data;
4401- GList *l;
4402- GdkScreen *screen;
4403-
4404-@@ -7023,8 +6375,8 @@
4405- return;
4406- }
4407-
4408-- ev_window_file_chooser_save_folder (ev_window, GTK_FILE_CHOOSER (fc),
4409-- G_USER_DIRECTORY_DOCUMENTS);
4410-+ ev_file_chooser_save_folder (GTK_FILE_CHOOSER (fc),
4411-+ G_USER_DIRECTORY_DOCUMENTS);
4412-
4413- uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc));
4414- target_file = g_file_new_for_uri (uri);
4415-@@ -7089,8 +6441,11 @@
4416- }
4417-
4418- static void
4419--ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, EvWindow *window)
4420-+ev_window_activate_save_attachment_action (GSimpleAction *action,
4421-+ GVariant *parameter,
4422-+ gpointer user_data)
4423- {
4424-+ EvWindow *window = user_data;
4425- GtkWidget *fc;
4426- EvAttachment *attachment = NULL;
4427-
4428-@@ -7122,8 +6477,8 @@
4429- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc),
4430- ev_attachment_get_name (attachment));
4431-
4432-- ev_window_file_chooser_restore_folder (window, GTK_FILE_CHOOSER (fc), NULL,
4433-- G_USER_DIRECTORY_DOCUMENTS);
4434-+ ev_file_chooser_restore_folder (GTK_FILE_CHOOSER (fc), NULL,
4435-+ G_USER_DIRECTORY_DOCUMENTS);
4436-
4437- g_signal_connect (fc, "response",
4438- G_CALLBACK (attachment_save_dialog_response_cb),
4439-@@ -7154,16 +6509,16 @@
4440- if (EV_WINDOW_IS_PRESENTATION (window))
4441- ev_view_presentation_previous_page (EV_VIEW_PRESENTATION (window->priv->presentation_view));
4442- else
4443-- ev_window_cmd_go_previous_page (NULL, window);
4444-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-previous-page", NULL);
4445- } else if (strcmp (key, "Next") == 0) {
4446- if (EV_WINDOW_IS_PRESENTATION (window))
4447- ev_view_presentation_next_page (EV_VIEW_PRESENTATION (window->priv->presentation_view));
4448- else
4449-- ev_window_cmd_go_next_page (NULL, window);
4450-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-next-page", NULL);
4451- } else if (strcmp (key, "FastForward") == 0) {
4452-- ev_window_cmd_go_last_page (NULL, window);
4453-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-last-page", NULL);
4454- } else if (strcmp (key, "Rewind") == 0) {
4455-- ev_window_cmd_go_first_page (NULL, window);
4456-+ g_action_group_activate_action (G_ACTION_GROUP (window), "go-first-page", NULL);
4457- }
4458- }
4459-
4460-@@ -7278,11 +6633,84 @@
4461- }
4462-
4463- static void
4464-+activate_toggle_action (GSimpleAction *action,
4465-+ GVariant *parameter,
4466-+ gpointer user_data)
4467-+{
4468-+ GVariant *state;
4469-+
4470-+ state = g_action_get_state (G_ACTION (action));
4471-+ g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state)));
4472-+ g_variant_unref (state);
4473-+}
4474-+
4475-+static void
4476-+activate_radio_action (GSimpleAction *action,
4477-+ GVariant *parameter,
4478-+ gpointer user_data)
4479-+{
4480-+ g_action_change_state (G_ACTION (action), parameter);
4481-+}
4482-+
4483-+static void
4484- ev_window_init (EvWindow *ev_window)
4485- {
4486-+ const GActionEntry actions[] = {
4487-+ { "open-copy", ev_window_activate_open_copy_action, NULL, NULL, NULL },
4488-+ { "save-copy", ev_window_activate_save_copy_action, NULL, NULL, NULL },
4489-+ { "send-to", ev_window_activate_send_to_action, NULL, NULL, NULL },
4490-+ { "open-containing-folder", ev_window_activate_open_containing_folder_action, NULL, NULL, NULL },
4491-+ { "print", ev_window_activate_print_action, NULL, NULL, NULL },
4492-+ { "show-properties", ev_window_activate_show_properties_action, NULL, NULL, NULL },
4493-+ { "copy", ev_window_activate_copy_action, NULL, NULL, NULL },
4494-+ { "select-all", ev_window_activate_select_all_action, NULL, NULL, NULL },
4495-+ { "save-settings", ev_window_activate_save_settings_action, NULL, NULL, NULL },
4496-+ { "go-previous-page", ev_window_activate_go_previous_page_action, NULL, NULL, NULL },
4497-+ { "go-next-page", ev_window_activate_go_next_page_action, NULL, NULL, NULL },
4498-+ { "go-first-page", ev_window_activate_go_first_page_action, NULL, NULL, NULL },
4499-+ { "go-last-page", ev_window_activate_go_last_page_action, NULL, NULL, NULL },
4500-+ { "go-forward", ev_window_activate_go_forward_action, NULL, NULL, NULL },
4501-+ { "go-backwards", ev_window_activate_go_backward_action, NULL, NULL, NULL },
4502-+ { "find", activate_toggle_action, NULL, "false", ev_window_change_find_action_state },
4503-+ { "find-next", ev_window_activate_find_next_action, NULL, NULL, NULL },
4504-+ { "find-previous", ev_window_activate_find_previous_action, NULL, NULL, NULL },
4505-+ { "select-page", ev_window_activate_select_page_action, NULL, NULL, NULL },
4506-+ { "continuous", activate_toggle_action, NULL, "true", ev_window_change_continuous_action_state },
4507-+ { "dual-page", activate_toggle_action, NULL, "false", ev_window_change_dual_page_action_state },
4508-+ { "dual-odd-left", activate_toggle_action, NULL, "false", ev_window_change_dual_odd_left_action_state },
4509-+ { "show-side-pane", activate_toggle_action, NULL, "false", ev_window_change_show_side_pane_action_state },
4510-+ { "inverted-colors", activate_toggle_action, NULL, "false", ev_window_change_inverted_colors_action_state },
4511-+ { "fullscreen", activate_toggle_action, NULL, "false", ev_window_change_fullscreen_action_state },
4512-+ { "presentation", activate_toggle_action, NULL, "false", ev_window_change_presentation_action_state },
4513-+ { "rotate-left", ev_window_activate_rotate_left_action, NULL, NULL, NULL },
4514-+ { "rotate-right", ev_window_activate_rotate_right_action, NULL, NULL, NULL },
4515-+ { "zoom-in", ev_window_activate_zoom_in_action, NULL, NULL, NULL },
4516-+ { "zoom-out", ev_window_activate_zoom_out_action, NULL, NULL, NULL },
4517-+ { "reload", ev_window_activate_reload_action, NULL, NULL, NULL },
4518-+ { "auto-scroll", ev_window_activate_auto_scroll_action, NULL, NULL, NULL },
4519-+ { "add-bookmark", ev_window_activate_add_bookmark_action, NULL, NULL, NULL },
4520-+ { "goto-bookmark", ev_window_activate_goto_bookmark_action, "u", NULL, NULL },
4521-+ { "close", ev_window_activate_close_action, NULL, NULL, NULL },
4522-+ { "scroll-forward", ev_window_activate_scroll_forward_action, NULL, NULL, NULL },
4523-+ { "scroll-backwards", ev_window_activate_scroll_backwards_action, NULL, NULL, NULL },
4524-+ { "sizing-mode", activate_radio_action, "s", "'free'", ev_window_change_sizing_mode_action_state },
4525-+ { "escape", ev_window_activate_escape_action, NULL, NULL, NULL },
4526-+ { "open-menu", ev_window_activate_open_menu_command, NULL, NULL, NULL },
4527-+ { "caret-navigation", activate_toggle_action, NULL, "false", ev_window_change_caret_navigation_action_state },
4528-+ { "open-link", ev_window_activate_open_link_action, NULL, NULL, NULL },
4529-+ { "open-link-in-new-window", ev_window_activate_open_link_in_new_window_action, NULL, NULL, NULL },
4530-+ { "save-image", ev_window_activate_save_image_action, NULL, NULL, NULL },
4531-+ { "copy-image", ev_window_activate_copy_image_action, NULL, NULL, NULL },
4532-+ { "show-annotation-properties", ev_window_activate_show_annotation_properties_action, NULL, NULL, NULL },
4533-+ { "copy-link-address", ev_window_activate_copy_link_address_action, NULL, NULL, NULL },
4534-+ { "open-attachment", ev_window_activate_open_attachment_action, NULL, NULL, NULL },
4535-+ { "save-attachment", ev_window_activate_save_attachment_action, NULL, NULL, NULL },
4536-+ };
4537-+
4538- GtkActionGroup *action_group;
4539- GtkAccelGroup *accel_group;
4540- GtkCssProvider *css_provider;
4541-+ GtkBuilder *builder;
4542- GError *error = NULL;
4543- GtkWidget *sidebar_widget;
4544- GtkWidget *overlay;
4545-@@ -7343,6 +6771,8 @@
4546- G_CALLBACK (activate_link_cb),
4547- ev_window);
4548-
4549-+ ev_window->priv->bookmarks_menu = g_menu_new ();
4550-+
4551- app_info = g_app_info_get_default_for_uri_scheme ("mailto");
4552- ev_window->priv->has_mailto_handler = app_info != NULL;
4553- g_clear_object (&app_info);
4554-@@ -7351,15 +6781,13 @@
4555- gtk_container_add (GTK_CONTAINER (ev_window), ev_window->priv->main_box);
4556- gtk_widget_show (ev_window->priv->main_box);
4557-
4558-+ g_action_map_add_action_entries (G_ACTION_MAP (ev_window),
4559-+ actions, G_N_ELEMENTS (actions),
4560-+ ev_window);
4561-+
4562- action_group = gtk_action_group_new ("MenuActions");
4563- ev_window->priv->action_group = action_group;
4564- gtk_action_group_set_translation_domain (action_group, NULL);
4565-- gtk_action_group_add_actions (action_group, entries,
4566-- G_N_ELEMENTS (entries), ev_window);
4567-- gtk_action_group_add_toggle_actions (action_group, toggle_entries,
4568-- G_N_ELEMENTS (toggle_entries),
4569-- ev_window);
4570-- set_action_properties (action_group);
4571- register_custom_actions (ev_window, action_group);
4572-
4573- ev_window->priv->ui_manager = gtk_ui_manager_new ();
4574-@@ -7370,24 +6798,6 @@
4575- gtk_ui_manager_get_accel_group (ev_window->priv->ui_manager);
4576- gtk_window_add_accel_group (GTK_WINDOW (ev_window), accel_group);
4577-
4578-- action_group = gtk_action_group_new ("ViewPopupActions");
4579-- ev_window->priv->view_popup_action_group = action_group;
4580-- gtk_action_group_set_translation_domain (action_group, NULL);
4581-- gtk_action_group_add_actions (action_group, view_popup_entries,
4582-- G_N_ELEMENTS (view_popup_entries),
4583-- ev_window);
4584-- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
4585-- action_group, 0);
4586--
4587-- action_group = gtk_action_group_new ("AttachmentPopupActions");
4588-- ev_window->priv->attachment_popup_action_group = action_group;
4589-- gtk_action_group_set_translation_domain (action_group, NULL);
4590-- gtk_action_group_add_actions (action_group, attachment_popup_entries,
4591-- G_N_ELEMENTS (attachment_popup_entries),
4592-- ev_window);
4593-- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
4594-- action_group, 0);
4595--
4596- action_group = gtk_action_group_new ("ZoomSelectorPopupActions");
4597- ev_window->priv->zoom_selector_popup_action_group = action_group;
4598- gtk_action_group_set_translation_domain (action_group, NULL);
4599-@@ -7397,10 +6807,10 @@
4600- gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
4601- action_group, 0);
4602-
4603-- gtk_ui_manager_add_ui_from_resource (ev_window->priv->ui_manager,
4604-- "/org/gnome/evince/shell/ui/evince.xml",
4605-- &error);
4606-- g_assert_no_error (error);
4607-+ gtk_ui_manager_add_ui_from_resource (ev_window->priv->ui_manager,
4608-+ "/org/gnome/evince/shell/ui/evince.xml",
4609-+ &error);
4610-+ g_assert_no_error (error);
4611-
4612- ev_window_register_zoom_selector_popup_actions (ev_window);
4613-
4614-@@ -7415,12 +6825,6 @@
4615- g_object_unref (css_provider);
4616-
4617- ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
4618-- ev_window->priv->recent_action_group = NULL;
4619-- ev_window->priv->recent_ui_id = 0;
4620-- g_signal_connect_swapped (ev_window->priv->recent_manager,
4621-- "changed",
4622-- G_CALLBACK (ev_window_setup_recent),
4623-- ev_window);
4624-
4625- ev_window->priv->toolbar = ev_toolbar_new (ev_window);
4626- gtk_widget_set_no_show_all (ev_window->priv->toolbar, TRUE);
4627-@@ -7526,10 +6930,6 @@
4628-
4629- sidebar_widget = ev_sidebar_bookmarks_new ();
4630- ev_window->priv->sidebar_bookmarks = sidebar_widget;
4631-- g_signal_connect (sidebar_widget,
4632-- "add-bookmark",
4633-- G_CALLBACK (sidebar_bookmarks_add_bookmark),
4634-- ev_window);
4635- gtk_widget_show (sidebar_widget);
4636- ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar),
4637- sidebar_widget);
4638-@@ -7565,7 +6965,7 @@
4639- g_object_set(ev_window->priv->view, "enable-gestures",
4640- _oif_ev_application_get_gestures_enabled (EV_APP), NULL);
4641- #endif
4642-- page_cache_mb = g_settings_get_uint (ev_window_ensure_settings (ev_window),
4643-+ page_cache_mb = g_settings_get_uint (ev_application_get_settings (EV_APP),
4644- GS_PAGE_CACHE_SIZE);
4645- ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view),
4646- page_cache_mb * 1024 * 1024);
4647-@@ -7707,13 +7107,17 @@
4648- G_CALLBACK (find_bar_visibility_changed_cb),
4649- ev_window);
4650-
4651-+ builder = gtk_builder_new_from_resource ("/org/gnome/evince/shell/ui/popup-menus.ui");
4652-+
4653- /* Popups */
4654-- ev_window->priv->view_popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
4655-- "/DocumentPopup");
4656-- ev_window->priv->link = NULL;
4657-+ ev_window->priv->document_view_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "document-view-menu"));
4658-+ ev_window->priv->external_link_section = G_MENU_MODEL (gtk_builder_get_object (builder, "external-link-menu"));
4659-+ ev_window->priv->internal_link_section = G_MENU_MODEL (gtk_builder_get_object (builder, "internal-link-menu"));
4660-+ ev_window->priv->image_section = G_MENU_MODEL (gtk_builder_get_object (builder, "image-menu"));
4661-+ ev_window->priv->attachment_section = G_MENU_MODEL (gtk_builder_get_object (builder, "attachment-menu"));
4662-+ ev_window->priv->annotation_section = G_MENU_MODEL (gtk_builder_get_object (builder, "annotation-menu"));
4663-
4664-- ev_window->priv->attachment_popup = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
4665-- "/AttachmentPopup");
4666-+ ev_window->priv->link = NULL;
4667- ev_window->priv->attach_list = NULL;
4668-
4669- /* Media player keys */
4670-@@ -7731,9 +7135,6 @@
4671- g_settings_delay (ev_window->priv->default_settings);
4672- ev_window_setup_default (ev_window);
4673-
4674-- /* Set it user interface params */
4675-- ev_window_setup_recent (ev_window);
4676--
4677- gtk_window_set_default_size (GTK_WINDOW (ev_window), 600, 600);
4678-
4679- ev_window_sizing_mode_changed_cb (ev_window->priv->model, NULL, ev_window);
4680-@@ -7745,6 +7146,8 @@
4681- NULL, 0,
4682- GDK_ACTION_COPY);
4683- gtk_drag_dest_add_uri_targets (GTK_WIDGET (ev_window));
4684-+
4685-+ g_object_unref (builder);
4686- }
4687-
4688- /**
4689-@@ -7762,7 +7165,6 @@
4690- ev_window = GTK_WIDGET (g_object_new (EV_TYPE_WINDOW,
4691- "type", GTK_WINDOW_TOPLEVEL,
4692- "application", g_application_get_default (),
4693-- "show-menubar", FALSE,
4694- NULL));
4695-
4696- return ev_window;
4697-@@ -7801,3 +7203,11 @@
4698-
4699- return ev_window->priv->zoom_selector_popup_action_group;
4700- }
4701-+
4702-+GMenuModel *
4703-+ev_window_get_bookmarks_menu (EvWindow *ev_window)
4704-+{
4705-+ g_return_val_if_fail (EV_WINDOW (ev_window), NULL);
4706-+
4707-+ return G_MENU_MODEL (ev_window->priv->bookmarks_menu);
4708-+}
4709-Index: evince-3.10.3/shell/ev-window.h
4710-===================================================================
4711---- evince-3.10.3.orig/shell/ev-window.h 2014-04-28 15:33:25.038869346 +0200
4712-+++ evince-3.10.3/shell/ev-window.h 2014-04-28 15:33:25.034869346 +0200
4713-@@ -89,7 +89,7 @@
4714- GtkUIManager *ev_window_get_ui_manager (EvWindow *ev_window);
4715- GtkActionGroup *ev_window_get_main_action_group (EvWindow *ev_window);
4716- GtkActionGroup *ev_window_get_zoom_selector_action_group (EvWindow *ev_window);
4717--
4718-+GMenuModel *ev_window_get_bookmarks_menu (EvWindow *ev_window);
4719-
4720- G_END_DECLS
4721-
4722-Index: evince-3.10.3/shell/evince-appmenu.ui
4723-===================================================================
4724---- evince-3.10.3.orig/shell/evince-appmenu.ui 2014-04-28 15:33:25.038869346 +0200
4725-+++ evince-3.10.3/shell/evince-appmenu.ui 2014-04-28 15:33:25.034869346 +0200
4726-@@ -20,6 +20,16 @@
4727- <menu id="appmenu">
4728- <section>
4729- <item>
4730-+ <attribute name="label" translatable="yes">_Open</attribute>
4731-+ <attribute name="action">app.open</attribute>
4732-+ </item>
4733-+ </section>
4734-+ <section>
4735-+ <item>
4736-+ <attribute name="label" translatable="yes">_About</attribute>
4737-+ <attribute name="action">app.about</attribute>
4738-+ </item>
4739-+ <item>
4740- <attribute name="label" translatable="yes">_Help</attribute>
4741- <attribute name="action">app.help</attribute>
4742- <attribute name="accel">F1</attribute>
4743-Index: evince-3.10.3/shell/evince-ui.xml
4744-===================================================================
4745---- evince-3.10.3.orig/shell/evince-ui.xml 2014-04-28 15:33:25.038869346 +0200
4746-+++ evince-3.10.3/shell/evince-ui.xml 2014-04-28 15:33:25.034869346 +0200
4747-@@ -1,86 +1,4 @@
4748- <ui>
4749-- <popup name="ActionMenu" accelerators="true">
4750-- <menuitem name="FileOpenMenu" action="FileOpen"/>
4751-- <menuitem name="FileOpenCopyMenu" action="FileOpenCopy"/>
4752-- <menu name="RecentFilesMenu" action="RecentFiles">
4753-- <placeholder name="RecentFiles"/>
4754-- </menu>
4755-- <menuitem name="FileSaveAsMenu" action="FileSaveAs"/>
4756-- <menuitem name="FileSendToMenu" action="FileSendTo"/>
4757-- <menuitem name="FileOpenContainingFolderMenu" action="FileOpenContainingFolder"/>
4758-- <menuitem name="FilePrintMenu" action="FilePrint"/>
4759-- <separator/>
4760-- <menuitem name="FilePropertiesMenu" action="FileProperties"/>
4761-- <separator/>
4762-- <menuitem name="EditCopyMenu" action="EditCopy"/>
4763-- <menuitem name="EditSelectAllMenu" action="EditSelectAll"/>
4764-- <separator/>
4765-- <menuitem name="EditSaveSettingsMenu" action="EditSaveSettings"/>
4766-- <separator/>
4767-- <menuitem name="GoFirstPageMenu" action="GoFirstPage"/>
4768-- <menuitem name="GoLastPageMenu" action="GoLastPage"/>
4769-- <separator/>
4770-- <menuitem name="BookmarksAddMenu" action="BookmarksAdd"/>
4771-- <menu name="BookmarksMenu" action="Bookmarks">
4772-- <placeholder name="BookmarksItems"/>
4773-- </menu>
4774-- <separator/>
4775-- <menuitem name="FileCloseWindowMenu" action="FileCloseWindow"/>
4776-- <separator/>
4777-- <menuitem name="HelpAboutMenu" action="HelpAbout"/>
4778-- </popup>
4779--
4780-- <popup name="ViewMenuPopup" accelerators="true">
4781-- <menuitem name="ViewContinuousMenu" action="ViewContinuous"/>
4782-- <menuitem name="ViewDualMenu" action="ViewDual"/>
4783-- <separator/>
4784-- <menuitem name="ViewSidebarMenu" action="ViewSidebar"/>
4785-- <separator/>
4786-- <menuitem name="ViewFullscreenMenu" action="ViewFullscreen"/>
4787-- <menuitem name="ViewPresentationMenu" action="ViewPresentation"/>
4788-- <separator/>
4789-- <menuitem name="EditRotateLeftMenu" action="EditRotateLeft"/>
4790-- <menuitem name="EditRotateRightMenu" action="EditRotateRight"/>
4791-- <separator/>
4792-- <menuitem name="ViewZoomInMenu" action="ViewZoomIn"/>
4793-- <menuitem name="ViewZoomOutMenu" action="ViewZoomOut"/>
4794-- <separator/>
4795-- <menuitem name="ViewDualOddLeftMenu" action="ViewDualOddLeft"/>
4796-- <menuitem name="ViewInvertedColors" action="ViewInvertedColors"/>
4797-- <separator/>
4798-- <menuitem name="ViewReload" action="ViewReload"/>
4799-- </popup>
4800--
4801-- <popup name="DocumentPopup" action="DocumentPopupAction">
4802-- <menuitem name="OpenLink" action="OpenLink"/>
4803-- <menuitem name="CopyLinkAddress" action="CopyLinkAddress"/>
4804-- <menuitem name="GoLink" action="GoLink"/>
4805-- <menuitem name="OpenLinkNewWindow" action="OpenLinkNewWindow"/>
4806-- <separator/>
4807-- <menuitem name="GoPreviousPage" action="GoPreviousPage"/>
4808-- <menuitem name="GoNextPage" action="GoNextPage"/>
4809-- <menuitem name="ViewReload" action="ViewReload"/>
4810-- <menuitem name="ViewAutoscroll" action="ViewAutoscroll"/>
4811-- <separator/>
4812-- <menuitem name="EditCopy" action="EditCopy"/>
4813-- <menuitem name="EditSelectAllPopup" action="EditSelectAll"/>
4814-- <separator/>
4815-- <menuitem name="SaveImageAs" action="SaveImageAs"/>
4816-- <menuitem name="CopyImage" action="CopyImage"/>
4817-- <separator/>
4818-- <menuitem name="OpenAttachment" action="OpenAttachment"/>
4819-- <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/>
4820-- <separator/>
4821-- <menuitem name="AnnotProperties" action="AnnotProperties"/>
4822-- <menuitem name="FileOpenContainingFolder" action="FileOpenContainingFolder"/>
4823-- </popup>
4824--
4825-- <popup name="AttachmentPopup" action="AttachmentPopupAction">
4826-- <menuitem name="OpenAttachment" action="OpenAttachment"/>
4827-- <separator/>
4828-- <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/>
4829-- </popup>
4830--
4831- <popup name="ZoomSelectorPopup">
4832- <menuitem name="ViewFitPage" action="ViewFitPage"/>
4833- <menuitem name="ViewFitWidth" action="ViewFitWidth"/>
4834-@@ -88,31 +6,5 @@
4835- <separator/>
4836- <placeholder name="ViewZoomItems"/>
4837- </popup>
4838--
4839-- <accelerator name="PageDownAccel" action="PageDown"/>
4840-- <accelerator name="PageUpAccel" action="PageUp"/>
4841-- <accelerator name="GoBackwardFastAccel" action="GoBackwardFast"/>
4842-- <accelerator name="GoForwardFastAccel" action="GoForwardFast"/>
4843-- <accelerator name="EscapeAccel" action="Escape"/>
4844-- <accelerator name="CtrlFAccel" action="CtrlF"/>
4845-- <accelerator name="SlashAccel" action="Slash"/>
4846-- <accelerator name="F3Accel" action="F3"/>
4847-- <accelerator name="CtrlGAccel" action="CtrlG"/>
4848-- <accelerator name="ShiftCtrlGAccel" action="ShiftCtrlG"/>
4849-- <accelerator name="pAccel" action="p"/>
4850-- <accelerator name="nAccel" action="n"/>
4851-- <accelerator name="FocusPageSelectorAccel" action="FocusPageSelector"/>
4852-- <accelerator name="PlusAccel" action="Plus"/>
4853-- <accelerator name="MinusAccel" action="Minus"/>
4854-- <accelerator name="Equal" action="Equal"/>
4855-- <accelerator name="CtrlEqualAccel" action="CtrlEqual"/>
4856-- <accelerator name="KpPlusAccel" action="KpPlus"/>
4857-- <accelerator name="KpMinusAccel" action="KpMinus"/>
4858-- <accelerator name="CtrlKpPlusAccel" action="CtrlKpPlus"/>
4859-- <accelerator name="CtrlKpMinusAccel" action="CtrlKpMinus"/>
4860-- <accelerator name="CtrlInsertAccel" action="CtrlInsert" />
4861-- <accelerator name="FitPageAccel" action ="FitPage" />
4862-- <accelerator name="FitWidthAccel" action ="FitWidth" />
4863-- <accelerator name="F10Accel" action="F10" />
4864-- <accelerator name="F7Accel" action="F7" />
4865- </ui>
4866-+
4867-Index: evince-3.10.3/shell/evince.gresource.xml
4868-===================================================================
4869---- evince-3.10.3.orig/shell/evince.gresource.xml 2014-04-28 15:33:25.038869346 +0200
4870-+++ evince-3.10.3/shell/evince.gresource.xml 2014-04-28 15:33:25.034869346 +0200
4871-@@ -19,6 +19,8 @@
4872- <gresource prefix="/org/gnome/evince/shell">
4873- <file alias="ui/evince.xml" compressed="true" preprocess="xml-stripblanks">evince-ui.xml</file>
4874- <file alias="ui/evince.css" compressed="true">evince.css</file>
4875-- <file alias="ui/appmenu.ui" compressed="true" preprocess="xml-stripblanks">evince-appmenu.ui</file>
4876-+ <file alias="ui/menus.ui" compressed="true" preprocess="xml-stripblanks">menus.ui</file>
4877-+ <file alias="ui/traditional-menus.ui" compressed="true" preprocess="xml-stripblanks">traditional-menus.ui</file>
4878-+ <file alias="ui/popup-menus.ui" compressed="true" preprocess="xml-stripblanks">popup-menus.ui</file>
4879- </gresource>
4880- </gresources>
4881-Index: evince-3.10.3/shell/menus.ui
4882-===================================================================
4883---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4884-+++ evince-3.10.3/shell/menus.ui 2014-04-28 15:33:30.000000000 +0200
4885-@@ -0,0 +1,188 @@
4886-+<?xml version="1.0" encoding="UTF-8"?>
4887-+<!--
4888-+ Copyright © 2012 Christian Persch
4889-+ Copyright © 2014 Canonical Ltd.
4890-+
4891-+ This program is free software; you can redistribute it and/or modify
4892-+ it under the terms of the GNU General Public License as published by
4893-+ the Free Software Foundation; either version 3, or (at your option)
4894-+ any later version.
4895-+
4896-+ This program is distributed in the hope conf it will be useful,
4897-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4898-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4899-+ GNU General Public License for more details.
4900-+
4901-+ You should have received a copy of the GNU General Public License
4902-+ along with this program; if not, write to the Free Software
4903-+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4904-+-->
4905-+<interface>
4906-+ <menu id="appmenu">
4907-+ <section>
4908-+ <item>
4909-+ <attribute name="label" translatable="yes">_Open</attribute>
4910-+ <attribute name="action">app.open</attribute>
4911-+ </item>
4912-+ </section>
4913-+ <section>
4914-+ <item>
4915-+ <attribute name="label" translatable="yes">_About</attribute>
4916-+ <attribute name="action">app.about</attribute>
4917-+ </item>
4918-+ <item>
4919-+ <attribute name="label" translatable="yes">_Help</attribute>
4920-+ <attribute name="action">app.help</attribute>
4921-+ </item>
4922-+ </section>
4923-+ </menu>
4924-+
4925-+ <menu id="view-menu">
4926-+ <section>
4927-+ <item>
4928-+ <attribute name="label" translatable="yes">_Continuous</attribute>
4929-+ <attribute name="action">win.continuous</attribute>
4930-+ </item>
4931-+ <item>
4932-+ <attribute name="label" translatable="yes">_Dual</attribute>
4933-+ <attribute name="action">win.dual-page</attribute>
4934-+ </item>
4935-+ </section>
4936-+ <section>
4937-+ <item>
4938-+ <attribute name="label" translatable="yes">Side _Pane</attribute>
4939-+ <attribute name="action">win.show-side-pane</attribute>
4940-+ </item>
4941-+ </section>
4942-+ <section>
4943-+ <item>
4944-+ <attribute name="label" translatable="yes">_Fullscreen</attribute>
4945-+ <attribute name="action">win.fullscreen</attribute>
4946-+ </item>
4947-+ <item>
4948-+ <attribute name="label" translatable="yes">Pre_sentation</attribute>
4949-+ <attribute name="action">win.presentation</attribute>
4950-+ </item>
4951-+ </section>
4952-+ <section>
4953-+ <item>
4954-+ <attribute name="label" translatable="yes">Rotate _Left</attribute>
4955-+ <attribute name="action">win.rotate-left</attribute>
4956-+ </item>
4957-+ <item>
4958-+ <attribute name="label" translatable="yes">Rotate _Right</attribute>
4959-+ <attribute name="action">win.rotate-right</attribute>
4960-+ </item>
4961-+ </section>
4962-+ <section>
4963-+ <item>
4964-+ <attribute name="label" translatable="yes">Zoom _In</attribute>
4965-+ <attribute name="action">win.zoom-in</attribute>
4966-+ </item>
4967-+ <item>
4968-+ <attribute name="label" translatable="yes">Zoom _Out</attribute>
4969-+ <attribute name="action">win.zoom-out</attribute>
4970-+ </item>
4971-+ </section>
4972-+ <section>
4973-+ <item>
4974-+ <attribute name="label" translatable="yes">_Odd Pages Left</attribute>
4975-+ <attribute name="action">win.dual-odd-left</attribute>
4976-+ </item>
4977-+ <item>
4978-+ <attribute name="label" translatable="yes">_Inverted Colors</attribute>
4979-+ <attribute name="action">win.inverted-colors</attribute>
4980-+ </item>
4981-+ </section>
4982-+ <section>
4983-+ <item>
4984-+ <attribute name="label" translatable="yes">_Reload</attribute>
4985-+ <attribute name="action">win.reload</attribute>
4986-+ </item>
4987-+ </section>
4988-+ </menu>
4989-+
4990-+ <menu id="action-menu">
4991-+ <section>
4992-+ <item>
4993-+ <attribute name="label" translatable="yes">_Open…</attribute>
4994-+ <attribute name="action">app.open</attribute>
4995-+ </item>
4996-+ <item>
4997-+ <attribute name="label" translatable="yes">Op_en a Copy</attribute>
4998-+ <attribute name="action">win.open-copy</attribute>
4999-+ </item>
5000-+ <item>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: